s_id
stringlengths
10
10
p_id
stringlengths
6
6
u_id
stringlengths
10
10
date
stringlengths
10
10
language
stringclasses
1 value
original_language
stringclasses
11 values
filename_ext
stringclasses
1 value
status
stringclasses
1 value
cpu_time
int64
0
100
memory
stringlengths
4
6
code_size
int64
15
14.7k
code
stringlengths
15
14.7k
problem_id
stringlengths
6
6
problem_description
stringlengths
358
9.83k
input
stringlengths
2
4.87k
output
stringclasses
807 values
__index_level_0__
int64
1.1k
1.22M
s346338981
p01601
u633068244
1398503101
Python
Python
py
Accepted
20
4204
156
n1 = n2 = input() while 1: if n1 > -1 and n1 == int(str(n1)[::-1]): print n1 break elif n2 == int(str(n2)[::-1]): print n2 break n1 -= 1 n2 += 1
p01601
<script src="./IMAGE/varmath.js" charset="UTF-8"></script> <h2>回文数</h2> <h2>Problem Statement</h2> <p>整数<var>n</var>に最も近い回文数を求めよ.</p> <p>なお,非負整数<var>x</var>が回文数であるとは,<var>x</var>を十進法で表現した文字列とそれを反転させた文字列が等しいことをいう.<br /> 例えば0,7,33,10301などは回文数であり,32,90,1010などは回文数でない.</p> <h2>Input</h2> <p>入力は以下の形式に従う.与えられる数は全て整数で...
13
11
26,667
s115110622
p01601
u633068244
1398503259
Python
Python
py
Accepted
20
4204
149
n = input() i = 0 while 1: if n>=i and n-i == int(str(n-i)[::-1]): print n-i break elif n+i == int(str(n+i)[::-1]): print n+i break i += 1
p01601
<script src="./IMAGE/varmath.js" charset="UTF-8"></script> <h2>回文数</h2> <h2>Problem Statement</h2> <p>整数<var>n</var>に最も近い回文数を求めよ.</p> <p>なお,非負整数<var>x</var>が回文数であるとは,<var>x</var>を十進法で表現した文字列とそれを反転させた文字列が等しいことをいう.<br /> 例えば0,7,33,10301などは回文数であり,32,90,1010などは回文数でない.</p> <h2>Input</h2> <p>入力は以下の形式に従う.与えられる数は全て整数で...
13
11
26,668
s648760347
p01601
u633068244
1398503466
Python
Python
py
Accepted
20
4200
142
n = input() i = 0 while 1: n1,n2 = str(n-i), str(n+i) if n1 == n1[::-1]: print n1 break elif n2 == n2[::-1]: print n2 break i += 1
p01601
<script src="./IMAGE/varmath.js" charset="UTF-8"></script> <h2>回文数</h2> <h2>Problem Statement</h2> <p>整数<var>n</var>に最も近い回文数を求めよ.</p> <p>なお,非負整数<var>x</var>が回文数であるとは,<var>x</var>を十進法で表現した文字列とそれを反転させた文字列が等しいことをいう.<br /> 例えば0,7,33,10301などは回文数であり,32,90,1010などは回文数でない.</p> <h2>Input</h2> <p>入力は以下の形式に従う.与えられる数は全て整数で...
13
11
26,669
s810675876
p01601
u260980560
1398681710
Python
Python
py
Accepted
20
4216
282
def isPalindrome(n): s = str(n); l = len(s); for i in xrange(l/2): if s[i]!=s[-1-i]: return False return True n = input() p = q = n while isPalindrome(p)==False: p += 1 while isPalindrome(q)==False: q -= 1 print q if abs(n-q)<=abs(p-n) else p
p01601
<script src="./IMAGE/varmath.js" charset="UTF-8"></script> <h2>回文数</h2> <h2>Problem Statement</h2> <p>整数<var>n</var>に最も近い回文数を求めよ.</p> <p>なお,非負整数<var>x</var>が回文数であるとは,<var>x</var>を十進法で表現した文字列とそれを反転させた文字列が等しいことをいう.<br /> 例えば0,7,33,10301などは回文数であり,32,90,1010などは回文数でない.</p> <h2>Input</h2> <p>入力は以下の形式に従う.与えられる数は全て整数で...
13
11
26,670
s971451155
p01601
u260980560
1398681804
Python
Python
py
Accepted
20
4208
200
def isPalindrome(n): s = str(n) return s == s[::-1] n = input() p = q = n while isPalindrome(p)==False: p += 1 while isPalindrome(q)==False: q -= 1 print q if abs(n-q)<=abs(p-n) else p
p01601
<script src="./IMAGE/varmath.js" charset="UTF-8"></script> <h2>回文数</h2> <h2>Problem Statement</h2> <p>整数<var>n</var>に最も近い回文数を求めよ.</p> <p>なお,非負整数<var>x</var>が回文数であるとは,<var>x</var>を十進法で表現した文字列とそれを反転させた文字列が等しいことをいう.<br /> 例えば0,7,33,10301などは回文数であり,32,90,1010などは回文数でない.</p> <h2>Input</h2> <p>入力は以下の形式に従う.与えられる数は全て整数で...
13
11
26,671
s078027049
p01601
u990228206
1554275645
Python
Python3
py
Accepted
40
5636
221
import bisect rev=[] for i in range(1,10002): if str(i)==str(i)[::-1]:rev.append(i) n=int(input()) ind= bisect.bisect_left(rev,n) if abs(n-rev[ind-1])<=abs(n-rev[ind]): print(rev[ind-1]) else: print(rev[ind])
p01601
<script src="./IMAGE/varmath.js" charset="UTF-8"></script> <h2>回文数</h2> <h2>Problem Statement</h2> <p>整数<var>n</var>に最も近い回文数を求めよ.</p> <p>なお,非負整数<var>x</var>が回文数であるとは,<var>x</var>を十進法で表現した文字列とそれを反転させた文字列が等しいことをいう.<br /> 例えば0,7,33,10301などは回文数であり,32,90,1010などは回文数でない.</p> <h2>Input</h2> <p>入力は以下の形式に従う.与えられる数は全て整数で...
13
11
26,672
s819023339
p01602
u717526540
1545896475
Python
Python3
py
Accepted
30
5608
274
n = int(input()) pos = 0 flag = True for _ in range(n): k, num = input().split() num = int(num) if k == "(": pos += num else: pos -= num if pos < 0: flag = False if not flag or pos != 0: print("NO") else: print("YES")
p01602
<h2>()</h2> <h2>Problem Statement</h2> <p>文字列<var>S</var>がある.はじめ,<var>S</var>は空文字列である.<br /> 以下の処理を<var>n</var>個順番に行う.</p> <ul class="list1" style="padding-left:16px;margin-left:16px"><li><var>S</var>の末尾に<var>p_i</var>(=&quot;(&quot;または&quot;)&quot;)を<var>x_i</var>個追加する.</li></ul> <p>処理を施した後,<var>S</var>がバランスのとれた...
3 ( 5 ) 4 ) 1
YES
26,673
s746926713
p01602
u078042885
1484693315
Python
Python3
py
Accepted
30
7692
158
a=0 for _ in range(int(input())): b,c=input().split() a+= int(c) if b=='(' else -int(c) if a<0:print('NO');break else: print('NO' if a else 'YES')
p01602
<h2>()</h2> <h2>Problem Statement</h2> <p>文字列<var>S</var>がある.はじめ,<var>S</var>は空文字列である.<br /> 以下の処理を<var>n</var>個順番に行う.</p> <ul class="list1" style="padding-left:16px;margin-left:16px"><li><var>S</var>の末尾に<var>p_i</var>(=&quot;(&quot;または&quot;)&quot;)を<var>x_i</var>個追加する.</li></ul> <p>処理を施した後,<var>S</var>がバランスのとれた...
3 ( 5 ) 4 ) 1
YES
26,674
s136289570
p01602
u078042885
1484694047
Python
Python3
py
Accepted
30
7696
139
a=0 for _ in range(int(input())): b,c=input().split() a+=int(c) if b=='(' else -int(c) if a<0:break print('NO' if a else 'YES')
p01602
<h2>()</h2> <h2>Problem Statement</h2> <p>文字列<var>S</var>がある.はじめ,<var>S</var>は空文字列である.<br /> 以下の処理を<var>n</var>個順番に行う.</p> <ul class="list1" style="padding-left:16px;margin-left:16px"><li><var>S</var>の末尾に<var>p_i</var>(=&quot;(&quot;または&quot;)&quot;)を<var>x_i</var>個追加する.</li></ul> <p>処理を施した後,<var>S</var>がバランスのとれた...
3 ( 5 ) 4 ) 1
YES
26,675
s895100860
p01602
u609255173
1363748084
Python
Python
py
Accepted
20
4240
205
n = input() m = 0 for i in range(n): (p, x) = raw_input().split() x = int(x) if p == "(": m += x else: m -= x if m < 0: print "NO" quit() if m: print "NO" else: print "YES"
p01602
<h2>()</h2> <h2>Problem Statement</h2> <p>文字列<var>S</var>がある.はじめ,<var>S</var>は空文字列である.<br /> 以下の処理を<var>n</var>個順番に行う.</p> <ul class="list1" style="padding-left:16px;margin-left:16px"><li><var>S</var>の末尾に<var>p_i</var>(=&quot;(&quot;または&quot;)&quot;)を<var>x_i</var>個追加する.</li></ul> <p>処理を施した後,<var>S</var>がバランスのとれた...
3 ( 5 ) 4 ) 1
YES
26,676
s341337347
p01602
u633068244
1398505151
Python
Python
py
Accepted
20
4212
148
S = 0 for i in range(input()): p,x = raw_input().split() x = int(x) S += x if p == "(" else -x if S < 0: break print "YES" if S == 0 else "NO"
p01602
<h2>()</h2> <h2>Problem Statement</h2> <p>文字列<var>S</var>がある.はじめ,<var>S</var>は空文字列である.<br /> 以下の処理を<var>n</var>個順番に行う.</p> <ul class="list1" style="padding-left:16px;margin-left:16px"><li><var>S</var>の末尾に<var>p_i</var>(=&quot;(&quot;または&quot;)&quot;)を<var>x_i</var>個追加する.</li></ul> <p>処理を施した後,<var>S</var>がバランスのとれた...
3 ( 5 ) 4 ) 1
YES
26,677
s891711964
p01602
u853741520
1579741824
Python
Python3
py
Accepted
30
5608
292
n = int(input()) b = 0 ans = True for _ in range(n): p, x = input().split() x = int(x) if p == "(": b += x else: b -= x if b < 0: ans = False if ans: if b == 0: print("YES") else: print("NO") else: print("NO")
p01602
<h2>()</h2> <h2>Problem Statement</h2> <p>文字列<var>S</var>がある.はじめ,<var>S</var>は空文字列である.<br /> 以下の処理を<var>n</var>個順番に行う.</p> <ul class="list1" style="padding-left:16px;margin-left:16px"><li><var>S</var>の末尾に<var>p_i</var>(=&quot;(&quot;または&quot;)&quot;)を<var>x_i</var>個追加する.</li></ul> <p>処理を施した後,<var>S</var>がバランスのとれた...
3 ( 5 ) 4 ) 1
YES
26,678
s946181803
p01602
u853158149
1562312896
Python
Python3
py
Accepted
20
5604
238
n = int(input()) s = 0 f = 0 for i in range(n): p,x = input().split() x = int(x) if p == "(": s += x else: s -= x if s < 0: f = 1 if f or s != 0: print("NO") else: print("YES")
p01602
<h2>()</h2> <h2>Problem Statement</h2> <p>文字列<var>S</var>がある.はじめ,<var>S</var>は空文字列である.<br /> 以下の処理を<var>n</var>個順番に行う.</p> <ul class="list1" style="padding-left:16px;margin-left:16px"><li><var>S</var>の末尾に<var>p_i</var>(=&quot;(&quot;または&quot;)&quot;)を<var>x_i</var>個追加する.</li></ul> <p>処理を施した後,<var>S</var>がバランスのとれた...
3 ( 5 ) 4 ) 1
YES
26,679
s335261176
p01602
u990228206
1554276251
Python
Python3
py
Accepted
30
5612
216
n=int(input()) a,b=0,0 flag=0 for i in range(n): p,x=map(str,input().split()) if p=="(":a+=int(x) else:b+=int(x) if a<b: flag=1 break if flag==1 or a!=b:print("NO") else:print("YES")
p01602
<h2>()</h2> <h2>Problem Statement</h2> <p>文字列<var>S</var>がある.はじめ,<var>S</var>は空文字列である.<br /> 以下の処理を<var>n</var>個順番に行う.</p> <ul class="list1" style="padding-left:16px;margin-left:16px"><li><var>S</var>の末尾に<var>p_i</var>(=&quot;(&quot;または&quot;)&quot;)を<var>x_i</var>個追加する.</li></ul> <p>処理を施した後,<var>S</var>がバランスのとれた...
3 ( 5 ) 4 ) 1
YES
26,680
s801079691
p01604
u853158149
1562320625
Python
Python3
py
Accepted
30
6060
720
from heapq import heappush, heappop from collections import defaultdict n = int(input()) s = [input() for i in range(n)] start = tuple("sssssssssss") goal = tuple("ggggggggggg") s.append("ggggggggggg;") v = defaultdict(list) la = tuple([start[i] for i in range(11)]) k = 0 for i in s: if i[:4] == "goto": v[...
p01604
<h2>goto busters</h2> <h2>Problem Statement</h2> <p>あなたは謎のプログラムのソースコードを見つけた.<br /> さっそくコンパイルして実行してみたが,いつまで待っても処理が終わらない.<br /> どうやら,プログラムが無限ループしてしまっているようである.</p> <p>ソースコードを詳しく見てみたところ,以下のようなことがわかった.<br /></p> <p>ソースコードは <var>N</var> 行からなり,各行はラベル文か goto 文のいずれかである.<br /> ラベル文と goto 文はそれぞれ次のようなフォーマットに従っている.<br /></p> ...
2 LOOP: goto LOOP;
1
26,681
s616724063
p01610
u853158149
1562317901
Python
Python3
py
Accepted
20
5832
2,337
def rotate(s,k): s_ = [[s[i][j] for j in range(8)] for i in range(6)] if k == "R": s_[0][3] = s[2][3] s_[1][3] = s[3][3] s_[2][3] = s[4][3] s_[3][3] = s[5][3] s_[4][3] = s[3][6] s_[5][3] = s[2][6] s_[3][6] = s[0][3] s_[2][6] = s[1][3] s_[...
p01610
<h2>Cube of Two</h2> <h2>Problem Statement</h2> <p>日本で販売されているルービックキューブの各面の配色が, 世界で標準的に採用されているものに合わせられたのはつい最近のことだ.<br /> これに慣れるため,まずは簡単な2x2x2のキューブをスクランブルして遊ぼう.</p> <p>初期状態のルービックキューブは,各色が1つの面に集まるように揃えられており, 上面に赤色,正面に黄色,右側面に青色が見える.<br /> また,下面は橙色,背面は白色,左側面は緑色である. 展開図を用いると次のように表せる.</p> <img src="https://judgeapi.u-ai...
R
..ry.... ..ry.... ggyobbrw ggyobbrw ..ow.... ..ow....
26,682
s848229263
p01620
u352394527
1546352173
Python
Python3
py
Accepted
30
5812
366
a = ord("a") A = ord("A") dic1 = {} dic2 = {} for i in range(26): dic1[i] = chr(a + i) dic2[chr(a + i)] = i dic1[i + 26] = chr(A + i) dic2[chr(A + i)] = i + 26 while True: n = int(input()) if n == 0:break klst = list(map(int, input().split())) * 100 s = input() ans = "" for c, k in zip(s, klst): ...
p01620
<script src="./IMAGE/varmath.js" charset="UTF-8"></script> <!-- begin en only --> <!--<h3><u>King's Inspection</u></h3>--> <!-- end en only --> <!-- begin ja only --> <h1><u>王様の視察</u></h1> <!-- end ja only --> <!-- begin en only --> <!-- <p> English text is not available in this practice contest. </p> --> <!-- end en...
2 1 2 bdd 3 3 2 1 DDDA 5 3 1 4 5 3 dcdkIlkP 0
abc ABCx abZfFijL
26,698
s446991134
p01620
u621997536
1420904055
Python
Python3
py
Accepted
40
6724
419
al = [chr(c) for c in range(ord('A'), ord('Z') + 1)] + [chr(c) for c in range(ord('a'), ord('z') + 1)] def f1(c): if 'A' <= c <= 'Z': return ord(c) - ord('A') return ord(c) - ord('a') + ord('Z') - ord('A') + 1 while True: if not int(input()): break k = list(map(int, input().split())) ...
p01620
<script src="./IMAGE/varmath.js" charset="UTF-8"></script> <!-- begin en only --> <!--<h3><u>King's Inspection</u></h3>--> <!-- end en only --> <!-- begin ja only --> <h1><u>王様の視察</u></h1> <!-- end ja only --> <!-- begin en only --> <!-- <p> English text is not available in this practice contest. </p> --> <!-- end en...
2 1 2 bdd 3 3 2 1 DDDA 5 3 1 4 5 3 dcdkIlkP 0
abc ABCx abZfFijL
26,699
s473697632
p01620
u617183767
1421566791
Python
Python
py
Accepted
30
4680
938
#! /usr/bin/env python # -*- coding: utf-8 -*- import os import sys import itertools import math from collections import Counter, defaultdict class Main(object): def __init__(self): self.chars = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', ...
p01620
<script src="./IMAGE/varmath.js" charset="UTF-8"></script> <!-- begin en only --> <!--<h3><u>King's Inspection</u></h3>--> <!-- end en only --> <!-- begin ja only --> <h1><u>王様の視察</u></h1> <!-- end ja only --> <!-- begin en only --> <!-- <p> English text is not available in this practice contest. </p> --> <!-- end en...
2 1 2 bdd 3 3 2 1 DDDA 5 3 1 4 5 3 dcdkIlkP 0
abc ABCx abZfFijL
26,700
s088019017
p01620
u316268279
1421998899
Python
Python3
py
Accepted
50
6724
526
#!/usr/bin/env python # -*- coding: utf-8 -*- char_list = list(map(chr,range(ord('a'),ord('z')+1))) char_list += list(map(chr,range(ord('A'),ord('Z')+1))) while True: n = int(input()) if n == 0: break keys = list(map(int,input().split(" "))) sentence = input() for i in range(len(sentence)):...
p01620
<script src="./IMAGE/varmath.js" charset="UTF-8"></script> <!-- begin en only --> <!--<h3><u>King's Inspection</u></h3>--> <!-- end en only --> <!-- begin ja only --> <h1><u>王様の視察</u></h1> <!-- end ja only --> <!-- begin en only --> <!-- <p> English text is not available in this practice contest. </p> --> <!-- end en...
2 1 2 bdd 3 3 2 1 DDDA 5 3 1 4 5 3 dcdkIlkP 0
abc ABCx abZfFijL
26,701
s931921564
p01620
u731235119
1422030641
Python
Python
py
Accepted
20
4244
539
def myord(c): asc = ord(c) if asc <= 90: return asc else : return asc - 6 def mychr(asc): if asc <= 90: return chr(asc) else : return chr(asc + 6) import sys while 1: n = int(raw_input()) if n == 0: break k = map(int,raw_input().split()) length = len(k) inc = 0 station = [] s = raw_input() for ls...
p01620
<script src="./IMAGE/varmath.js" charset="UTF-8"></script> <!-- begin en only --> <!--<h3><u>King's Inspection</u></h3>--> <!-- end en only --> <!-- begin ja only --> <h1><u>王様の視察</u></h1> <!-- end ja only --> <!-- begin en only --> <!-- <p> English text is not available in this practice contest. </p> --> <!-- end en...
2 1 2 bdd 3 3 2 1 DDDA 5 3 1 4 5 3 dcdkIlkP 0
abc ABCx abZfFijL
26,702
s922190120
p01620
u180584272
1427264887
Python
Python
py
Accepted
20
4236
429
n2c = dict(zip(range(0,52),"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ")) c2n = dict(zip("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",range(0,52))) def f(c,k): return n2c[(c2n[c]-k)%52] while True: kl=int(raw_input()) if kl==0: break ks = map(int, raw_input().split()) oms = list(raw_input())...
p01620
<script src="./IMAGE/varmath.js" charset="UTF-8"></script> <!-- begin en only --> <!--<h3><u>King's Inspection</u></h3>--> <!-- end en only --> <!-- begin ja only --> <h1><u>王様の視察</u></h1> <!-- end ja only --> <!-- begin en only --> <!-- <p> English text is not available in this practice contest. </p> --> <!-- end en...
2 1 2 bdd 3 3 2 1 DDDA 5 3 1 4 5 3 dcdkIlkP 0
abc ABCx abZfFijL
26,703
s196323811
p01620
u233891002
1430548973
Python
Python
py
Accepted
20
4256
959
#!/usr/bin/python # -*- coding: utf-8 -*- import sys def main(): ...
p01620
<script src="./IMAGE/varmath.js" charset="UTF-8"></script> <!-- begin en only --> <!--<h3><u>King's Inspection</u></h3>--> <!-- end en only --> <!-- begin ja only --> <h1><u>王様の視察</u></h1> <!-- end ja only --> <!-- begin en only --> <!-- <p> English text is not available in this practice contest. </p> --> <!-- end en...
2 1 2 bdd 3 3 2 1 DDDA 5 3 1 4 5 3 dcdkIlkP 0
abc ABCx abZfFijL
26,704
s249548186
p01620
u506554532
1513351992
Python
Python3
py
Accepted
30
5612
367
d = '' for i in range(26): d += chr(ord('a') + i) for i in range(26): d += chr(ord('A') + i) def decode(c,key): i = d.find(c) return d[(i-key) % 52] while True: N = int(input()) if N == 0: break ks = list(map(int,input().split())) S = input() ans = '' for i,c in enumerate(S): ...
p01620
<script src="./IMAGE/varmath.js" charset="UTF-8"></script> <!-- begin en only --> <!--<h3><u>King's Inspection</u></h3>--> <!-- end en only --> <!-- begin ja only --> <h1><u>王様の視察</u></h1> <!-- end ja only --> <!-- begin en only --> <!-- <p> English text is not available in this practice contest. </p> --> <!-- end en...
2 1 2 bdd 3 3 2 1 DDDA 5 3 1 4 5 3 dcdkIlkP 0
abc ABCx abZfFijL
26,705
s655283305
p01620
u023471147
1527133429
Python
Python3
py
Accepted
30
5620
315
abc = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" while True: n = int(input()) if n == 0: break k = list(map(int, input().split())) s = str(input()) for itr, c in enumerate(s): idx = abc[(abc.find(c) - k[itr % n] + 52) % 52] print(idx, end = "") print()
p01620
<script src="./IMAGE/varmath.js" charset="UTF-8"></script> <!-- begin en only --> <!--<h3><u>King's Inspection</u></h3>--> <!-- end en only --> <!-- begin ja only --> <h1><u>王様の視察</u></h1> <!-- end ja only --> <!-- begin en only --> <!-- <p> English text is not available in this practice contest. </p> --> <!-- end en...
2 1 2 bdd 3 3 2 1 DDDA 5 3 1 4 5 3 dcdkIlkP 0
abc ABCx abZfFijL
26,706
s773882077
p01620
u509278866
1528086430
Python
Python3
py
Accepted
60
9048
971
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools sys.setrecursionlimit(10**7) inf = 10**20 eps = 1.0 / 10**10 mod = 998244353 def LI(): return [int(x) for x in sys.stdin.readline().split()] def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()] def LF...
p01620
<script src="./IMAGE/varmath.js" charset="UTF-8"></script> <!-- begin en only --> <!--<h3><u>King's Inspection</u></h3>--> <!-- end en only --> <!-- begin ja only --> <h1><u>王様の視察</u></h1> <!-- end ja only --> <!-- begin en only --> <!-- <p> English text is not available in this practice contest. </p> --> <!-- end en...
2 1 2 bdd 3 3 2 1 DDDA 5 3 1 4 5 3 dcdkIlkP 0
abc ABCx abZfFijL
26,707
s565914448
p01620
u011621222
1528371494
Python
Python3
py
Accepted
40
6720
313
import string letters = string.ascii_letters while True: n = int(input()) if n == 0: exit(0) k = list(map(int, input().split())) s = input() res = "" i = 0 for x in s: res += letters[letters.find(x) - k[i]] i = (i + 1) % n print(res)
p01620
<script src="./IMAGE/varmath.js" charset="UTF-8"></script> <!-- begin en only --> <!--<h3><u>King's Inspection</u></h3>--> <!-- end en only --> <!-- begin ja only --> <h1><u>王様の視察</u></h1> <!-- end ja only --> <!-- begin en only --> <!-- <p> English text is not available in this practice contest. </p> --> <!-- end en...
2 1 2 bdd 3 3 2 1 DDDA 5 3 1 4 5 3 dcdkIlkP 0
abc ABCx abZfFijL
26,708
s100925649
p01620
u591052358
1529671124
Python
Python3
py
Accepted
30
5640
870
def reset(n_lis,chr_lis): k = len(n_lis) for i in range(len(chr_lis)): n = ord(chr_lis[i]) a = n_lis[i%k] """ # print(n_lis) # if n>96 and n-a<97: n -= 6 if n-a<65: n+=58 n-=a chr_lis[i]=chr(n) """ c_type = True ...
p01620
<script src="./IMAGE/varmath.js" charset="UTF-8"></script> <!-- begin en only --> <!--<h3><u>King's Inspection</u></h3>--> <!-- end en only --> <!-- begin ja only --> <h1><u>王様の視察</u></h1> <!-- end ja only --> <!-- begin en only --> <!-- <p> English text is not available in this practice contest. </p> --> <!-- end en...
2 1 2 bdd 3 3 2 1 DDDA 5 3 1 4 5 3 dcdkIlkP 0
abc ABCx abZfFijL
26,709
s266475911
p01620
u136916346
1530541922
Python
Python3
py
Accepted
30
5680
237
from itertools import cycle f=lambda a,b:[chr(i) for i in range(a,b)] c=(f(97,123)+f(65,91))[::-1] c*=2 while int(input()): l=cycle(map(int,input().split())) s=input() print("".join([c[c.index(i)+j] for (i,j) in zip(s,l)]))
p01620
<script src="./IMAGE/varmath.js" charset="UTF-8"></script> <!-- begin en only --> <!--<h3><u>King's Inspection</u></h3>--> <!-- end en only --> <!-- begin ja only --> <h1><u>王様の視察</u></h1> <!-- end ja only --> <!-- begin en only --> <!-- <p> English text is not available in this practice contest. </p> --> <!-- end en...
2 1 2 bdd 3 3 2 1 DDDA 5 3 1 4 5 3 dcdkIlkP 0
abc ABCx abZfFijL
26,710
s822571169
p01620
u104911888
1372336116
Python
Python
py
Accepted
20
4268
509
L=['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', '\ P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'a', 'b', 'c', 'd', 'e', \ 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u',\ 'v', 'w', 'x', 'y', 'z'] while True: n=input() if n==0:break K=m...
p01620
<script src="./IMAGE/varmath.js" charset="UTF-8"></script> <!-- begin en only --> <!--<h3><u>King's Inspection</u></h3>--> <!-- end en only --> <!-- begin ja only --> <h1><u>王様の視察</u></h1> <!-- end ja only --> <!-- begin en only --> <!-- <p> English text is not available in this practice contest. </p> --> <!-- end en...
2 1 2 bdd 3 3 2 1 DDDA 5 3 1 4 5 3 dcdkIlkP 0
abc ABCx abZfFijL
26,711
s993014081
p01620
u633068244
1396608190
Python
Python
py
Accepted
20
4208
257
ref="ZYXWVUTSRQPONMLKJIHGFEDCBAzyxwvutsrqponmlkjihgfedcba" while 1: n=input() if n==0:break key=map(int,raw_input().split()) code=list(raw_input()) for i in range(len(code)): code[i]=ref[(ref.index(code[i])+key[i%n])%52] print "".join(map(str,code))
p01620
<script src="./IMAGE/varmath.js" charset="UTF-8"></script> <!-- begin en only --> <!--<h3><u>King's Inspection</u></h3>--> <!-- end en only --> <!-- begin ja only --> <h1><u>王様の視察</u></h1> <!-- end ja only --> <!-- begin en only --> <!-- <p> English text is not available in this practice contest. </p> --> <!-- end en...
2 1 2 bdd 3 3 2 1 DDDA 5 3 1 4 5 3 dcdkIlkP 0
abc ABCx abZfFijL
26,712
s500048323
p01620
u260980560
1403674452
Python
Python
py
Accepted
20
4216
263
station = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" while True: n = input() if n==0: break k = map(int, raw_input().split()) s = raw_input() print "".join(station[(station.find(s[i])-k[i%n]+52)%52] for i in xrange(len(s)))
p01620
<script src="./IMAGE/varmath.js" charset="UTF-8"></script> <!-- begin en only --> <!--<h3><u>King's Inspection</u></h3>--> <!-- end en only --> <!-- begin ja only --> <h1><u>王様の視察</u></h1> <!-- end ja only --> <!-- begin en only --> <!-- <p> English text is not available in this practice contest. </p> --> <!-- end en...
2 1 2 bdd 3 3 2 1 DDDA 5 3 1 4 5 3 dcdkIlkP 0
abc ABCx abZfFijL
26,713
s227081973
p01620
u240091169
1593955806
Python
Python3
py
Accepted
40
5624
741
while True : n = int(input()) if n == 0 : break key = list(map(int, input().split())) station = list(input()) i = 0 j = 0 while True : if i == len(station) : break if j == len(key) : j = 0 if 97 <= ord(station[i]) <= 122 : ...
p01620
<script src="./IMAGE/varmath.js" charset="UTF-8"></script> <!-- begin en only --> <!--<h3><u>King's Inspection</u></h3>--> <!-- end en only --> <!-- begin ja only --> <h1><u>王様の視察</u></h1> <!-- end ja only --> <!-- begin en only --> <!-- <p> English text is not available in this practice contest. </p> --> <!-- end en...
2 1 2 bdd 3 3 2 1 DDDA 5 3 1 4 5 3 dcdkIlkP 0
abc ABCx abZfFijL
26,714
s458713848
p01620
u829695570
1578810475
Python
Python3
py
Accepted
40
5628
298
a = [] for i in range(26): a.append(chr(97+i)) for i in range(26): a.append(chr(65+i)) while 1: n = int(input()) if n == 0: break k = list(map(int, input().split())) s = input() for i in range(len(s)): print(a[(a.index(s[i]) - k[i%n])%52], end='') print()
p01620
<script src="./IMAGE/varmath.js" charset="UTF-8"></script> <!-- begin en only --> <!--<h3><u>King's Inspection</u></h3>--> <!-- end en only --> <!-- begin ja only --> <h1><u>王様の視察</u></h1> <!-- end ja only --> <!-- begin en only --> <!-- <p> English text is not available in this practice contest. </p> --> <!-- end en...
2 1 2 bdd 3 3 2 1 DDDA 5 3 1 4 5 3 dcdkIlkP 0
abc ABCx abZfFijL
26,715
s832110127
p01620
u931913851
1562314239
Python
Python3
py
Accepted
30
5616
828
"王様の視察" while True: N = int(input()) if N == 0: break K = list(map(int, input().split())) S = str(input()) ans = "" station = list("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ") station_position = {} search_station = {} # 双方向の辞書を作成する for i, s in enumerate(statio...
p01620
<script src="./IMAGE/varmath.js" charset="UTF-8"></script> <!-- begin en only --> <!--<h3><u>King's Inspection</u></h3>--> <!-- end en only --> <!-- begin ja only --> <h1><u>王様の視察</u></h1> <!-- end ja only --> <!-- begin en only --> <!-- <p> English text is not available in this practice contest. </p> --> <!-- end en...
2 1 2 bdd 3 3 2 1 DDDA 5 3 1 4 5 3 dcdkIlkP 0
abc ABCx abZfFijL
26,716
s289899924
p01620
u761825084
1561798069
Python
Python3
py
Accepted
30
5624
623
alphabet = ["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"] while True: n = int(input()) if n == 0: break else: k = [int(k) for k i...
p01620
<script src="./IMAGE/varmath.js" charset="UTF-8"></script> <!-- begin en only --> <!--<h3><u>King's Inspection</u></h3>--> <!-- end en only --> <!-- begin ja only --> <h1><u>王様の視察</u></h1> <!-- end ja only --> <!-- begin en only --> <!-- <p> English text is not available in this practice contest. </p> --> <!-- end en...
2 1 2 bdd 3 3 2 1 DDDA 5 3 1 4 5 3 dcdkIlkP 0
abc ABCx abZfFijL
26,717
s766362694
p01620
u489876484
1561261848
Python
Python3
py
Accepted
30
5616
849
def main(): while True: n = int(input()) if n == 0: return kk = list(map(int,input().split())) S = input() ans = "" for i,s in enumerate(S): if s.islower(): k = (ord(s)-ord('a')-kk[i%len(kk)]) if k < -26: ...
p01620
<script src="./IMAGE/varmath.js" charset="UTF-8"></script> <!-- begin en only --> <!--<h3><u>King's Inspection</u></h3>--> <!-- end en only --> <!-- begin ja only --> <h1><u>王様の視察</u></h1> <!-- end ja only --> <!-- begin en only --> <!-- <p> English text is not available in this practice contest. </p> --> <!-- end en...
2 1 2 bdd 3 3 2 1 DDDA 5 3 1 4 5 3 dcdkIlkP 0
abc ABCx abZfFijL
26,718
s304529999
p01620
u099826363
1558003355
Python
Python3
py
Accepted
40
5632
600
# from sys import exit alp = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z'] alp += [a.upper() for a in alp] id = [i for i in range(0, 52)] alp2num = dict(zip(alp, id)) num2alp = dict(enumerate(alp)) while(Tru...
p01620
<script src="./IMAGE/varmath.js" charset="UTF-8"></script> <!-- begin en only --> <!--<h3><u>King's Inspection</u></h3>--> <!-- end en only --> <!-- begin ja only --> <h1><u>王様の視察</u></h1> <!-- end ja only --> <!-- begin en only --> <!-- <p> English text is not available in this practice contest. </p> --> <!-- end en...
2 1 2 bdd 3 3 2 1 DDDA 5 3 1 4 5 3 dcdkIlkP 0
abc ABCx abZfFijL
26,719
s917856487
p01620
u990228206
1553085781
Python
Python3
py
Accepted
30
5612
392
word_list=[] for i in range(97,123): word_list.append(chr(i)) for i in range(65,91): word_list.append(chr(i)) l_w_l=len(word_list) while 1: n=int(input()) if n==0:break li=list(map(int,input().split())) s=input() ans="" for i in range(len(s)): w_k=word_list.index(s[i])-li[i%n] ...
p01620
<script src="./IMAGE/varmath.js" charset="UTF-8"></script> <!-- begin en only --> <!--<h3><u>King's Inspection</u></h3>--> <!-- end en only --> <!-- begin ja only --> <h1><u>王様の視察</u></h1> <!-- end ja only --> <!-- begin en only --> <!-- <p> English text is not available in this practice contest. </p> --> <!-- end en...
2 1 2 bdd 3 3 2 1 DDDA 5 3 1 4 5 3 dcdkIlkP 0
abc ABCx abZfFijL
26,720
s116617174
p01620
u717526540
1545108346
Python
Python3
py
Accepted
30
5604
409
alpha = list("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ") while 1: n = int(input()) if n == 0: break K = list(map(int, input().split())) S = list(input()) ans = "" for i, s in enumerate(S): diff = K[i % len(K)] if diff <= 0: num = 52 + diff ...
p01620
<script src="./IMAGE/varmath.js" charset="UTF-8"></script> <!-- begin en only --> <!--<h3><u>King's Inspection</u></h3>--> <!-- end en only --> <!-- begin ja only --> <h1><u>王様の視察</u></h1> <!-- end ja only --> <!-- begin en only --> <!-- <p> English text is not available in this practice contest. </p> --> <!-- end en...
2 1 2 bdd 3 3 2 1 DDDA 5 3 1 4 5 3 dcdkIlkP 0
abc ABCx abZfFijL
26,721
s262705047
p01620
u281836941
1513350973
Python
Python3
py
Accepted
30
5612
604
def horizontal_input(T=str): return list(map(T,input().split())) def vertical_input(n,T=str,sep=False,septype=tuple): data=[] if sep: for i in range(n): data.append(septype(map(T,input().split()))) else: for i in range(n): data.append(T(input())) return data ...
p01620
<script src="./IMAGE/varmath.js" charset="UTF-8"></script> <!-- begin en only --> <!--<h3><u>King's Inspection</u></h3>--> <!-- end en only --> <!-- begin ja only --> <h1><u>王様の視察</u></h1> <!-- end ja only --> <!-- begin en only --> <!-- <p> English text is not available in this practice contest. </p> --> <!-- end en...
2 1 2 bdd 3 3 2 1 DDDA 5 3 1 4 5 3 dcdkIlkP 0
abc ABCx abZfFijL
26,722
s874802195
p01634
u717526540
1545897104
Python
Python3
py
Accepted
20
5564
434
num = list("0123456789") large = list("ABCDEFGHIJKLMNOPQRSTUVWXYZ") small = list("abcdefghijklmnopqrstuvwxyz") S = input() if len(S) < 6: print("INVALID") exit() flag_n, flag_l, flag_s = False, False, False for s in S: if s in num: flag_n = True elif s in large: flag_l = True elif ...
p01634
<h1 class="ndoc-heading1">Problem A: Register Phase</h1> <p class="ndoc-top"> インターネットをより安全に活用するために、堅牢なパスワードを使うことは重要である。それと同時に、同じパスワードを使い回さないことも非常に重要である。どんなに強いパスワードを使っていても、一箇所で平文が流出してしまえば、破るのは非常に容易になってしまう。もちろん、全てのアプリケーションがパスワードをハッシュ化し、SALTを適切に使用していれば流出してもそのような被害は発生しないが、いまだにパスワードを平文で保存しているアプリケーションはあるのである。</p> <p class...
password
INVALID
26,736
s495436766
p01634
u352394527
1546394338
Python
Python3
py
Accepted
20
5568
241
s = input() if len(s) >= 6 and\ any([(c in s) for c in "1234567890"]) and\ any([(c in s) for c in "ABCDEFGHIJKLMNOPQRSTUVWXYZ"]) and\ any([(c in s) for c in "abcdefghijklmnopqrstuvwxyz"]): print("VALID") else: print("INVALID")
p01634
<h1 class="ndoc-heading1">Problem A: Register Phase</h1> <p class="ndoc-top"> インターネットをより安全に活用するために、堅牢なパスワードを使うことは重要である。それと同時に、同じパスワードを使い回さないことも非常に重要である。どんなに強いパスワードを使っていても、一箇所で平文が流出してしまえば、破るのは非常に容易になってしまう。もちろん、全てのアプリケーションがパスワードをハッシュ化し、SALTを適切に使用していれば流出してもそのような被害は発生しないが、いまだにパスワードを平文で保存しているアプリケーションはあるのである。</p> <p class...
password
INVALID
26,737
s775472962
p01634
u633068244
1446753437
Python
Python
py
Accepted
30
6436
203
S = raw_input() f1 = f2 = f3 = False for s in S: if s.isdigit(): f1 = True if s.isupper(): f2 = True if s.islower(): f3 = True print "VALID" if len(S) >= 6 and f1 and f2 and f3 else "INVALID"
p01634
<h1 class="ndoc-heading1">Problem A: Register Phase</h1> <p class="ndoc-top"> インターネットをより安全に活用するために、堅牢なパスワードを使うことは重要である。それと同時に、同じパスワードを使い回さないことも非常に重要である。どんなに強いパスワードを使っていても、一箇所で平文が流出してしまえば、破るのは非常に容易になってしまう。もちろん、全てのアプリケーションがパスワードをハッシュ化し、SALTを適切に使用していれば流出してもそのような被害は発生しないが、いまだにパスワードを平文で保存しているアプリケーションはあるのである。</p> <p class...
password
INVALID
26,738
s838622292
p01634
u078042885
1484233863
Python
Python3
py
Accepted
20
7480
111
s=input() print('INVALID' if s.isalpha() or s.isdigit() or s.islower() or s.isupper() or len(s)<6 else 'VALID')
p01634
<h1 class="ndoc-heading1">Problem A: Register Phase</h1> <p class="ndoc-top"> インターネットをより安全に活用するために、堅牢なパスワードを使うことは重要である。それと同時に、同じパスワードを使い回さないことも非常に重要である。どんなに強いパスワードを使っていても、一箇所で平文が流出してしまえば、破るのは非常に容易になってしまう。もちろん、全てのアプリケーションがパスワードをハッシュ化し、SALTを適切に使用していれば流出してもそのような被害は発生しないが、いまだにパスワードを平文で保存しているアプリケーションはあるのである。</p> <p class...
password
INVALID
26,739
s915112691
p01634
u104911888
1380848260
Python
Python
py
Accepted
20
4228
445
def length(s): return False if len(s)<6 else True def inNum(s): for c in s: if c.isdigit(): return True return False def inUpper(s): for c in s: if c.isupper(): return True return False def inLower(s): for c in s: if c.islower(): ret...
p01634
<h1 class="ndoc-heading1">Problem A: Register Phase</h1> <p class="ndoc-top"> インターネットをより安全に活用するために、堅牢なパスワードを使うことは重要である。それと同時に、同じパスワードを使い回さないことも非常に重要である。どんなに強いパスワードを使っていても、一箇所で平文が流出してしまえば、破るのは非常に容易になってしまう。もちろん、全てのアプリケーションがパスワードをハッシュ化し、SALTを適切に使用していれば流出してもそのような被害は発生しないが、いまだにパスワードを平文で保存しているアプリケーションはあるのである。</p> <p class...
password
INVALID
26,740
s763927602
p01634
u104911888
1380849078
Python
Python
py
Accepted
20
4212
178
s=raw_input() d=l=u=False for c in s: if c.isdigit(): d=True if c.islower(): l=True if c.isupper(): u=True print 'VALID' if len(s)>=6 and d and l and u else 'INVALID'
p01634
<h1 class="ndoc-heading1">Problem A: Register Phase</h1> <p class="ndoc-top"> インターネットをより安全に活用するために、堅牢なパスワードを使うことは重要である。それと同時に、同じパスワードを使い回さないことも非常に重要である。どんなに強いパスワードを使っていても、一箇所で平文が流出してしまえば、破るのは非常に容易になってしまう。もちろん、全てのアプリケーションがパスワードをハッシュ化し、SALTを適切に使用していれば流出してもそのような被害は発生しないが、いまだにパスワードを平文で保存しているアプリケーションはあるのである。</p> <p class...
password
INVALID
26,741
s088106834
p01634
u633068244
1396608829
Python
Python
py
Accepted
20
4184
114
p=raw_input() print "INVALID" if len(p)<6 or p.islower() or p.isupper() or p.isalpha() or p.isdigit() else "VALID"
p01634
<h1 class="ndoc-heading1">Problem A: Register Phase</h1> <p class="ndoc-top"> インターネットをより安全に活用するために、堅牢なパスワードを使うことは重要である。それと同時に、同じパスワードを使い回さないことも非常に重要である。どんなに強いパスワードを使っていても、一箇所で平文が流出してしまえば、破るのは非常に容易になってしまう。もちろん、全てのアプリケーションがパスワードをハッシュ化し、SALTを適切に使用していれば流出してもそのような被害は発生しないが、いまだにパスワードを平文で保存しているアプリケーションはあるのである。</p> <p class...
password
INVALID
26,742
s791714139
p01634
u633068244
1396608906
Python
Python
py
Accepted
20
4184
114
p=raw_input() print "INVALID" if len(p)<6 or p.isalpha() or p.isdigit() or p.islower() or p.isupper() else "VALID"
p01634
<h1 class="ndoc-heading1">Problem A: Register Phase</h1> <p class="ndoc-top"> インターネットをより安全に活用するために、堅牢なパスワードを使うことは重要である。それと同時に、同じパスワードを使い回さないことも非常に重要である。どんなに強いパスワードを使っていても、一箇所で平文が流出してしまえば、破るのは非常に容易になってしまう。もちろん、全てのアプリケーションがパスワードをハッシュ化し、SALTを適切に使用していれば流出してもそのような被害は発生しないが、いまだにパスワードを平文で保存しているアプリケーションはあるのである。</p> <p class...
password
INVALID
26,743
s400993852
p01634
u371026526
1597742258
Python
Python3
py
Accepted
30
6508
297
import re lst = input() if len(lst) >= 6: if re.findall("[0-9]",lst): if re.findall("[A-Z]",lst): if re.findall("[a-z]",lst): print("VALID") else: print("INVALID") else: print("INVALID") else: print("INVALID") else: print("INVALID")
p01634
<h1 class="ndoc-heading1">Problem A: Register Phase</h1> <p class="ndoc-top"> インターネットをより安全に活用するために、堅牢なパスワードを使うことは重要である。それと同時に、同じパスワードを使い回さないことも非常に重要である。どんなに強いパスワードを使っていても、一箇所で平文が流出してしまえば、破るのは非常に容易になってしまう。もちろん、全てのアプリケーションがパスワードをハッシュ化し、SALTを適切に使用していれば流出してもそのような被害は発生しないが、いまだにパスワードを平文で保存しているアプリケーションはあるのである。</p> <p class...
password
INVALID
26,744
s523672771
p01634
u128671689
1597721989
Python
Python3
py
Accepted
20
5560
333
x=input() a=0 b=0 c=0 if len(x)<6: print("INVALID") else: for i in range(len(x)): X=ord(x[i]) if 48<=X and X<=57: a+=1 if 97<=X and X<=122: b+=1 if 65<=X and X<=90: c+=1 if a==0 or b==0 or c==0: print("INVALID") else: pr...
p01634
<h1 class="ndoc-heading1">Problem A: Register Phase</h1> <p class="ndoc-top"> インターネットをより安全に活用するために、堅牢なパスワードを使うことは重要である。それと同時に、同じパスワードを使い回さないことも非常に重要である。どんなに強いパスワードを使っていても、一箇所で平文が流出してしまえば、破るのは非常に容易になってしまう。もちろん、全てのアプリケーションがパスワードをハッシュ化し、SALTを適切に使用していれば流出してもそのような被害は発生しないが、いまだにパスワードを平文で保存しているアプリケーションはあるのである。</p> <p class...
password
INVALID
26,745
s372931068
p01634
u593595530
1597667695
Python
Python3
py
Accepted
20
5588
966
A=0 n=str(input()) if len(n)>=6: A=A+1 B=n.count('0')+n.count('1')+n.count('2')+n.count('3')+n.count('4')+n.count('5')+n.count('6')+n.count('7')+n.count('8')+n.count('9') if B>0: A=A+1 C=n.count('a')+n.count('b')+n.count('c')+n.count('d')+n.count('e')+n.count('f')+n.count('g')+n.count('h')+n.count('i')+n.count(...
p01634
<h1 class="ndoc-heading1">Problem A: Register Phase</h1> <p class="ndoc-top"> インターネットをより安全に活用するために、堅牢なパスワードを使うことは重要である。それと同時に、同じパスワードを使い回さないことも非常に重要である。どんなに強いパスワードを使っていても、一箇所で平文が流出してしまえば、破るのは非常に容易になってしまう。もちろん、全てのアプリケーションがパスワードをハッシュ化し、SALTを適切に使用していれば流出してもそのような被害は発生しないが、いまだにパスワードを平文で保存しているアプリケーションはあるのである。</p> <p class...
password
INVALID
26,746
s253830947
p01634
u583329397
1597654133
Python
Python3
py
Accepted
20
5560
399
s=str(input()) if len(s)<6 : print("INVALID") else: num=0 ABC=0 abc=0 for i in range(len(s)) : if ord(s[i])>=48 and ord(s[i])<=57: num+=1 if ord(s[i])>=97 and ord(s[i])<=122: ABC+=1 if ord(s[i])>=65 and ord(s[i])<=90: abc+=1 if num==0 o...
p01634
<h1 class="ndoc-heading1">Problem A: Register Phase</h1> <p class="ndoc-top"> インターネットをより安全に活用するために、堅牢なパスワードを使うことは重要である。それと同時に、同じパスワードを使い回さないことも非常に重要である。どんなに強いパスワードを使っていても、一箇所で平文が流出してしまえば、破るのは非常に容易になってしまう。もちろん、全てのアプリケーションがパスワードをハッシュ化し、SALTを適切に使用していれば流出してもそのような被害は発生しないが、いまだにパスワードを平文で保存しているアプリケーションはあるのである。</p> <p class...
password
INVALID
26,747
s570039736
p01634
u695568874
1596503120
Python
Python3
py
Accepted
20
5588
966
A=0 n=str(input()) if len(n)>=6: A=A+1 B=n.count('0')+n.count('1')+n.count('2')+n.count('3')+n.count('4')+n.count('5')+n.count('6')+n.count('7')+n.count('8')+n.count('9') if B>0: A=A+1 C=n.count('a')+n.count('b')+n.count('c')+n.count('d')+n.count('e')+n.count('f')+n.count('g')+n.count('h')+n.count('i')+n.count(...
p01634
<h1 class="ndoc-heading1">Problem A: Register Phase</h1> <p class="ndoc-top"> インターネットをより安全に活用するために、堅牢なパスワードを使うことは重要である。それと同時に、同じパスワードを使い回さないことも非常に重要である。どんなに強いパスワードを使っていても、一箇所で平文が流出してしまえば、破るのは非常に容易になってしまう。もちろん、全てのアプリケーションがパスワードをハッシュ化し、SALTを適切に使用していれば流出してもそのような被害は発生しないが、いまだにパスワードを平文で保存しているアプリケーションはあるのである。</p> <p class...
password
INVALID
26,748
s856594624
p01634
u586171604
1596431055
Python
Python3
py
Accepted
20
5552
133
p = input() if len(p) < 6 or p.isalpha() or p.isdigit() or p.islower() or p.isupper(): print("INVALID") else: print("VALID")
p01634
<h1 class="ndoc-heading1">Problem A: Register Phase</h1> <p class="ndoc-top"> インターネットをより安全に活用するために、堅牢なパスワードを使うことは重要である。それと同時に、同じパスワードを使い回さないことも非常に重要である。どんなに強いパスワードを使っていても、一箇所で平文が流出してしまえば、破るのは非常に容易になってしまう。もちろん、全てのアプリケーションがパスワードをハッシュ化し、SALTを適切に使用していれば流出してもそのような被害は発生しないが、いまだにパスワードを平文で保存しているアプリケーションはあるのである。</p> <p class...
password
INVALID
26,749
s207433218
p01634
u290304811
1596036806
Python
Python3
py
Accepted
20
5564
312
pas = input() ans1,ans2,ans3 = 0,0,0 if len(pas)<6: print("INVALID") else: for i in range(len(pas)): if pas[i].isupper(): ans1 += 1 if pas[i].islower(): ans2 += 1 if pas[i].isdecimal(): ans3 += 1 if ans1>0 and ans2>0 and ans3>0: print("VALID") else: print("INVALID")
p01634
<h1 class="ndoc-heading1">Problem A: Register Phase</h1> <p class="ndoc-top"> インターネットをより安全に活用するために、堅牢なパスワードを使うことは重要である。それと同時に、同じパスワードを使い回さないことも非常に重要である。どんなに強いパスワードを使っていても、一箇所で平文が流出してしまえば、破るのは非常に容易になってしまう。もちろん、全てのアプリケーションがパスワードをハッシュ化し、SALTを適切に使用していれば流出してもそのような被害は発生しないが、いまだにパスワードを平文で保存しているアプリケーションはあるのである。</p> <p class...
password
INVALID
26,750
s120334975
p01634
u838993229
1595838746
Python
Python3
py
Accepted
20
5568
255
a = str(input()) if len(a) >= 6 and any(chr.isdigit() for chr in a) == True: if any(chr.islower() for chr in a) == True and any(str.isupper() for str in a) == True: print("VALID") else: print("INVALID") else: print("INVALID")
p01634
<h1 class="ndoc-heading1">Problem A: Register Phase</h1> <p class="ndoc-top"> インターネットをより安全に活用するために、堅牢なパスワードを使うことは重要である。それと同時に、同じパスワードを使い回さないことも非常に重要である。どんなに強いパスワードを使っていても、一箇所で平文が流出してしまえば、破るのは非常に容易になってしまう。もちろん、全てのアプリケーションがパスワードをハッシュ化し、SALTを適切に使用していれば流出してもそのような被害は発生しないが、いまだにパスワードを平文で保存しているアプリケーションはあるのである。</p> <p class...
password
INVALID
26,751
s668686759
p01634
u275486335
1595838360
Python
Python3
py
Accepted
30
5552
130
x=input() if len(x)<6 or x.isalpha() or x.islower() or x.isupper() or x.isdigit(): print("INVALID") else: print("VALID")
p01634
<h1 class="ndoc-heading1">Problem A: Register Phase</h1> <p class="ndoc-top"> インターネットをより安全に活用するために、堅牢なパスワードを使うことは重要である。それと同時に、同じパスワードを使い回さないことも非常に重要である。どんなに強いパスワードを使っていても、一箇所で平文が流出してしまえば、破るのは非常に容易になってしまう。もちろん、全てのアプリケーションがパスワードをハッシュ化し、SALTを適切に使用していれば流出してもそのような被害は発生しないが、いまだにパスワードを平文で保存しているアプリケーションはあるのである。</p> <p class...
password
INVALID
26,752
s930713256
p01634
u320921262
1595832455
Python
Python3
py
Accepted
20
5560
366
a = input() if len(a) < 6: print("INVALID") else: m = 0 n = 0 l = 0 for i in range(len(a)): if 48 <= ord(a[i]) <= 57: m += 1 if 97 <= ord(a[i]) <= 122: n += 1 if 65 <= ord(a[i]) <= 90: l += 1 if m == 0 or n == 0 or l == 0: prin...
p01634
<h1 class="ndoc-heading1">Problem A: Register Phase</h1> <p class="ndoc-top"> インターネットをより安全に活用するために、堅牢なパスワードを使うことは重要である。それと同時に、同じパスワードを使い回さないことも非常に重要である。どんなに強いパスワードを使っていても、一箇所で平文が流出してしまえば、破るのは非常に容易になってしまう。もちろん、全てのアプリケーションがパスワードをハッシュ化し、SALTを適切に使用していれば流出してもそのような被害は発生しないが、いまだにパスワードを平文で保存しているアプリケーションはあるのである。</p> <p class...
password
INVALID
26,753
s912535369
p01634
u511292942
1595570459
Python
Python3
py
Accepted
20
5552
133
p = input() if len(p) < 6 or p.isalpha() or p.isdigit() or p.islower() or p.isupper(): print("INVALID") else: print("VALID")
p01634
<h1 class="ndoc-heading1">Problem A: Register Phase</h1> <p class="ndoc-top"> インターネットをより安全に活用するために、堅牢なパスワードを使うことは重要である。それと同時に、同じパスワードを使い回さないことも非常に重要である。どんなに強いパスワードを使っていても、一箇所で平文が流出してしまえば、破るのは非常に容易になってしまう。もちろん、全てのアプリケーションがパスワードをハッシュ化し、SALTを適切に使用していれば流出してもそのような被害は発生しないが、いまだにパスワードを平文で保存しているアプリケーションはあるのである。</p> <p class...
password
INVALID
26,754
s620221523
p01634
u192469946
1595422676
Python
Python3
py
Accepted
20
5560
379
#2522 l = [] word = input() for i in word: l.append(i) a = 0 b = 0 c = 0 d = 0 if len(l) >= 6: a += 1 for i in l: if 48 <= ord(i) <= 57: b += 1 elif 97 <= ord(i) <= 122: c += 1 elif 65 <= ord(i) <= 90: d += 1 else: c += 0 if a >= 1 and b >= 1 and c >= 1...
p01634
<h1 class="ndoc-heading1">Problem A: Register Phase</h1> <p class="ndoc-top"> インターネットをより安全に活用するために、堅牢なパスワードを使うことは重要である。それと同時に、同じパスワードを使い回さないことも非常に重要である。どんなに強いパスワードを使っていても、一箇所で平文が流出してしまえば、破るのは非常に容易になってしまう。もちろん、全てのアプリケーションがパスワードをハッシュ化し、SALTを適切に使用していれば流出してもそのような被害は発生しないが、いまだにパスワードを平文で保存しているアプリケーションはあるのである。</p> <p class...
password
INVALID
26,755
s598159367
p01634
u747915832
1594042538
Python
Python3
py
Accepted
20
5588
2,166
word = input() while True: if len(word)<6: print('INVALID') break if word.find('0')==-1 and\ word.find('1')==-1 and\ word.find('2')==-1 and\ word.find('3')==-1 and\ word.find('4')==-1 and\ word.find('5')==-1 and\ word.find('6')==-1 and\ word...
p01634
<h1 class="ndoc-heading1">Problem A: Register Phase</h1> <p class="ndoc-top"> インターネットをより安全に活用するために、堅牢なパスワードを使うことは重要である。それと同時に、同じパスワードを使い回さないことも非常に重要である。どんなに強いパスワードを使っていても、一箇所で平文が流出してしまえば、破るのは非常に容易になってしまう。もちろん、全てのアプリケーションがパスワードをハッシュ化し、SALTを適切に使用していれば流出してもそのような被害は発生しないが、いまだにパスワードを平文で保存しているアプリケーションはあるのである。</p> <p class...
password
INVALID
26,756
s592707886
p01634
u814278309
1592231817
Python
Python3
py
Accepted
20
5552
133
s = input() if len(s) < 6 or s.isalpha() or s.isdigit() or s.islower() or s.isupper(): print("INVALID") else: print("VALID")
p01634
<h1 class="ndoc-heading1">Problem A: Register Phase</h1> <p class="ndoc-top"> インターネットをより安全に活用するために、堅牢なパスワードを使うことは重要である。それと同時に、同じパスワードを使い回さないことも非常に重要である。どんなに強いパスワードを使っていても、一箇所で平文が流出してしまえば、破るのは非常に容易になってしまう。もちろん、全てのアプリケーションがパスワードをハッシュ化し、SALTを適切に使用していれば流出してもそのような被害は発生しないが、いまだにパスワードを平文で保存しているアプリケーションはあるのである。</p> <p class...
password
INVALID
26,757
s070283538
p01634
u240091169
1590309340
Python
Python3
py
Accepted
20
5560
458
pas = input() if len(pas) < 6 : print("INVALID") else : num = 0 Lstr = 0 Sstr = 0 for i in range(len(pas)) : if ord(pas[i]) >= 48 and ord(pas[i]) <= 57 : num += 1 if ord(pas[i]) >= 97 and ord(pas[i]) <= 122 : Lstr += 1 if ord(pas[i]) >= 65 and ord(pas...
p01634
<h1 class="ndoc-heading1">Problem A: Register Phase</h1> <p class="ndoc-top"> インターネットをより安全に活用するために、堅牢なパスワードを使うことは重要である。それと同時に、同じパスワードを使い回さないことも非常に重要である。どんなに強いパスワードを使っていても、一箇所で平文が流出してしまえば、破るのは非常に容易になってしまう。もちろん、全てのアプリケーションがパスワードをハッシュ化し、SALTを適切に使用していれば流出してもそのような被害は発生しないが、いまだにパスワードを平文で保存しているアプリケーションはあるのである。</p> <p class...
password
INVALID
26,758
s692285416
p01634
u855694108
1588142602
Python
Python3
py
Accepted
20
5568
430
s = input() A = [str(i) for i in range(10)] B = [chr(i) for i in range(97, 97+26)] C = [chr(i) for i in range(65, 65+26)] ng = "INVALID" ok = "VALID" if len(s) < 6: print(ng) exit() x = 0 y = 0 z = 0 for i in s: a = i in A b = i in B c = i in C x += a y += b z += c if a or b or c...
p01634
<h1 class="ndoc-heading1">Problem A: Register Phase</h1> <p class="ndoc-top"> インターネットをより安全に活用するために、堅牢なパスワードを使うことは重要である。それと同時に、同じパスワードを使い回さないことも非常に重要である。どんなに強いパスワードを使っていても、一箇所で平文が流出してしまえば、破るのは非常に容易になってしまう。もちろん、全てのアプリケーションがパスワードをハッシュ化し、SALTを適切に使用していれば流出してもそのような被害は発生しないが、いまだにパスワードを平文で保存しているアプリケーションはあるのである。</p> <p class...
password
INVALID
26,759
s621648868
p01634
u990228206
1553087244
Python
Python3
py
Accepted
40
6504
161
import re s=input() if len(s)>=6 and re.findall("[0-9]", s) and re.findall("[A-Z]", s) and re.findall("[a-z]", s): print("VALID") else: print("INVALID")
p01634
<h1 class="ndoc-heading1">Problem A: Register Phase</h1> <p class="ndoc-top"> インターネットをより安全に活用するために、堅牢なパスワードを使うことは重要である。それと同時に、同じパスワードを使い回さないことも非常に重要である。どんなに強いパスワードを使っていても、一箇所で平文が流出してしまえば、破るのは非常に容易になってしまう。もちろん、全てのアプリケーションがパスワードをハッシュ化し、SALTを適切に使用していれば流出してもそのような被害は発生しないが、いまだにパスワードを平文で保存しているアプリケーションはあるのである。</p> <p class...
password
INVALID
26,760
s694313361
p01636
u352394527
1546395398
Python
Python3
py
Accepted
30
5596
243
a = input() ans = 0 for i in range(1, len(a)): df = a[:i] sm = a[i:] if sm[0] == "0":continue df = int(df) sm = int(sm) if (df + sm) % 2 == 0 and sm >= df and (sm - df) % 2 == 0: ans += 1 if int(a) % 2 == 0:ans += 1 print(ans)
p01636
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [['\\(','\\)']] } }); </script> <script type='text/javascript' src='http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML'></script> <h1 class="ndoc-heading1">Problem C: Mysterious Operator</h1> <p clas...
19
1
26,772
s680377255
p01636
u609255173
1379142303
Python
Python
py
Accepted
20
4224
223
s = raw_input() ans = 0 for i in range(len(s)): if s[i] == "0" and i != len(s) - 1: continue left = int(s[:i]) if i else 0 right = int(s[i:]) if left <= right and left % 2 == right % 2: ans += 1 print ans
p01636
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [['\\(','\\)']] } }); </script> <script type='text/javascript' src='http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML'></script> <h1 class="ndoc-heading1">Problem C: Mysterious Operator</h1> <p clas...
19
1
26,773
s384814374
p01636
u609255173
1379142303
Python
Python
py
Accepted
20
4224
223
s = raw_input() ans = 0 for i in range(len(s)): if s[i] == "0" and i != len(s) - 1: continue left = int(s[:i]) if i else 0 right = int(s[i:]) if left <= right and left % 2 == right % 2: ans += 1 print ans
p01636
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [['\\(','\\)']] } }); </script> <script type='text/javascript' src='http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML'></script> <h1 class="ndoc-heading1">Problem C: Mysterious Operator</h1> <p clas...
19
1
26,774
s132713135
p01636
u633068244
1398163385
Python
Python
py
Accepted
20
4212
205
a = raw_input() ans = 0 for i in range(len(a)): if a[i] == "0" and i != len(a) - 1: continue a1 = int(a[:i]) if i else 0 a2 = int(a[i:]) if a1 <= a2 and a1 % 2 == a2 % 2: ans += 1 print ans
p01636
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [['\\(','\\)']] } }); </script> <script type='text/javascript' src='http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML'></script> <h1 class="ndoc-heading1">Problem C: Mysterious Operator</h1> <p clas...
19
1
26,775
s682033485
p01636
u511231264
1583644958
Python
Python3
py
Accepted
30
5596
423
a = list(input()) for i in range(len(a)): a[i] = int(a[i]) ans = 0 for i in range(len(a)): if a[i] == 0: continue c = 0 for j in range(i): c *= 10 c += a[j] d = 0 for j in range(i, len(a)): d *= 10 d += a[j] if (c + d) % 2 != 0: ...
p01636
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [['\\(','\\)']] } }); </script> <script type='text/javascript' src='http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML'></script> <h1 class="ndoc-heading1">Problem C: Mysterious Operator</h1> <p clas...
19
1
26,776
s798047124
p01646
u647766105
1392010362
Python
Python
py
Accepted
80
4344
1,219
graph = [] def init(): global graph graph = [[False] * 26 + [True] for _ in xrange(27)] graph[26][26] = False def atoi(c):#index if c == "#": return 26 return ord(c) - ord("a") def make_graph(L): global graph, count cur = 0 L = [L[0]] + [L[i] for i in xrange(1, len(L)) if L[i]...
p01646
<h2>Problem Statement</h2> <p> We found a dictionary of the Ancient Civilization Mayo (ACM) during excavation of the ruins. After analysis of the dictionary, we revealed they used a language that had not more than 26 letters. So one of us mapped each letter to a different English alphabet and typed all the words in t...
4 cba cab b a 3 bca ab a 5 abc acb b c c 5 abc acb c b b 0
yes no yes no
26,780
s214339927
p01646
u647766105
1392011110
Python
Python
py
Accepted
70
4340
1,212
graph = [] def init(): global graph graph = [[False] * 26 + [True] for _ in xrange(27)] graph[26][26] = False def atoi(c):#index if c == "#": return 26 return ord(c) - ord("a") def make_graph(L): global graph cur = 0 L = [L[0]] + [L[i] for i in xrange(1, len(L)) if L[i] != L[i...
p01646
<h2>Problem Statement</h2> <p> We found a dictionary of the Ancient Civilization Mayo (ACM) during excavation of the ruins. After analysis of the dictionary, we revealed they used a language that had not more than 26 letters. So one of us mapped each letter to a different English alphabet and typed all the words in t...
4 cba cab b a 3 bca ab a 5 abc acb b c c 5 abc acb c b b 0
yes no yes no
26,781
s857128168
p01646
u647766105
1392011671
Python
Python
py
Accepted
80
4340
1,256
graph = [] def init(): global graph graph = [[False] * 26 + [True] for _ in xrange(27)] graph[26][26] = False def atoi(c):#index if c == "#": return 26 return ord(c) - ord("a") def make_graph(L): global graph cur = 0 L = [L[0]] + [L[i] for i in xrange(1, len(L)) if L[i] != L[i...
p01646
<h2>Problem Statement</h2> <p> We found a dictionary of the Ancient Civilization Mayo (ACM) during excavation of the ruins. After analysis of the dictionary, we revealed they used a language that had not more than 26 letters. So one of us mapped each letter to a different English alphabet and typed all the words in t...
4 cba cab b a 3 bca ab a 5 abc acb b c c 5 abc acb c b b 0
yes no yes no
26,782
s771851089
p01656
u260980560
1419352304
Python
Python
py
Accepted
20
4204
206
n, q = map(int, raw_input().split()) name = "kogakubu10gokan" year = 0 for i in xrange(n): ye, na = raw_input().split() ye = int(ye) if q < ye: break name = na; year = ye; print name
p01656
<h2>A - 旧総合研究7号館</h2> <p> 時は平成50年春休み.情報学研究科に所属する京子さんは,京都にある某研究パークからの研究室の引越しがやっと終わり,ホッと一息ついていた. 今回の引越しは,古くなった校舎の改修工事によるもので,新年度から工事に伴い校舎の名前が変更されることになっている. </p> <p> ホッとしていたのもつかの間,京子さんは先生から大学の資料に載っている校舎名を新しい名前に変更するお仕事を頼まれてしまった. しかし編集しなければならない資料には,今までの担当者が仕事を怠っていたせいか,ひとつ古い名前よりもっと古い名前が使われているものもあった. </p> <p> なんとか京子さんは,平...
3 12 5 sogo5gokan 10 sogo10gokan 15 sogo15gokan
sogo10gokan
26,783
s872270528
p01656
u078042885
1484331520
Python
Python3
py
Accepted
20
7676
121
a='kogakubu10gokan' n,m=map(int,input().split()) for _ in range(n): c,b=input().split() if int(c)<=m:a=b print(a)
p01656
<h2>A - 旧総合研究7号館</h2> <p> 時は平成50年春休み.情報学研究科に所属する京子さんは,京都にある某研究パークからの研究室の引越しがやっと終わり,ホッと一息ついていた. 今回の引越しは,古くなった校舎の改修工事によるもので,新年度から工事に伴い校舎の名前が変更されることになっている. </p> <p> ホッとしていたのもつかの間,京子さんは先生から大学の資料に載っている校舎名を新しい名前に変更するお仕事を頼まれてしまった. しかし編集しなければならない資料には,今までの担当者が仕事を怠っていたせいか,ひとつ古い名前よりもっと古い名前が使われているものもあった. </p> <p> なんとか京子さんは,平...
3 12 5 sogo5gokan 10 sogo10gokan 15 sogo15gokan
sogo10gokan
26,784
s461786502
p01656
u633068244
1398164004
Python
Python
py
Accepted
20
4204
213
n,q = map(int,raw_input().split()) old = "kogakubu10gokan" for i in range(n): year,new = map(str,raw_input().split()) if int(year) >= q: print new if int(year) == q else old break old = new else: print old
p01656
<h2>A - 旧総合研究7号館</h2> <p> 時は平成50年春休み.情報学研究科に所属する京子さんは,京都にある某研究パークからの研究室の引越しがやっと終わり,ホッと一息ついていた. 今回の引越しは,古くなった校舎の改修工事によるもので,新年度から工事に伴い校舎の名前が変更されることになっている. </p> <p> ホッとしていたのもつかの間,京子さんは先生から大学の資料に載っている校舎名を新しい名前に変更するお仕事を頼まれてしまった. しかし編集しなければならない資料には,今までの担当者が仕事を怠っていたせいか,ひとつ古い名前よりもっと古い名前が使われているものもあった. </p> <p> なんとか京子さんは,平...
3 12 5 sogo5gokan 10 sogo10gokan 15 sogo15gokan
sogo10gokan
26,785
s949535012
p01656
u759949288
1398745440
Python
Python
py
Accepted
20
4208
208
import sys readline = sys.stdin.readline N, Q = (int(x) for x in readline().split()) name = "kogakubu10gokan" for i in xrange(N): y, n = readline().split() if int(y) <= Q: name = n print name
p01656
<h2>A - 旧総合研究7号館</h2> <p> 時は平成50年春休み.情報学研究科に所属する京子さんは,京都にある某研究パークからの研究室の引越しがやっと終わり,ホッと一息ついていた. 今回の引越しは,古くなった校舎の改修工事によるもので,新年度から工事に伴い校舎の名前が変更されることになっている. </p> <p> ホッとしていたのもつかの間,京子さんは先生から大学の資料に載っている校舎名を新しい名前に変更するお仕事を頼まれてしまった. しかし編集しなければならない資料には,今までの担当者が仕事を怠っていたせいか,ひとつ古い名前よりもっと古い名前が使われているものもあった. </p> <p> なんとか京子さんは,平...
3 12 5 sogo5gokan 10 sogo10gokan 15 sogo15gokan
sogo10gokan
26,786
s148915924
p01656
u772196646
1400303001
Python
Python
py
Accepted
20
4224
239
nq = map(int, raw_input().split()) n = nq[0] q = nq[1] yn = [[1, 'kogakubu10gokan']] for i in range(n): yn.append(raw_input().split()) yn.append([100,'']) y = 1 k = 0 while y <= q: k += 1 y = int(yn[k][0]) print yn[k-1][1]
p01656
<h2>A - 旧総合研究7号館</h2> <p> 時は平成50年春休み.情報学研究科に所属する京子さんは,京都にある某研究パークからの研究室の引越しがやっと終わり,ホッと一息ついていた. 今回の引越しは,古くなった校舎の改修工事によるもので,新年度から工事に伴い校舎の名前が変更されることになっている. </p> <p> ホッとしていたのもつかの間,京子さんは先生から大学の資料に載っている校舎名を新しい名前に変更するお仕事を頼まれてしまった. しかし編集しなければならない資料には,今までの担当者が仕事を怠っていたせいか,ひとつ古い名前よりもっと古い名前が使われているものもあった. </p> <p> なんとか京子さんは,平...
3 12 5 sogo5gokan 10 sogo10gokan 15 sogo15gokan
sogo10gokan
26,787
s123903796
p01656
u240091169
1593957219
Python
Python3
py
Accepted
20
5600
366
N, Q = map(int, input().split()) rename = [] for i in range(N) : year, name = input().split() year = int(year) rename.append([year, name]) if Q < rename[0][0] : print("kogakubu10gokan") elif Q >= rename[-1][0] : print(rename[-1][1]) else : for i in range(N-1) : if rename[i][0] <= Q < ren...
p01656
<h2>A - 旧総合研究7号館</h2> <p> 時は平成50年春休み.情報学研究科に所属する京子さんは,京都にある某研究パークからの研究室の引越しがやっと終わり,ホッと一息ついていた. 今回の引越しは,古くなった校舎の改修工事によるもので,新年度から工事に伴い校舎の名前が変更されることになっている. </p> <p> ホッとしていたのもつかの間,京子さんは先生から大学の資料に載っている校舎名を新しい名前に変更するお仕事を頼まれてしまった. しかし編集しなければならない資料には,今までの担当者が仕事を怠っていたせいか,ひとつ古い名前よりもっと古い名前が使われているものもあった. </p> <p> なんとか京子さんは,平...
3 12 5 sogo5gokan 10 sogo10gokan 15 sogo15gokan
sogo10gokan
26,788
s490267511
p01656
u784856415
1570786874
Python
Python3
py
Accepted
30
5636
270
from bisect import bisect_left n,q=map(int,input().split()) ans=["kogakubu10gokan"] for i in range(n): y,s=input().split() ans.append(s) y=int(y) if y==q: print(s) exit() elif y>q: print(ans[i]) exit() print(ans[-1])
p01656
<h2>A - 旧総合研究7号館</h2> <p> 時は平成50年春休み.情報学研究科に所属する京子さんは,京都にある某研究パークからの研究室の引越しがやっと終わり,ホッと一息ついていた. 今回の引越しは,古くなった校舎の改修工事によるもので,新年度から工事に伴い校舎の名前が変更されることになっている. </p> <p> ホッとしていたのもつかの間,京子さんは先生から大学の資料に載っている校舎名を新しい名前に変更するお仕事を頼まれてしまった. しかし編集しなければならない資料には,今までの担当者が仕事を怠っていたせいか,ひとつ古い名前よりもっと古い名前が使われているものもあった. </p> <p> なんとか京子さんは,平...
3 12 5 sogo5gokan 10 sogo10gokan 15 sogo15gokan
sogo10gokan
26,789
s327803952
p01656
u990228206
1552979586
Python
Python3
py
Accepted
30
5636
224
import bisect n,q=map(int,input().split()) year=[1] name=["kogakubu10gokan"] for i in range(n): ye,na=map(str,input().split()) year.append(int(ye)) name.append(na) b=bisect.bisect_left(year,q+1) print(name[b-1])
p01656
<h2>A - 旧総合研究7号館</h2> <p> 時は平成50年春休み.情報学研究科に所属する京子さんは,京都にある某研究パークからの研究室の引越しがやっと終わり,ホッと一息ついていた. 今回の引越しは,古くなった校舎の改修工事によるもので,新年度から工事に伴い校舎の名前が変更されることになっている. </p> <p> ホッとしていたのもつかの間,京子さんは先生から大学の資料に載っている校舎名を新しい名前に変更するお仕事を頼まれてしまった. しかし編集しなければならない資料には,今までの担当者が仕事を怠っていたせいか,ひとつ古い名前よりもっと古い名前が使われているものもあった. </p> <p> なんとか京子さんは,平...
3 12 5 sogo5gokan 10 sogo10gokan 15 sogo15gokan
sogo10gokan
26,790
s107967729
p01676
u260980560
1592644614
Python
Python3
py
Accepted
30
6092
697
from collections import deque import sys readline = sys.stdin.readline write = sys.stdout.write def solve(): N, M = map(int, readline().split()) G = [[] for i in range(N)] for i in range(M): s, t = map(int, readline().split()) G[s-1].append(t-1) used = [0]*N cnt = 0 ans = 0 ...
p01676
<h2>J - Tree Reconstruction</h2> <h3>Problem Statement</h3> <p> You have a directed graph. Some non-negative value is assigned on each edge of the graph. You know that the value of the graph satisfies the <em>flow conservation law</em> That is, for every node <var>v</var>, the sum of values on edges incoming to <var...
9 13 1 2 1 3 2 9 3 4 3 5 3 6 4 9 5 7 6 7 6 8 7 9 8 9 9 1
5
26,792
s065743045
p01677
u731235119
1422696186
Python
Python
py
Accepted
70
4332
912
MAX = 10**9 * 2 while 1: N = int(raw_input()) if N == 0: break signal = raw_input().split(" ") xst = MAX + 1 xlt = - xst for i in range(N): if signal[i] == "x": if i < N-1 and signal[i+1] == "x" : print "none" break if (i + 1) % 2 != 0: left = MAX + 1 if i <= 0 else int(signal[i-1]) rig...
p01677
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script language="JavaScript" type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML"></script> <h3>Problem Statement</h3> <p>N...
5 1 x 2 4 x 2 x x 2 1 2 2 2 1 2 1000000000 x 4 x 2 1 x 0
3 none ambiguous none ambiguous none
26,793
s877521676
p01677
u633068244
1423682887
Python
Python
py
Accepted
70
4332
875
while 1: N = int(raw_input()) if N == 0: break a = raw_input().split() mn,mx = -10**10,10**10 for i in range(1,N): if a[i-1] == a[i] == "x": print "none" break elif a[i-1] == "x": if (i+1)%2 == 0: mx = min(mx,int(a[i])-1) else ...
p01677
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script language="JavaScript" type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML"></script> <h3>Problem Statement</h3> <p>N...
5 1 x 2 4 x 2 x x 2 1 2 2 2 1 2 1000000000 x 4 x 2 1 x 0
3 none ambiguous none ambiguous none
26,794
s837060179
p01677
u506554532
1514358482
Python
Python3
py
Accepted
80
5724
865
INF = float('inf') def judge(src): x_max = INF x_min = -INF for i,(s1,s2) in enumerate(zip(src,src[1:])): if s1 == s2: return 'none' if i%2: s1,s2 = s2,s1 if s1 != 'x' and s2 != 'x': if s1 < s2: return 'none' else: ...
p01677
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script language="JavaScript" type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML"></script> <h3>Problem Statement</h3> <p>N...
5 1 x 2 4 x 2 x x 2 1 2 2 2 1 2 1000000000 x 4 x 2 1 x 0
3 none ambiguous none ambiguous none
26,795
s673659441
p01677
u509278866
1528266852
Python
Python3
py
Accepted
90
9136
1,957
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools sys.setrecursionlimit(10**7) inf = 10**20 eps = 1.0 / 10**10 mod = 998244353 def LI(): return [int(x) for x in sys.stdin.readline().split()] def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()] def LF...
p01677
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script language="JavaScript" type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML"></script> <h3>Problem Statement</h3> <p>N...
5 1 x 2 4 x 2 x x 2 1 2 2 2 1 2 1000000000 x 4 x 2 1 x 0
3 none ambiguous none ambiguous none
26,796
s233368288
p01687
u633068244
1398403149
Python
Python
py
Accepted
20
4216
257
ref = list("AADINNUY") aizu = "AIZUNYAN" inp = raw_input() if len(inp) < 8: print inp else: ans = "" l = len(inp) i = 0 while i < l: if i <= l - 8 and sorted(inp[i:i+8]) == ref: ans += aizu i += 8 else: ans += inp[i] i += 1 print ans
p01687
<h2>A - D's Ambition / Dのやぼう</h2> <h3>Story</h3> <p>あいずにゃんは若ヶ松高校のプログラミングコンテスト部、通称ぷろこん部に所属する2年生である。かわいい。Dのひとは天使のごとくかわいいあいずにゃんにぞっこんであり、隙あらばぺろぺろしようと画策する変態である。その愛は猟奇的であり、あいずにゃんを自分色に染めようと、&quot;AIZUNYAN&quot;という文字列を見る度&quot;AIDUNYAN&quot;に書き換えてしまう。さらにあいずにゃんを自分だけのものにするため、他の人に気づかれないようにその文字列をバラバラに並べ替えてしまう。プロコンの名門・律命館大学中等部卒...
AIDUNYAN
AIZUNYAN
26,798
s827905068
p01688
u633068244
1398509066
Python
Python
py
Accepted
20
4244
357
D = input() d1 = [raw_input().split() for i in range(input())] p1 = sorted([int(i[1]) for i in d1 if i[0] == "D"])[::-1] d2 = [raw_input().split() for i in range(input())] p2 = sorted([int(i[1]) for i in d2 if i[0] == "DD"])[::-1] ans = 0 for i in range(D+1): try: cur = sum(p1[:i]) + sum(p2[:(D-i)/2]) ans = m...
p01688
<h2>B - Doctor Course Is Recommended / D進どうですか?</h2> <h3>Story</h3> <p>DのひとはD進を決意したので、博士後期課程入学試験を受けることにした。筆記試験はマークシート形式であった。自身の専門分野の問題ばかりだったので、Dのひとはすぐにすべての正答を導くことができた。しかし、ここで大きな問題に気づいた。Dのひとは宗教上の理由から、解答用紙には'D'としか書くことができなかったのだ。また、'D'と書くためには尋常ではない集中力を使うため,'D'と書くことのできる個数も決まっている。Dのひとが本当にD進することができるか調べるため、解答・配点を踏まえ、上記の条件を...
2 3 D 30 D 50 D 20 0
80
26,799
s768985693
p01694
u046108504
1555871629
Python
Python3
py
Accepted
40
5620
601
def ll(char, f): if char == "l": return not f return f def rr(char, f): if char == "r": return not f return f while True: N = int(input()) if N == 0: break F = list(input().split()) c = 0 lFalg = False rFalg = False before = F[0] lFalg = ll(F[0...
p01694
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script language="JavaScript" type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML"></script> <!-- begin en only --> <!--<h3...
4 lu ru ld rd 4 lu ld lu ru 1 lu 10 ru lu ld rd ru rd ru lu rd ld 0
2 1 0 4
26,800
s470038355
p01694
u609255173
1416727629
Python
Python
py
Accepted
30
4492
917
#! /usr/bin/env python # -*- coding: utf-8 -*- def main(): while True: n = input() if not n: break w = 0 a = [0, 0] ans = 0 for s in raw_input().split(): f = 0 if s[0] == "l" else 1 u = 0 if s[1] == "d" else 1 a[f] = u if w == 0 and a[0] == 1 and a[1] == 1: w ...
p01694
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script language="JavaScript" type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML"></script> <!-- begin en only --> <!--<h3...
4 lu ru ld rd 4 lu ld lu ru 1 lu 10 ru lu ld rd ru rd ru lu rd ld 0
2 1 0 4
26,801
s393799571
p01694
u408260374
1417252771
Python
Python3
py
Accepted
30
6720
381
while True: n = int(input()) if n == 0: break step = input().split() ans = 0 for i in range(0, len(step), 2): if i+1 == len(step): break if (step[i] == 'lu' and step[i+1] == 'ru') or (step[i] == 'ru' and step[i+1] == 'lu') or (step[i] == 'ld' and step[i+1] == 'rd') or (step[i] == 'rd...
p01694
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script language="JavaScript" type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML"></script> <!-- begin en only --> <!--<h3...
4 lu ru ld rd 4 lu ld lu ru 1 lu 10 ru lu ld rd ru rd ru lu rd ld 0
2 1 0 4
26,802
s611634657
p01694
u633068244
1417590774
Python
Python
py
Accepted
20
4232
467
while 1: n = int(raw_input()) if n == 0: break steps = raw_input().split() lr = [0,0] start = 0 ans = 0 for step in steps: if step[0] == "l": if step[1] == "u": lr[0] += 1 else: lr[0] -= 1 else: if step[1] == "u": lr[1] += 1 els...
p01694
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script language="JavaScript" type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML"></script> <!-- begin en only --> <!--<h3...
4 lu ru ld rd 4 lu ld lu ru 1 lu 10 ru lu ld rd ru rd ru lu rd ld 0
2 1 0 4
26,803
s776875054
p01694
u617183767
1420369106
Python
Python
py
Accepted
20
4688
1,636
#! /usr/bin/env python # -*- coding: utf-8 -*- import os import sys import itertools import math from collections import Counter, defaultdict class Main(object): def __init__(self): pass def solve(self): ''' insert your code ''' while True: n = input()...
p01694
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script language="JavaScript" type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML"></script> <!-- begin en only --> <!--<h3...
4 lu ru ld rd 4 lu ld lu ru 1 lu 10 ru lu ld rd ru rd ru lu rd ld 0
2 1 0 4
26,804
s667110976
p01694
u621997536
1420895935
Python
Python3
py
Accepted
40
6716
335
while True: if input() == '0': break actions = input().split() r, l = False, False floor = True n = 0 for a in actions: if a[0] == 'r': r = not r elif a[0] == 'l': l = not l if r == l == floor: n += 1 floor = not flo...
p01694
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script language="JavaScript" type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML"></script> <!-- begin en only --> <!--<h3...
4 lu ru ld rd 4 lu ld lu ru 1 lu 10 ru lu ld rd ru rd ru lu rd ld 0
2 1 0 4
26,805
s792808577
p01694
u316268279
1421207769
Python
Python3
py
Accepted
40
6724
467
#!/usr/bin/env python # -*- coding: utf-8 -*- while True: n = int(input()) if n == 0: break status = 0 flag = False point = 0 fn = list(map(list,input().split())) for f in fn: status = status + 1 if f[1] == 'u' else status - 1 if flag == False and status == 2: ...
p01694
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script language="JavaScript" type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML"></script> <!-- begin en only --> <!--<h3...
4 lu ru ld rd 4 lu ld lu ru 1 lu 10 ru lu ld rd ru rd ru lu rd ld 0
2 1 0 4
26,806
s011228524
p01694
u731235119
1421916300
Python
Python
py
Accepted
30
4260
545
move = { ("000", "lu") : ("010", 0), ("000", "ru") : ("001", 0), ("010", "ld") : ("000", 0), ("001", "rd") : ("000", 0), ("010", "ru") : ("111", 1), ("001", "lu") : ("111", 1), ("111", "ld") : ("101", 0), ("111", "rd") : ("110", 0), ("101", "lu") : ("111", 0), ("110", "ru") : ("111", 0), ("101", "rd") : ("000", ...
p01694
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script language="JavaScript" type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML"></script> <!-- begin en only --> <!--<h3...
4 lu ru ld rd 4 lu ld lu ru 1 lu 10 ru lu ld rd ru rd ru lu rd ld 0
2 1 0 4
26,807
s863869028
p01694
u120360464
1422782272
Python
Python
py
Accepted
30
4240
578
#! /usr/bin/env python # -*- coding: utf-8 -*- N = int(raw_input()) while N!=0: act = raw_input().split() cur = 0 cnt = 0 lr = [0, 0] for i in range(N): if act[i] == "ld": lr[0] = 0 elif act[i] == "lu": lr[0] = 1 elif act[i] == "ru": lr[1...
p01694
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script language="JavaScript" type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML"></script> <!-- begin en only --> <!--<h3...
4 lu ru ld rd 4 lu ld lu ru 1 lu 10 ru lu ld rd ru rd ru lu rd ld 0
2 1 0 4
26,808
s133577935
p01694
u124909914
1426036904
Python
Python3
py
Accepted
40
6720
368
while True: n = int(input()) if n == 0: break ans = 0 f = input().split() for i in range(len(f) - 1): if f[i] == "lu" and f[i+1] == "ru" \ or f[i] == "ru" and f[i+1] == "lu" \ or f[i] == "ld" and f[i+1] == "rd" \ or f[i] == "rd" and f[i+1] == "...
p01694
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script language="JavaScript" type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML"></script> <!-- begin en only --> <!--<h3...
4 lu ru ld rd 4 lu ld lu ru 1 lu 10 ru lu ld rd ru rd ru lu rd ld 0
2 1 0 4
26,809
s977937205
p01694
u966364923
1436627474
Python
Python3
py
Accepted
40
6720
316
def main(): while True: n = int(input()) if n == 0: exit() f = [s for s in input().split()] pm = 'd' cnt = 0 for m in f: if m[1] == pm: cnt += 1 pm = m[1] print(cnt) if __name__ == '__main__': main()
p01694
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script language="JavaScript" type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML"></script> <!-- begin en only --> <!--<h3...
4 lu ru ld rd 4 lu ld lu ru 1 lu 10 ru lu ld rd ru rd ru lu rd ld 0
2 1 0 4
26,810