s_id string | p_id string | u_id string | date string | language string | original_language string | filename_ext string | status string | cpu_time string | memory string | code_size string | code string | error string | stdout string |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
s794102208 | p00218 | u633068244 | 1396276659 | Python | Python | py | Runtime Error | 0 | 0 | 228 | while 1:
n=input()
if n==0:break
for i in range(n):
m,e,j=map(int, raw_input().split())
a=sum(m,e,j)
if 100 in [m,e,j] or m+e>=180 or a>=240:print "A"
elif a>=210 or (a>=150 and max(m,e)>=80):print "B"
else:print"C" | File "/tmp/tmpyjwqkkhl/tmp45qs76jw.py", line 7
if 100 in [m,e,j] or m+e>=180 or a>=240:print "A"
^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s126005626 | p00219 | u814278309 | 1559018156 | Python | Python3 | py | Runtime Error | 0 | 0 | 511 | n=int(input())
x=[0 for i in range(10)]
while True:
if n==0:
break
for i in range(n):
a=int(input())
if a==0:
x[0]+=1
elif a==1:
x[1]+=1
elif a==2:
x[2]+=1
elif a==3:
x[3]+=1
elif a==4:
x[4]+=1
elif a==5:
x[5]+=1
elif a==6:
x[6]+=1
elif a==7:
x[7]+=1
elif a==8:
x[8]+=1
else:
x[9]+=1
for i in range(10):
if x[i]==0:
print('{}'.format('-'))
else:
print('{}'.format(x[i]*'*'))
| Traceback (most recent call last):
File "/tmp/tmpna8chwmt/tmpgt_i0yks.py", line 1, in <module>
n=int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s796570627 | p00219 | u814278309 | 1559019197 | Python | Python3 | py | Runtime Error | 0 | 0 | 239 | n=int(input())
x=[0 for i in range(10)]
while True:
if n==0:
break
for i in range(n):
a=int(input())
x[a]+=1
for i in range(10):
if x[i]==0:
print('{}'.format('-'))
else:
print('{}'.format(x[i]*'*'))
| Traceback (most recent call last):
File "/tmp/tmpt_e04zs5/tmpjrvl4kgs.py", line 1, in <module>
n=int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s816818668 | p00219 | u814278309 | 1559134432 | Python | Python3 | py | Runtime Error | 0 | 0 | 239 | n=int(input())
x=[0 for i in range(10)]
while True:
if n==0:
break
for i in range(n):
a=int(input())
x[a]+=1
for i in range(10):
if x[i]==0:
print('{}'.format('-'))
else:
print('{}'.format(x[i]*'*'))
| Traceback (most recent call last):
File "/tmp/tmpsnrwd0uu/tmpes3jn_3k.py", line 1, in <module>
n=int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s005204672 | p00219 | u147801965 | 1365786003 | Python | Python | py | Runtime Error | 0 | 0 | 182 | while True:
q={}
a=input()
if a==0:break
for i in range(10): q[i]=0
for i in range(a): q[input()]+=1
for i in range(10): print "*"*q[i] if q[i] != 0 else "-" | File "/tmp/tmpwc_ul548/tmpl1xjtbmw.py", line 7
for i in range(10): print "*"*q[i] if q[i] != 0 else "-"
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s007710993 | p00219 | u104911888 | 1368079605 | Python | Python | py | Runtime Error | 0 | 0 | 168 | while True:
n=input()
if n==0:break
L=[0]*10
for i in range(n):
L[input()]+=1
for i in range(10):
print "*"*L[i] if L[i]!=0 else "-" | File "/tmp/tmpqbhievnj/tmp_g37edyz.py", line 8
print "*"*L[i] if L[i]!=0 else "-"
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s463050947 | p00219 | u350508326 | 1383274680 | Python | Python | py | Runtime Error | 0 | 0 | 996 | if __name__ == '__main__':
    while True:
        n = int(raw_input())
        if n == 0:
            break
        data = [0 for a in range(10)]
    #    print data
        for m in range(n):
            inp = int(raw_input())
            data[inp-1] += 1
    #        print data
        for m in range(10):
            if data[m] == 0:
                print '-'
            else:
                for c in range(data[m]):
                    print '*',
                print | File "/tmp/tmpm9a4xxt_/tmpqhimo6k2.py", line 6
    while True:
^
IndentationError: expected an indented block after 'if' statement on line 1
| |
s952581260 | p00219 | u350508326 | 1391925789 | Python | Python | py | Runtime Error | 0 | 0 | 2656 | n = int(input())
data = [0] * n
for a in range(n):
t = int(input())
data[t] += 1
for a in range(n):
if data[a] == 0:
print('-') else:
for t in range(data[a]):
print('*', end='')
print() | File "/tmp/tmpnpxbrshw/tmpl8eh_6ob.py", line 5
t = int(input())
^
SyntaxError: invalid non-printable character U+3000
| |
s363927800 | p00219 | u350508326 | 1391925919 | Python | Python | py | Runtime Error | 0 | 0 | 2653 | n = int(raw_input())
data = [0] * n
for a in range(n):
t = int(raw_input())
data[t] += 1
for a in range(n):
if data[a] == 0:
print '-' else:
for t in range(data[a]):
print '*',
print | File "/tmp/tmpghmb4du4/tmpy66sv5ds.py", line 5
t = int(raw_input())
^
SyntaxError: invalid non-printable character U+3000
| |
s339819271 | p00220 | u847467233 | 1529760698 | Python | Python3 | py | Runtime Error | 0 | 0 | 364 | # AOJ 0220 Binary Digit A Doctor Loved
# Python3 2018.6.23 bal4u
while 1:
a, b = map(int, input().split('.'))
if a < 0: break
if a > 255:
print("NA")
continue
sa = format(a, '08b')
sb, s = '', str(b)
k = 10**len(s)
for i in range(4):
b *= 2
if b >= k: sb += '1'
else: sb += '0'
b %= k
if b == 0: print(sa, '.', sb, sep='')
else: print("NA")
| Traceback (most recent call last):
File "/tmp/tmpfa9gcv9q/tmpep2sqme9.py", line 5, in <module>
a, b = map(int, input().split('.'))
^^^^^^^
EOFError: EOF when reading a line
| |
s564863925 | p00220 | u104911888 | 1368003017 | Python | Python | py | Runtime Error | 0 | 0 | 360 | while True:
a,b=map(int,raw_input().split("."))
if a<0:break
s,s2="",""
while a>=2:
s+=str(a%2)
a/=2
else:
s+=str(a)
s=(s+"0"*(8-len(s)))[::-1]
cnt=0
while b!=0 and cnt<=4:
b*=2
s2+=str(b/10)
b%=10
cnt+=1
s2+="0"*(4-len(s2))
print s+"."+s2 if len(s2)<=4 else "NA" | File "/tmp/tmpnm7fyr76/tmpzugjtktz.py", line 19
print s+"."+s2 if len(s2)<=4 else "NA"
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s756452741 | p00220 | u104911888 | 1368003612 | Python | Python | py | Runtime Error | 0 | 0 | 352 | while True:
a,b=map(int,raw_input().split("."))
if a<0:break
s,s2="",""
while a!=0:
s+=str(a%2)
a/=2
cnt=0
while b!=0 and cnt<=4:
b*=2
s2+=str(b/10)
b%=10
cnt+=1
s2+="0"*(4-len(s2))
if len(s2)<=4:
print "%08d.%d"%(int(s[::-1]),int(s2))
else:
print "NA" | File "/tmp/tmp6z64dpzb/tmp1joe7gfs.py", line 16
print "%08d.%d"%(int(s[::-1]),int(s2))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s063103074 | p00220 | u104911888 | 1368004044 | Python | Python | py | Runtime Error | 0 | 0 | 240 | while True:
a,b=map(int,raw_input().split("."))
if a<0:break
s,s2="",""
while a!=0:
s+=str(a%2)
a/=2
cnt=0
s2="0"*4
if len(s2)<=4:
print "%08d"%(int(s[::-1]))
else:
print "NA" | File "/tmp/tmph1th09j2/tmpykex5c_c.py", line 12
print "%08d"%(int(s[::-1]))
^^^^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s211565079 | p00220 | u104911888 | 1368004846 | Python | Python | py | Runtime Error | 0 | 0 | 550 | while True:
a,b=map(int,raw_input().split("."))
if a<0:break
s,s2="",""
# while a!=0:
# s+=str(a%2)
# a/=2
cnt=0
while b!=0 and cnt<=4:
b*=2
s2+=str(b/10)
b%=10
cnt+=1
s2="0"*4
if len(s2)<=4:
print "%08d"%(int(format(a,"b")))
else:
print "NA" | File "/tmp/tmpe6x3cglu/tmp5qwq0tl3.py", line 13
s2+=str(b/10)
TabError: inconsistent use of tabs and spaces in indentation
| |
s135476465 | p00220 | u104911888 | 1368004907 | Python | Python | py | Runtime Error | 0 | 0 | 618 | while True:
#a,b=map(int,raw_input().split("."))
a=input()
if a<0:break
s,s2="",""
# while a!=0:
# s+=str(a%2)
# a/=2
cnt=0
while b!=0 and cnt<=4:
b*=2
s2+=str(b/10)
b%=10
cnt+=1
s2="0"*4
if len(s2)<=4:
print "%08d"%(int(format(int(a),"b")))
else:
print "NA" | File "/tmp/tmppuay8ben/tmplrpfo0ez.py", line 14
s2+=str(b/10)
TabError: inconsistent use of tabs and spaces in indentation
| |
s119354333 | p00221 | u319725914 | 1535704496 | Python | Python3 | py | Runtime Error | 0 | 0 | 466 | while(True):
m,n = map(int,input().split())
if not m: break
a = list(range(1,m+1))
b = [input() for _ in range(n)]
t = [str(i+1) for i in range(n)]
t[2::3] = ["Fizz"]*len(t[2::3])
t[4::5] = ["Buzz"]*len(t[4::5])
t[14::15] = ["FizzBuzz"]*len(t[14::15])
i=0
for j in range(n):
if len(a) <2: break
if b[j] != t[j]: del a[i]; continue
i += 1
i = i%len(a)
print(" ".join(str(e) for e in a))
| Traceback (most recent call last):
File "/tmp/tmpqj36yw4e/tmpfg23oeby.py", line 2, in <module>
m,n = map(int,input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s844616465 | p00221 | u766477342 | 1412262337 | Python | Python | py | Runtime Error | 0 | 0 | 702 | def fizz_buzz():
c = 1
while True:
res = ''
if c % 3 == 0:
res = res + 'Fizz'
if c % 5 == 0:
res = res + 'Buzz'
if res == '':
yield str(c)
else:
yield res
c += 1
while True:
m,n = map(int,raw_input().split())
if m == 0: break
player = range(m)
p = 0
fb = fizz_buzz()
for i in range(n):
inp = raw_input()
if len(player) > 1:
if inp <> fb.next():
del player[p]
else:
p = (p+1) % len(player)
result = str(player[0]+1)
for pi in player[1:]:
result += ' ' + str(pi+1)
print result | File "/tmp/tmp62dj3x6t/tmp5d5uack2.py", line 26
if inp <> fb.next():
^^
SyntaxError: invalid syntax
| |
s141305794 | p00221 | u766477342 | 1412262464 | Python | Python | py | Runtime Error | 0 | 0 | 703 |
def fizz_buzz():
c = 1
while True:
res = ''
if c % 3 == 0:
res = res + 'Fizz'
if c % 5 == 0:
res = res + 'Buzz'
if res == '':
yield str(c)
else:
yield res
c += 1
while True:
m,n = map(int,raw_input().split())
if m == 0: break
player = range(m)
p = 0
fb = fizz_buzz()
for i in range(n):
inp = raw_input()
if len(player) > 1:
if inp != fb.next():
del player[p]
else:
p = (p+1) % len(player)
result = str(player[0]+1)
for pi in player[1:]:
result += ' ' + str(pi+1)
print result | File "/tmp/tmp7plup4i_/tmp6o0at0ns.py", line 36
print result
^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s330950091 | p00221 | u766477342 | 1412262823 | Python | Python3 | py | Runtime Error | 0 | 0 | 700 | def fizz_buzz():
c = 1
while True:
res = ''
if c % 3 == 0:
res = res + 'Fizz'
if c % 5 == 0:
res = res + 'Buzz'
if res == '':
yield str(c)
else:
yield res
c += 1
while True:
m,n = map(int,input().split())
if m == 0: break
player = list(range(m))
p = 0
fb = fizz_buzz()
for i in range(n):
inp = input()
if len(player) > 1:
if inp != next(fb):
del player[p]
else:
p = (p+1) % len(player)
result = str(player[0]+1)
for pi in player[1:]:
result += ' ' + str(pi+1)
print(result) | Traceback (most recent call last):
File "/tmp/tmpomzi1r5u/tmpl9r5k_zl.py", line 16, in <module>
m,n = map(int,input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s405896752 | p00221 | u766477342 | 1412262977 | Python | Python3 | py | Runtime Error | 0 | 0 | 732 | def fizz_buzz():
c = 1
while True:
res = ''
if c % 3 == 0:
res = res + 'Fizz'
if c % 5 == 0:
res = res + 'Buzz'
if res == '':
yield str(c)
else:
yield res
c += 1
while True:
m,n = map(int,input().split())
if m == 0: break
player = list(range(m))
p = 0
fb = fizz_buzz()
for i in range(n):
inp = input()
if len(player) > 1:
if inp != next(fb):
del player[p]
else:
p = (p+1) % len(player)
result = str(player[0]+1)
if len(player) > 1:
for pi in player[1:]:
result += ' ' + str(pi+1)
print(result) | Traceback (most recent call last):
File "/tmp/tmpfv89fqv_/tmpq436ftgs.py", line 16, in <module>
m,n = map(int,input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s684872353 | p00221 | u766477342 | 1412263014 | Python | Python3 | py | Runtime Error | 0 | 0 | 609 | def fizz_buzz():
c = 1
while True:
res = ''
if c % 3 == 0:
res = res + 'Fizz'
if c % 5 == 0:
res = res + 'Buzz'
if res == '':
yield str(c)
else:
yield res
c += 1
while True:
m,n = map(int,input().split())
if m == 0: break
player = list(range(m))
p = 0
fb = fizz_buzz()
for i in range(n):
inp = input()
if len(player) > 1:
if inp != next(fb):
del player[p]
else:
p = (p+1) % len(player)
print(result) | Traceback (most recent call last):
File "/tmp/tmpwop87udb/tmpgkmbaf6a.py", line 16, in <module>
m,n = map(int,input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s741702818 | p00221 | u766477342 | 1412263062 | Python | Python3 | py | Runtime Error | 0 | 0 | 609 | def fizz_buzz():
c = 1
while True:
res = ''
if c % 3 == 0:
res = res + 'Fizz'
if c % 5 == 0:
res = res + 'Buzz'
if res == '':
yield str(c)
else:
yield res
c += 1
while True:
m,n = map(int,input().split())
if m == 0: break
player = list(range(m))
p = 0
fb = fizz_buzz()
for i in range(n):
inp = input()
if len(player) > 1:
if inp != next(fb):
del player[p]
else:
p = (p+1) % len(player)
print(result) | Traceback (most recent call last):
File "/tmp/tmpkcd2nv2e/tmpu1fqon1j.py", line 16, in <module>
m,n = map(int,input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s591366676 | p00221 | u766477342 | 1412263257 | Python | Python | py | Runtime Error | 0 | 0 | 768 | def fizz_buzz():
c = 1
while True:
res = ''
if c % 3 == 0:
res = res + 'Fizz'
if c % 5 == 0:
res = res + 'Buzz'
if res == '':
yield str(c)
else:
yield res
c += 1
while True:
m,n = map(int,input().split())
if m == 0: break
player = list(range(m))
p = 0
fb = fizz_buzz()
for i in range(n):
inp = input()
if len(player) > 1:
if inp != next(fb):
del player[p]
p = p % len(player)
else:
p = (p+1) % len(player)
result = str(player[0]+1)
if len(player) > 1:
for pi in player[1:]:
result += ' ' + str(pi+1)
print(result) | Traceback (most recent call last):
File "/tmp/tmp73h88bln/tmphordzbr2.py", line 16, in <module>
m,n = map(int,input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s685273993 | p00221 | u567380442 | 1427200032 | Python | Python3 | py | Runtime Error | 0 | 0 | 639 | def fizzbuzz(i):
if i % 15 == 0:
return 'FizzBuzz'
elif i % 5 == 0:
return 'Buzz'
elif i % 3 == 0:
return 'Fizz'
else:
return str(i)
import sys
f = sys.stdin
while True:
m, n = map(int, f.readline().split())
if m == n == 0:
break
member = list(range(1, m + 1))
s = [f.readline().strip() for _ in range(n)]
offset = 0
for i in range(n):
if s[i] != fizzbuzz(i + 1):
pos = (i - offset) % m
member.remove(member[pos])
offset = i - pos
if len(member) == 1:
break
print(*member) | Traceback (most recent call last):
File "/tmp/tmp8xw4k0z2/tmp9q3y0bid.py", line 15, in <module>
m, n = map(int, f.readline().split())
^^^^
ValueError: not enough values to unpack (expected 2, got 0)
| |
s133161638 | p00221 | u266872031 | 1427898691 | Python | Python | py | Runtime Error | 0 | 0 | 834 | while(1):
[m,n]=[int(x) for x in raw_input().split()]
if m==0:
break
else:
truenum=0
player=[x for x in range(1,m+1)]
for i in range(n):
if len(player)>1:
shout=raw_input()
pnow=player.pop(0)
truenum=truenum+1
if truenum%15==0:
if shout=="FizzBuzz":
player.append(pnow)
elif truenum%5==0:
if shout=="Buzz":
player.append(pnow)
elif truenum%3==0:
if shout=="Fizz":
player.append(pnow)
else:
if shout==str(truenum):
player.append(pnow)
print " ".join([str(x) for x in sorted(player)]) | File "/tmp/tmpord7muk2/tmp874k55dk.py", line 25
print " ".join([str(x) for x in sorted(player)])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s028407455 | p00221 | u873482706 | 1437471397 | Python | Python | py | Runtime Error | 0 | 0 | 815 | while True:
M, N = map(int, raw_input().split())
if M == N == 0: break
m = [i for i in range(1, M+1)]
index = 0
num = 1
for i in range(N):
line = raw_input()
if num % 15 == 0:
if line != 'FizzBuzz':
del m[index]
elif num % 3 == 0:
if line != 'Fizz':
del m[index]
elif num % 5 == 0:
if line != 'Buzz':
del m[index]
else:
if not line.isdigit():
del m[index]
else:
if int(line) != num:
del m[index]
if len(m) == 1:
break
elif index+1 >= len(m):
index = 0
else:
index += 1
num += 1
else:
print ' '.join(map(str, m)) | File "/tmp/tmpzz0y9fpm/tmpqlf1isat.py", line 32
print ' '.join(map(str, m))
^^^^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s068775160 | p00221 | u873482706 | 1437471459 | Python | Python | py | Runtime Error | 0 | 0 | 801 | while True:
M, N = map(int, raw_input().split())
if M == N == 0: break
m = [i for i in range(1, M+1)]
index = 0
num = 1
for i in range(N):
line = raw_input()
if num % 15 == 0:
if line != 'FizzBuzz':
del m[index]
elif num % 3 == 0:
if line != 'Fizz':
del m[index]
elif num % 5 == 0:
if line != 'Buzz':
del m[index]
else:
if not line.isdigit():
del m[index]
else:
if int(line) != num:
del m[index]
if len(m) == 1:
break
elif index+1 >= len(m):
index = 0
else:
index += 1
num += 1
print ' '.join(map(str, m)) | File "/tmp/tmpkt_kwxml/tmph7inbx_b.py", line 31
print ' '.join(map(str, m))
^^^^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s840257413 | p00221 | u078042885 | 1484149462 | Python | Python3 | py | Runtime Error | 0 | 0 | 568 | while 1:
m,n=map(int,input().split())
if m==0:break
a,i,c=[i+1 for i in range(m)],1,0
while i<=n:
b,f=input(),0
if i%15==0:
if b!='FizzBuzz':
del a[c]
f=1
elif i%5==0:
if b!='Buzz':
del a[c]
f=1
elif i%3==0:
if b!='Fizz':
del a[c]
f=1
else:
if b!=str(i):
del a[c]
f=1
if f:m-=1
else:c=(c+1)%m
i+=1
print(*a) | Traceback (most recent call last):
File "/tmp/tmpdx6tdv09/tmpsylv98t9.py", line 2, in <module>
m,n=map(int,input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s501074490 | p00221 | u078042885 | 1484149614 | Python | Python3 | py | Runtime Error | 0 | 0 | 592 | while 1:
m,n=map(int,input().split())
if m==0:break
a,i,c=[i+1 for i in range(m)],1,0
while i<=n:
b,f=input(),0
if m==1:continue
if i%15==0:
if b!='FizzBuzz':
del a[c]
f=1
elif i%5==0:
if b!='Buzz':
del a[c]
f=1
elif i%3==0:
if b!='Fizz':
del a[c]
f=1
else:
if b!=str(i):
del a[c]
f=1
if f:m-=1
else:c=(c+1)%m
i+=1
print(*a) | Traceback (most recent call last):
File "/tmp/tmppvqda2tz/tmpu95i7_kt.py", line 2, in <module>
m,n=map(int,input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s786988722 | p00221 | u078042885 | 1484149886 | Python | Python3 | py | Runtime Error | 0 | 0 | 591 | while 1:
m,n=map(int,input().split())
if m==0:break
a,i,c=[i+1 for i in range(m)],0,0
while i<n:
i+=1
b,f=input(),0
if m==1:continue
if i%15==0:
if b!='FizzBuzz':
del a[c]
f=1
elif i%5==0:
if b!='Buzz':
del a[c]
f=1
elif i%3==0:
if b!='Fizz':
del a[c]
f=1
else:
if b!=str(i):
del a[c]
f=1
if f:m-=1
else:c=(c+1)%m
print(*a) | Traceback (most recent call last):
File "/tmp/tmp0w2h_mv2/tmp1ejwjmmv.py", line 2, in <module>
m,n=map(int,input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s178071871 | p00221 | u078042885 | 1484150466 | Python | Python3 | py | Runtime Error | 0 | 0 | 596 | while 1:
m,n=map(int,input().split())
if m==0:break
a,i,c=[i+1 for i in range(m)],0,0
while i<n:
i+=1
b,f=input(),0
if len(a)==1:continue
if i%15==0:
if b!='FizzBuzz':
del a[c]
f=1
elif i%5==0:
if b!='Buzz':
del a[c]
f=1
elif i%3==0:
if b!='Fizz':
del a[c]
f=1
else:
if b!=str(i):
del a[c]
f=1
if f:m-=1
else:c=(c+1)%m
print(*a) | Traceback (most recent call last):
File "/tmp/tmpi7vycz95/tmpoek3dscu.py", line 2, in <module>
m,n=map(int,input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s512311929 | p00221 | u078042885 | 1484188358 | Python | Python3 | py | Runtime Error | 0 | 0 | 590 | while 1:
m,n=map(int,input().split())
if m==0:break
a,i,c=list(range(1,m+1)),0,0
while i<n:
i+=1
b,f=input(),0
if m<2:continue
if i%15==0:
if b!='FizzBuzz':
del a[c]
f=1
elif i%5==0:
if b!='Buzz':
del a[c]
f=1
elif i%3==0:
if b!='Fizz':
del a[c]
f=1
elif b!=str(i):
del a[c]
f=1
if f:
m-=1
c%m
else:c=(c+1)%m
print(*a) | Traceback (most recent call last):
File "/tmp/tmpx3ym2fgi/tmpzsb3vr34.py", line 2, in <module>
m,n=map(int,input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s641695227 | p00221 | u546285759 | 1491630027 | Python | Python3 | py | Runtime Error | 0 | 0 | 511 | while True:
m, n = map(int, input().split())
if m == 0:
break
player = [i+1 for i in range(m)]
j = 0
for i in range(1, n+1):
s = input()
if i % 3 == 0 and i % 5 == 0 and s != 'FizzBuzz':
del player[j]
elif i % 3 == 0 and s != 'Fizz':
del player[j]
elif i % 5 == 0 and s != 'Buzz':
del player[j]
if len(player)-1 == j or len(player) == j:
j = 0
else:
j += 1
print(*player) | Traceback (most recent call last):
File "/tmp/tmpxb4rift3/tmpidio2td9.py", line 2, in <module>
m, n = map(int, input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s779188436 | p00221 | u546285759 | 1491630071 | Python | Python3 | py | Runtime Error | 0 | 0 | 558 | while True:
m, n = map(int, input().split())
if m == 0:
break
player = [i+1 for i in range(m)]
j = 0
for i in range(1, n+1):
s = input()
if i % 3 == 0 and i % 5 == 0 and s != 'FizzBuzz':
del player[j]
elif i % 3 == 0 and s != 'Fizz':
del player[j]
elif i % 5 == 0 and s != 'Buzz':
del player[j]
if len(player) == 1:
break
if len(player)-1 == j or len(player) == j:
j = 0
else:
j += 1
print(*player) | Traceback (most recent call last):
File "/tmp/tmprtdeb_ei/tmp8o1uwlkq.py", line 2, in <module>
m, n = map(int, input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s166932813 | p00221 | u546285759 | 1496315231 | Python | Python3 | py | Runtime Error | 0 | 0 | 528 | hoge = [0] + ["FizzBuzz" if i % 3 == 0 and i % 5 == 0 else("Fizz" if i % 3 == 0 else("Buzz" if i % 5 == 0 else str(i))) for i in range(1, 10001)]
while True:
m, n = map(int, input().split())
if m == 0:
break
man = [str(i) for i in range(1, m+1)]
a, b = divmod(n, m)
man = a*man+man[:b]
idx = 0
for i in range(1, n+1):
if hoge[i] == input():
idx += 1
else:
v = man[idx]
man = list(filter((v).__ne__, man))
print(*sorted(list(set(man)))) | Traceback (most recent call last):
File "/tmp/tmp71r9beah/tmpwjbxyu_g.py", line 4, in <module>
m, n = map(int, input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s749376468 | p00221 | u546285759 | 1496315419 | Python | Python3 | py | Runtime Error | 0 | 0 | 617 | hoge = []
for i in range(10001):
if i % 3 == 0 and i % 5 == 0:
hoge.append("FizzBuzz")
elif i % 3 == 0:
hoge.append("Fizz")
elif i % 5 == 0:
hoge.append("Buzz")
else:
hoge.append(str(i))
while True:
m, n = map(int, input().split())
if m == 0:
break
man = [str(i) for i in range(1, m+1)]
a, b = divmod(n, m)
man = a*man+man[:b]
idx = 0
for i in range(1, n+1):
if hoge[i] == input():
idx += 1
else:
v = man[idx]
man = list(filter((v).__ne__, man))
print(*sorted(list(set(man)))) | Traceback (most recent call last):
File "/tmp/tmpm73xw80b/tmpnvo21e80.py", line 13, in <module>
m, n = map(int, input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s014683737 | p00221 | u546285759 | 1496315875 | Python | Python3 | py | Runtime Error | 0 | 0 | 571 | hoge = ["FizzBuzz" if i % 3 == 0 and i % 5 == 0 else("Fizz" if i % 3 == 0 else("Buzz" if i % 5 == 0 else str(i))) for i in range(10001)]
while True:
m, n = map(int, input().split())
if m == 0:
break
man = [str(i) for i in range(1, m+1)]
a, b = divmod(n, m)
man = a*man+man[:b]
idx = 0
for i in range(1, n+1):
if hoge[i] == input():
idx += 1
else:
v = man[idx]
man = list(filter((v).__ne__, man))
if len(man) == 1:
break
print(*sorted(list(set(man)))) | Traceback (most recent call last):
File "/tmp/tmpq3sig057/tmpu1kw4a8w.py", line 4, in <module>
m, n = map(int, input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s383074101 | p00221 | u546285759 | 1496316114 | Python | Python3 | py | Runtime Error | 0 | 0 | 583 | hoge = ["FizzBuzz" if i % 3 == 0 and i % 5 == 0 else("Fizz" if i % 3 == 0 else("Buzz" if i % 5 == 0 else str(i))) for i in range(10001)]
while True:
m, n = map(int, input().split())
if m == 0:
break
man = [str(i) for i in range(1, m+1)]
a, b = divmod(n, m)
man = a*man+man[:b]
idx = 0
for i in range(1, n+1):
if hoge[i] == input():
idx += 1
else:
v = man[idx]
man = list(filter((v).__ne__, man))
if len(man) == 1:
break
print(*sorted([int(v) for v in set(man)])) | Traceback (most recent call last):
File "/tmp/tmpi6wjnhrj/tmpxw5dpu9n.py", line 4, in <module>
m, n = map(int, input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s314649972 | p00221 | u546285759 | 1496316269 | Python | Python3 | py | Runtime Error | 0 | 0 | 576 | hoge = ["FizzBuzz" if i % 3 == 0 and i % 5 == 0 else("Fizz" if i % 3 == 0 else("Buzz" if i % 5 == 0 else str(i))) for i in range(10001)]
while True:
m, n = map(int, input().split())
if m == 0:
break
man = [str(i) for i in range(1, m+1)]
a, b = divmod(n, m)
man = a*man+man[:b]
idx = 0
for i in range(1, n+1):
if hoge[i] == input():
idx += 1
else:
v = man[idx]
man = list(filter((v).__ne__, man))
if len(set(man)) == 1:
break
print(*sorted(list(set(man)))) | Traceback (most recent call last):
File "/tmp/tmpjajsov11/tmp8bsb910h.py", line 4, in <module>
m, n = map(int, input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s311481019 | p00221 | u546285759 | 1496316467 | Python | Python3 | py | Runtime Error | 0 | 0 | 671 | hoge = ["FizzBuzz" if i % 3 == 0 and i % 5 == 0 else("Fizz" if i % 3 == 0 else("Buzz" if i % 5 == 0 else str(i))) for i in range(10001)]
while True:
m, n = map(int, input().split())
if m == 0:
break
man = [str(i) for i in range(1, m+1)]
a, b = divmod(n, m)
man = a*man+man[:b]
idx, k = 0, 1
while k < n+1:
x = input()
if hoge[i] == x:
idx += 1
else:
v = man[idx]
man = list(filter((v).__ne__, man))
if len(set(man)) == 1:
for i in range((n+1)-k):
input()
break
k += 1
print(*sorted(list(set(man)))) | Traceback (most recent call last):
File "/tmp/tmp047njgwb/tmphp7wesqp.py", line 4, in <module>
m, n = map(int, input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s763666371 | p00221 | u546285759 | 1496316514 | Python | Python3 | py | Runtime Error | 0 | 0 | 671 | hoge = ["FizzBuzz" if i % 3 == 0 and i % 5 == 0 else("Fizz" if i % 3 == 0 else("Buzz" if i % 5 == 0 else str(i))) for i in range(10001)]
while True:
m, n = map(int, input().split())
if m == 0:
break
man = [str(i) for i in range(1, m+1)]
a, b = divmod(n, m)
man = a*man+man[:b]
idx, k = 0, 1
while k < n+1:
x = input()
if hoge[k] == x:
idx += 1
else:
v = man[idx]
man = list(filter((v).__ne__, man))
if len(set(man)) == 1:
for i in range((n+1)-k):
input()
break
k += 1
print(*sorted(list(set(man)))) | Traceback (most recent call last):
File "/tmp/tmp5vpz51gk/tmpcth9tjxk.py", line 4, in <module>
m, n = map(int, input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s573217434 | p00221 | u546285759 | 1496316561 | Python | Python3 | py | Runtime Error | 0 | 0 | 667 | hoge = ["FizzBuzz" if i % 3 == 0 and i % 5 == 0 else("Fizz" if i % 3 == 0 else("Buzz" if i % 5 == 0 else str(i))) for i in range(10001)]
while True:
m, n = map(int, input().split())
if m == 0:
break
man = [str(i) for i in range(1, m+1)]
a, b = divmod(n, m)
man = a*man+man[:b]
idx, k = 0, 1
while k < n+1:
x = input()
if hoge[k] == x:
idx += 1
else:
v = man[idx]
man = list(filter((v).__ne__, man))
if len(set(man)) == 1:
for i in range(n-k):
input()
break
k += 1
print(*sorted(list(set(man)))) | Traceback (most recent call last):
File "/tmp/tmp5pqlws9v/tmp4e0sezz6.py", line 4, in <module>
m, n = map(int, input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s350203415 | p00221 | u546285759 | 1501742730 | Python | Python3 | py | Runtime Error | 0 | 0 | 399 | while True:
m, n = map(int, input().split())
if m == 0:
break
player = list(range(1, m+1))
idx = 0
for i in range(1, n+1):
ans = "Fizz"*(i%3==0) + "Buzz"*(i%5==0) or str(i)
if ans == input():
idx += 1
else:
player.pop(idx)
if len(player) == 1:
break
idx %= len(player)
print(*player) | Traceback (most recent call last):
File "/tmp/tmpk2v506h8/tmpbd1h9bek.py", line 2, in <module>
m, n = map(int, input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s842161894 | p00221 | u546285759 | 1501742846 | Python | Python3 | py | Runtime Error | 0 | 0 | 399 | while True:
m, n = map(int, input().split())
if m == 0:
break
player = list(range(1, m+1))
idx = 0
for i in range(1, n+1):
ans = "Fizz"*(i%3==0) + "Buzz"*(i%5==0) or str(i)
if ans == input():
idx += 1
else:
del player[idx]
if len(player) == 1:
break
idx %= len(player)
print(*player) | Traceback (most recent call last):
File "/tmp/tmpfkuhj130/tmp2cokqn9f.py", line 2, in <module>
m, n = map(int, input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s921596048 | p00221 | u957021183 | 1506059234 | Python | Python3 | py | Runtime Error | 0 | 0 | 905 | # Aizu Problem 0221: Fizz Buzz
import sys, math, os, struct
# read input:
PYDEV = os.environ.get('PYDEV')
if PYDEV=="True":
sys.stdin = open("sample-input.txt", "rt")
def valid(k, a):
if k % 3 == 0 and k % 5 == 0:
return a == "FizzBuzz"
elif k % 3 == 0:
return a == "Fizz"
elif k % 5 == 0:
return a == "Buzz"
else:
return int(a) == k
def fizz_buzz(m, n, A):
players = list(range(1, m + 1))
p = 0
k = 0
while len(A) > 0:
k += 1
a = A.pop(0)
if valid(k, a):
p = (p + 1) % m
else:
players.pop(p)
m -= 1
if p == m:
p = 0
print(' '.join([str(p) for p in players]))
while True:
m, n = [int(_) for _ in input().split()]
if m == n == 0:
break
A = [input().strip() for _ in range(n)]
fizz_buzz(m, n, A) | Traceback (most recent call last):
File "/tmp/tmpayjwrxq9/tmp03612sql.py", line 40, in <module>
m, n = [int(_) for _ in input().split()]
^^^^^^^
EOFError: EOF when reading a line
| |
s020699721 | p00221 | u957021183 | 1506059271 | Python | Python3 | py | Runtime Error | 0 | 0 | 986 | # Aizu Problem 0221: Fizz Buzz
import sys, math, os, struct
# read input:
PYDEV = os.environ.get('PYDEV')
if PYDEV=="True":
sys.stdin = open("sample-input.txt", "rt")
def valid(k, a):
if k % 3 == 0 and k % 5 == 0:
return a == "FizzBuzz"
elif k % 3 == 0:
return a == "Fizz"
elif k % 5 == 0:
return a == "Buzz"
else:
return int(a) == k
def fizz_buzz(m, n, A):
players = list(range(1, m + 1))
p = 0
k = 0
while len(A) > 0:
k += 1
a = A.pop(0)
if valid(k, a):
p = (p + 1) % m
else:
if len(players) == 0:
print()
return
players.pop(p)
m -= 1
if p == m:
p = 0
print(' '.join([str(p) for p in players]))
while True:
m, n = [int(_) for _ in input().split()]
if m == n == 0:
break
A = [input().strip() for _ in range(n)]
fizz_buzz(m, n, A) | Traceback (most recent call last):
File "/tmp/tmpes4gil0b/tmp231lzk8r.py", line 43, in <module>
m, n = [int(_) for _ in input().split()]
^^^^^^^
EOFError: EOF when reading a line
| |
s292277015 | p00221 | u957021183 | 1506059324 | Python | Python3 | py | Runtime Error | 0 | 0 | 981 | # Aizu Problem 0221: Fizz Buzz
import sys, math, os, struct
# read input:
PYDEV = os.environ.get('PYDEV')
if PYDEV=="True":
sys.stdin = open("sample-input.txt", "rt")
def valid(k, a):
if k % 3 == 0 and k % 5 == 0:
return a == "FizzBuzz"
elif k % 3 == 0:
return a == "Fizz"
elif k % 5 == 0:
return a == "Buzz"
else:
return int(a) == k
def fizz_buzz(m, n, A):
players = list(range(1, m + 1))
p = 0
k = 0
while len(A) > 0:
k += 1
a = A.pop(0)
if valid(k, a):
p = (p + 1) % m
else:
if len(players) == 0:
print()
return
players.pop(p)
m -= 1
if p == m:
p = 0
print(' '.join([str(p) for p in players]))
while True:
m, n = [int(_) for _ in input().split()]
if m == 0:
break
A = [input().strip() for _ in range(n)]
fizz_buzz(m, n, A) | Traceback (most recent call last):
File "/tmp/tmpbqs3mong/tmpggvgxwp8.py", line 43, in <module>
m, n = [int(_) for _ in input().split()]
^^^^^^^
EOFError: EOF when reading a line
| |
s007830508 | p00221 | u957021183 | 1506059366 | Python | Python3 | py | Runtime Error | 0 | 0 | 1037 | # Aizu Problem 0221: Fizz Buzz
import sys, math, os, struct
# read input:
PYDEV = os.environ.get('PYDEV')
if PYDEV=="True":
sys.stdin = open("sample-input.txt", "rt")
def valid(k, a):
if k % 3 == 0 and k % 5 == 0:
return a == "FizzBuzz"
elif k % 3 == 0:
return a == "Fizz"
elif k % 5 == 0:
return a == "Buzz"
else:
return int(a) == k
def fizz_buzz(m, n, A):
players = list(range(1, m + 1))
p = 0
k = 0
while len(A) > 0:
k += 1
a = A.pop(0)
if valid(k, a):
p = (p + 1) % m
else:
if len(players) == 0:
print()
return
players.pop(p)
if len(players) == 1:
break
m -= 1
if p == m:
p = 0
print(' '.join([str(p) for p in players]))
while True:
m, n = [int(_) for _ in input().split()]
if m == 0:
break
A = [input().strip() for _ in range(n)]
fizz_buzz(m, n, A) | Traceback (most recent call last):
File "/tmp/tmp1splwjwb/tmpvjcvb27e.py", line 45, in <module>
m, n = [int(_) for _ in input().split()]
^^^^^^^
EOFError: EOF when reading a line
| |
s026472339 | p00221 | u855694108 | 1507766358 | Python | Python3 | py | Runtime Error | 0 | 0 | 1585 | import sys
def main():
for line in sys.stdin:
m, n = map(int, line.split())
if m == 0 and n == 0:
break
else:
s = []
for x in range(1, n + 1):
s.append(input())
a = []
for x in range(int(s[0]), n + 1):
if x % 3 == 0 and x % 5 != 0:
a.append("Fizz")
elif x % 3 != 0 and x % 5 == 0:
a.append("Buzz")
elif x % 3 == 0 and x % 5 == 0:
a.append("FizzBuzz")
else:
a.append(str(x))
print("s", s)
print("a", a)
m_list = [i for i in range(1, m + 1)]
f = True
for x in range(n):
if s[x] != a[x]:
if m_list[x % 5] != 0:
m_list[x % 5] = 0
else:
for y in range(m - 1):
hoge = x % m + y
if hoge > m - 1:
hoge -= m
if m_list[hoge] != 0:
m_list[hoge] = 0
break
if y == m - 2:
f = False
if f == True:
for x in range(m):
if m_list[x] != 0:
print(m_list[x], end = " ")
print()
else:
print(0)
if __name__ == "__main__":
main() | ||
s866666118 | p00221 | u855694108 | 1507766378 | Python | Python3 | py | Runtime Error | 0 | 0 | 1585 | import sys
def main():
for line in sys.stdin:
m, n = map(int, line.split())
if m == 0 and n == 0:
break
else:
s = []
for x in range(1, n + 1):
s.append(input())
a = []
for x in range(int(s[0]), n + 1):
if x % 3 == 0 and x % 5 != 0:
a.append("Fizz")
elif x % 3 != 0 and x % 5 == 0:
a.append("Buzz")
elif x % 3 == 0 and x % 5 == 0:
a.append("FizzBuzz")
else:
a.append(str(x))
print("s", s)
print("a", a)
m_list = [i for i in range(1, m + 1)]
f = True
for x in range(n):
if s[x] != a[x]:
if m_list[x % 5] != 0:
m_list[x % 5] = 0
else:
for y in range(m - 1):
hoge = x % m + y
if hoge > m - 1:
hoge -= m
if m_list[hoge] != 0:
m_list[hoge] = 0
break
if y == m - 2:
f = False
if f == True:
for x in range(m):
if m_list[x] != 0:
print(m_list[x], end = " ")
print()
else:
print(0)
if __name__ == "__main__":
main() | ||
s949326994 | p00221 | u855694108 | 1507766488 | Python | Python3 | py | Runtime Error | 0 | 0 | 1623 | import sys
def main():
for line in sys.stdin:
m, n = map(int, line.split())
if m == 0 and n == 0:
break
else:
s = []
for x in range(1, n + 1):
s.append(input())
a = []
for x in range(int(s[0]), n + 1):
if x % 3 == 0 and x % 5 != 0:
a.append("Fizz")
elif x % 3 != 0 and x % 5 == 0:
a.append("Buzz")
elif x % 3 == 0 and x % 5 == 0:
a.append("FizzBuzz")
else:
a.append(str(x))
print("s", s)
print("a", a)
m_list = [i for i in range(1, m + 1)]
f = True
for x in range(n):
if s[x] != a[x]:
if m_list[x % 5] != 0:
m_list[x % 5] = 0
else:
for y in range(m - 1):
hoge = x % m + y
if hoge > m - 1:
hoge -= m
if m_list[hoge] != 0:
m_list[hoge] = 0
break
if y == m - 2:
f = False
break
if f == True:
for x in range(m):
if m_list[x] != 0:
print(m_list[x], end = " ")
print()
else:
print(0)
if __name__ == "__main__":
main() | ||
s034139089 | p00221 | u855694108 | 1507766760 | Python | Python3 | py | Runtime Error | 0 | 0 | 1570 | import sys
def main():
for line in sys.stdin:
m, n = map(int, line.split())
if m == 0 and n == 0:
break
else:
s = []
for x in range(1, n + 1):
s.append(input())
a = []
for x in range(int(s[0]), n + 1):
if x % 3 == 0 and x % 5 != 0:
a.append("Fizz")
elif x % 3 != 0 and x % 5 == 0:
a.append("Buzz")
elif x % 3 == 0 and x % 5 == 0:
a.append("FizzBuzz")
else:
a.append(str(x))
m_list = [i for i in range(1, m + 1)]
f = True
for x in range(n):
if s[x] != a[x]:
if m_list[x % m] != 0:
m_list[x % m] = 0
else:
for y in range(m - 1):
hoge = x % m + y
if hoge > m - 1:
hoge -= m
if m_list[hoge] != 0:
m_list[hoge] = 0
break
if y == m - 2:
f = False
break
if f == True:
for x in range(m):
if m_list[x] != 0:
print(m_list[x], end = " ")
print()
else:
print(0)
if __name__ == "__main__":
main() | ||
s591680540 | p00221 | u811733736 | 1508875994 | Python | Python3 | py | Runtime Error | 0 | 0 | 1027 | # -*- coding: utf-8 -*-
"""
http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0221
"""
import sys
from sys import stdin
from collections import deque
input = stdin.readline
def FizzBuzz(count=1):
while True:
if count % 15 == 0:
ans = 'FizzBuzz'
elif count % 5 == 0:
ans = 'Buzz'
elif count % 3 == 0:
ans = 'Fizz'
else:
ans = str(count)
yield ans
count += 1
def main(args):
while True:
m, n = map(int, input().split())
if m == 0 and n == 0:
break
players = deque(range(1, m+1))
fb = FizzBuzz()
for i in range(1, n+1):
p = input().strip('\n')
if p != fb.__next__():
players.popleft()
else:
players.rotate(-1)
if len(players) == 1:
break
result = list(players)
result.sort()
print(*result)
if __name__ == '__main__':
main(sys.argv[1:]) | Traceback (most recent call last):
File "/tmp/tmpucg6xkui/tmp2gf79_ui.py", line 48, in <module>
main(sys.argv[1:])
File "/tmp/tmpucg6xkui/tmp2gf79_ui.py", line 28, in main
m, n = map(int, input().split())
^^^^
ValueError: not enough values to unpack (expected 2, got 0)
| |
s336933375 | p00221 | u811733736 | 1508877421 | Python | Python3 | py | Runtime Error | 0 | 0 | 1154 | # -*- coding: utf-8 -*-
"""
http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0221
"""
import sys
from sys import stdin
from collections import deque
input = stdin.readline
def FizzBuzz(count=1):
while True:
if count % 15 == 0:
ans = 'FizzBuzz'
elif count % 5 == 0:
ans = 'Buzz'
elif count % 3 == 0:
ans = 'Fizz'
else:
ans = str(count)
yield ans
count += 1
def main(args):
while True:
m, n = map(int, input().split())
if m == 0 and n == 0:
break
players = deque(range(1, m+1))
fb = FizzBuzz()
for _ in range(n):
p = input().strip('\n')
# print('player {}: {}'.format(players[0], p))
if p != fb.__next__():
drop = players.popleft()
# print('player {} dropped'.format(drop))
if len(players) == 1:
break
else:
players.rotate(-1)
result = list(players)
result.sort()
print(*result)
if __name__ == '__main__':
main(sys.argv[1:]) | Traceback (most recent call last):
File "/tmp/tmphuspf5uc/tmp_5mjn5ek.py", line 50, in <module>
main(sys.argv[1:])
File "/tmp/tmphuspf5uc/tmp_5mjn5ek.py", line 28, in main
m, n = map(int, input().split())
^^^^
ValueError: not enough values to unpack (expected 2, got 0)
| |
s831469731 | p00221 | u811733736 | 1508877900 | Python | Python3 | py | Runtime Error | 0 | 0 | 1146 | # -*- coding: utf-8 -*-
"""
http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0221
"""
import sys
from sys import stdin
from collections import deque
input = stdin.readline
def fb_gen(count=1):
while True:
if count % 15 == 0:
ans = 'FizzBuzz'
elif count % 5 == 0:
ans = 'Buzz'
elif count % 3 == 0:
ans = 'Fizz'
else:
ans = str(count)
yield ans
count += 1
def main(args):
while True:
m, n = map(int, input().split())
if m == 0 and n == 0:
break
players = deque(range(1, m+1))
fb = fb_gen()
for _ in range(n):
p = input().strip()
# print('player {}: {}'.format(players[0], p))
if p != fb.__next__():
drop = players.popleft()
# print('player {} dropped'.format(drop))
if len(players) == 1:
break
else:
players.rotate(-1)
result = list(players)
result.sort()
print(*result)
if __name__ == '__main__':
main(sys.argv[1:]) | Traceback (most recent call last):
File "/tmp/tmp5fpxde9p/tmpn5fc6cqw.py", line 50, in <module>
main(sys.argv[1:])
File "/tmp/tmp5fpxde9p/tmpn5fc6cqw.py", line 28, in main
m, n = map(int, input().split())
^^^^
ValueError: not enough values to unpack (expected 2, got 0)
| |
s270627018 | p00221 | u811733736 | 1508878207 | Python | Python3 | py | Runtime Error | 0 | 0 | 1014 | # -*- coding: utf-8 -*-
"""
http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0221
"""
import sys
from sys import stdin
from collections import deque
input = stdin.readline
def fb_gen(count=1):
while True:
if count % 15 == 0:
ans = 'FizzBuzz'
elif count % 5 == 0:
ans = 'Buzz'
elif count % 3 == 0:
ans = 'Fizz'
else:
ans = str(count)
yield ans
count += 1
def main(args):
while True:
m, n = map(int, input().split())
if m == 0 and n == 0:
break
players = deque(range(1, m+1))
fb = fb_gen()
for _ in range(n):
if len(players) == 1:
break
p = input().strip()
if p != fb.__next__():
players.popleft()
else:
players.rotate(-1)
result = list(players)
result.sort()
print(*result)
if __name__ == '__main__':
main(sys.argv[1:]) | Traceback (most recent call last):
File "/tmp/tmp1fp6relq/tmpkyb8dz6u.py", line 48, in <module>
main(sys.argv[1:])
File "/tmp/tmp1fp6relq/tmpkyb8dz6u.py", line 28, in main
m, n = map(int, input().split())
^^^^
ValueError: not enough values to unpack (expected 2, got 0)
| |
s098430992 | p00221 | u811733736 | 1508878365 | Python | Python3 | py | Runtime Error | 0 | 0 | 1120 | # -*- coding: utf-8 -*-
"""
http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0221
"""
import sys
from sys import stdin
from collections import deque
input = stdin.readline
def fb_gen(count=1):
while True:
if count % 15 == 0:
ans = 'FizzBuzz'
elif count % 5 == 0:
ans = 'Buzz'
elif count % 3 == 0:
ans = 'Fizz'
else:
ans = str(count)
yield ans
count += 1
def main(args):
while True:
m, n = map(int, input().split())
if m == 0 and n == 0:
break
players = deque(range(1, m+1))
fb = fb_gen()
for _ in range(n):
p = input().strip()
if p != fb.__next__():
try:
drop = players.popleft()
except:
players = deque(drop)
if len(players) == 1:
break
else:
players.rotate(-1)
result = list(players)
result.sort()
print(*result)
if __name__ == '__main__':
main(sys.argv[1:]) | Traceback (most recent call last):
File "/tmp/tmpwjghxk2u/tmpo81i20k4.py", line 51, in <module>
main(sys.argv[1:])
File "/tmp/tmpwjghxk2u/tmpo81i20k4.py", line 28, in main
m, n = map(int, input().split())
^^^^
ValueError: not enough values to unpack (expected 2, got 0)
| |
s599394702 | p00221 | u104911888 | 1367024526 | Python | Python | py | Runtime Error | 0 | 0 | 477 | while True:
m,n=map(int,raw_input().split())
if m==n==0:
break
L=[]
s=range(1,m+1)
for i in range(1,n+1):
if i%15==0:
L.append("FizzBuzz")
elif i%5==0:
L.append("Buzz")
elif i%3==0:
L.append("Fizz")
else:
L.append(str(i))
j=0
for chars in L:
t=raw_input()
if t<>chars:
del s[j%m]
j+=1
print " ".join([str(i) for i in s]) | File "/tmp/tmp1tx74nlg/tmpmm20hsml.py", line 20
if t<>chars:
^^
SyntaxError: invalid syntax
| |
s524363441 | p00221 | u104911888 | 1367024864 | Python | Python | py | Runtime Error | 0 | 0 | 381 | m,n=map(int,raw_input().split())
if m==n==0:
break
L=[]
s=range(1,m+1)
for i in range(1,n+1):
if i%15==0:
L.append("FizzBuzz")
elif i%5==0:
L.append("Buzz")
elif i%3==0:
L.append("Fizz")
else:
L.append(str(i))
j=0
for chars in L:
t=raw_input()
if t<>chars:
del s[j%m]
j+=1
print " ".join([str(i) for i in s]) | File "/tmp/tmpxlx75cj7/tmpceolbdk_.py", line 19
if t<>chars:
^^
SyntaxError: invalid syntax
| |
s387095049 | p00221 | u104911888 | 1367024925 | Python | Python | py | Runtime Error | 0 | 0 | 469 | while True:
m,n=map(int,raw_input().split())
if m==n==0:
break
L=[]
s=range(1,m+1)
for i in range(1,n+1):
if i%15==0:
L.append("FizzBuzz")
elif i%5==0:
L.append("Buzz")
elif i%3==0:
L.append("Fizz")
else:
L.append(str(i))
j=0
for chars in L:
t=raw_input()
if t<>chars:
del s[j%m]
j+=1
for i in s:
print i | File "/tmp/tmp0qld0kf0/tmpljr50o7r.py", line 20
if t<>chars:
^^
SyntaxError: invalid syntax
| |
s908370203 | p00221 | u104911888 | 1367025068 | Python | Python | py | Runtime Error | 0 | 0 | 502 | while True:
m,n=map(int,raw_input().split())
if m==n==0:
break
L=[]
S=range(1,m+1)
for i in range(1,n+1):
if i%15==0:
L.append("FizzBuzz")
elif i%5==0:
L.append("Buzz")
elif i%3==0:
L.append("Fizz")
else:
L.append(str(i))
j=0
for char in L:
t=raw_input()
if len(S)==1:break
if t<>char:
del S[j%m]
j+=1
print " ".join([str(i) for i in S]) | File "/tmp/tmpoxj70v3j/tmpq3m9_9cl.py", line 21
if t<>char:
^^
SyntaxError: invalid syntax
| |
s996273576 | p00221 | u104911888 | 1367051299 | Python | Python | py | Runtime Error | 0 | 0 | 440 | def Judge(i):
if i%15==0: return "FizzBuzz"
if i%5==0: return "Buzz"
if i%3==0: return "Fizz"
return str(i)
while True:
m,n=map(int,raw_input().split())
L=range(1,m+1)
j=0
if m==n==0:break
for i in range(1,n+1):
c=raw_input()
if len(L)==1:break
if Judge(i)!=c:
del L[j]
j%=len(L)
else:
j=(j+1)%len(L)
print L
print " ".join(map(str,L)) | File "/tmp/tmp0t706jv8/tmp2wjw7j54.py", line 13
c=raw_input()
TabError: inconsistent use of tabs and spaces in indentation
| |
s563017621 | p00221 | u104911888 | 1367053370 | Python | Python | py | Runtime Error | 0 | 0 | 424 | def Judge(i):
if i%15==0: return "FizzBuzz"
if i%5==0: return "Buzz"
if i%3==0: return "Fizz"
return str(i)
while True:
m,n=map(int,raw_input().split())
L=range(1,m+1)
j=0
if m==n==0:break
for i in range(1,n+1):
c=raw_input()
if len(L)==1:break
if Judge(i)!=c:
del L[j]
j%=len(L)
else:
j=(j+1)%len(L)
print " ".join(map(str,L)) | File "/tmp/tmpng3_i2i0/tmpgj0y1sfl.py", line 13
c=raw_input()
TabError: inconsistent use of tabs and spaces in indentation
| |
s721184388 | p00221 | u621997536 | 1387783113 | Python | Python | py | Runtime Error | 0 | 0 | 4 | null | Traceback (most recent call last):
File "/tmp/tmpfs790cjg/tmpv7swt8b_.py", line 1, in <module>
null
NameError: name 'null' is not defined
| |
s252065947 | p00221 | u621997536 | 1387783147 | Python | Python | py | Runtime Error | 0 | 0 | 425 | while 1:
m, n = map(int, raw_input().split())
if not m:
break
p = range(m)
t = 0
for i in range(1, n + 1):
s = raw_input()
if(i % 15 == 0 and s != "FizzBuzz" or
i % 5 == 0 and s != "Buzz" or
i % 3 == 0 and s != "Fizz" or
i % 3 and i % 5 and s != str(i)):
p.pop(t)
else:
t = (t + 1) % len(p)
for i in range(len(p) - 1):
print p[i] + 1,
print p[len(p) - 1] + 1 | File "/tmp/tmp7_ta0vil/tmpfj14kd89.py", line 17
print p[i] + 1,
^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s238423269 | p00221 | u633068244 | 1396778399 | Python | Python | py | Runtime Error | 0 | 0 | 373 | def fizzbuzz(n):
if n%15==0: return "FizzBuzz"
if n%5==0: return "Buzz"
if n%3==0: return "Fizz"
return str(n)
while 1:
m,n=map(int,raw_input().split())
if m==0:break
player=[i+1 for i in range(m)]
for i in range(n):
if fizzbuzz(i+1)!=raw_input():
player.pop((i-(m-len(player)))%len(player))
if len(player)==1:
break
print " ".join(map(str,player))
| File "/tmp/tmpvq2epe5h/tmpi0scn3ss.py", line 16
print " ".join(map(str,player))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s146420813 | p00221 | u633068244 | 1396778624 | Python | Python | py | Runtime Error | 0 | 0 | 349 | def fizzbuzz(n):
if n%15==0: return "FizzBuzz"
if n%5==0: return "Buzz"
if n%3==0: return "Fizz"
return str(n)
while 1:
m,n=map(int,raw_input().split())
if m==0:break
player=range(1,m+1)
for i in range(n):
if len(player)>1:
if fizzbuzz(i+1)!=raw_input():
player.pop((i-(m-len(player)))%len(player))
print " ".join(map(str,player)) | File "/tmp/tmpu8fudhe_/tmpja4783gx.py", line 15
print " ".join(map(str,player))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s792011992 | p00221 | u633068244 | 1396778681 | Python | Python | py | Runtime Error | 0 | 0 | 357 | def fizzbuzz(n):
if n%15==0: return "FizzBuzz"
if n%5==0: return "Buzz"
if n%3==0: return "Fizz"
return str(n)
while 1:
m,n=map(int,raw_input().split())
if m==0:break
player=range(1,m+1)
for i in range(n):
if len(player)==1:
break
if fizzbuzz(i+1)!=raw_input():
del player[(i-(m-len(player)))%len(player)]
print " ".join(map(str,player)) | File "/tmp/tmpp3ocnj26/tmp93p5ywjo.py", line 16
print " ".join(map(str,player))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s330566286 | p00221 | u633068244 | 1396778840 | Python | Python | py | Runtime Error | 0 | 0 | 381 | def fizzbuzz(n):
if n%15==0: return "FizzBuzz"
if n%5==0: return "Buzz"
if n%3==0: return "Fizz"
return str(n)
while 1:
m,n=map(int,raw_input().split())
if m==0:break
player=range(1,m+1)
p=0
for i in range(n):
if len(player)==1:
break
if fizzbuzz(i+1)!=raw_input():
del player[p]
p%=len(player)
else:
p=(p+1)%len(player)
print " ".join(map(str,player)) | File "/tmp/tmpiiu_dp_3/tmpdjsf74y7.py", line 20
print " ".join(map(str,player))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s389786058 | p00222 | u041086527 | 1416060787 | Python | Python | py | Runtime Error | 0 | 0 | 546 | def is_prime(q):
q = abs(q)
if q == 2:
return True
if q < 2 or q & 1 == 0:
return False
return pow(2, q - 1, q) == 1
if __name__ == "__main__":
while True:
n = input()
if (n == 0):
break
if (n < 19):
print 13
else:
for x in xrange(n, 13, -1):
if (is_prime(x) and is_prime(x - 2) and is_prime(x - 6) and is_prime(x - 8)):
print x
break
| File "/tmp/tmpnm9tah8t/tmp6nj8iqce.py", line 14
print 13
^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s244825915 | p00222 | u041086527 | 1416061189 | Python | Python | py | Runtime Error | 0 | 0 | 625 | def is_prime(q):
q = abs(q)
if q == 2:
return True
if q < 2 or q & 1 == 0:
return False
return pow(2, q - 1, q) == 1
if __name__ == "__main__":
while True:
n = input()
if (n == 0):
break
if (n < 19):
print 13
else:
tmp = (n - 19) / 30
while tmp >= 0:
x = 30 * tmp + 19
if (is_prime(x) and is_prime(x - 2) and is_prime(x - 6) and is_prime(x - 8)):
print x
break
tmp -= 1
| File "/tmp/tmpsayi7q7f/tmp9dcoj5um.py", line 14
print 13
^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s562266679 | p00222 | u041086527 | 1416061389 | Python | Python | py | Runtime Error | 0 | 0 | 630 | def is_prime(q):
q = abs(q)
if q == 2:
return True
if q < 2 or q & 1 == 0:
return False
return pow(2, q - 1, q) == 1
if __name__ == "__main__":
while True:
n = input()
if (n == 0):
break
if (n < 19):
print 13
else:
tmp = (n - 19) / 30
while tmp >= 0:
x = 30 * tmp + 19
if (is_prime(x) and is_prime(x - 2) and is_prime(x - 6) and is_prime(x - 8)):
print x
break
tmp -= 1
| File "/tmp/tmpnp1td368/tmp7a4verei.py", line 15
print 13
^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s438152258 | p00222 | u041086527 | 1416061557 | Python | Python | py | Runtime Error | 0 | 0 | 635 | def is_prime(q):
q = abs(q)
if q == 2:
return True
if q < 2 or q & 1 == 0:
return False
return pow(2, q - 1, q) == 1
if __name__ == "__main__":
while True:
n = input()
if (n == 0):
break
if (n < 19):
print 13
else:
tmp = int((n - 19) / 30)
while tmp >= 0:
x = 30 * tmp + 19
if (is_prime(x) and is_prime(x - 2) and is_prime(x - 6) and is_prime(x - 8)):
print x
break
tmp -= 1
| File "/tmp/tmp9jnz2xkd/tmp72wapt3b.py", line 15
print 13
^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s453158895 | p00222 | u041086527 | 1416061663 | Python | Python | py | Runtime Error | 0 | 0 | 696 | def is_prime(q):
q = abs(q)
if q == 2:
return True
if q < 2 or q & 1 == 0:
return False
return pow(2, q - 1, q) == 1
if __name__ == "__main__":
while True:
n = input()
if (n == 0):
break
if (n < 19):
print 13
else:
tmp = int((n - 19) / 30)
if tmp == 0:
print 19
while tmp > 0:
x = 30 * tmp + 19
if (is_prime(x) and is_prime(x - 2) and is_prime(x - 6) and is_prime(x - 8)):
print x
break
tmp -= 1
| File "/tmp/tmp0ii9i3kj/tmpqx25e1fp.py", line 15
print 13
^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s301305655 | p00222 | u041086527 | 1416061772 | Python | Python | py | Runtime Error | 0 | 0 | 740 | import sys
def is_prime(q):
q = abs(q)
if q == 2:
return True
if q < 2 or q & 1 == 0:
return False
return pow(2, q - 1, q) == 1
if __name__ == "__main__":
sys.setrecursionlimit(1145)
while True:
n = input()
if (n == 0):
break
if (n < 19):
print 13
else:
tmp = int((n - 19) / 30)
if tmp == 0:
print 19
while tmp > 0:
x = 30 * tmp + 19
if (is_prime(x) and is_prime(x - 2) and is_prime(x - 6) and is_prime(x - 8)):
print x
break
tmp -= 1
| File "/tmp/tmp4ubc987r/tmpv40sqzye.py", line 18
print 13
^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s863330656 | p00222 | u041086527 | 1416061810 | Python | Python | py | Runtime Error | 0 | 0 | 740 | import sys
def is_prime(q):
q = abs(q)
if q == 2:
return True
if q < 2 or q & 1 == 0:
return False
return pow(2, q - 1, q) == 1
if __name__ == "__main__":
sys.setrecursionlimit(1000)
while True:
n = input()
if (n == 0):
break
if (n < 19):
print 13
else:
tmp = int((n - 19) / 30)
if tmp == 0:
print 19
while tmp > 0:
x = 30 * tmp + 19
if (is_prime(x) and is_prime(x - 2) and is_prime(x - 6) and is_prime(x - 8)):
print x
break
tmp -= 1
| File "/tmp/tmpy7a2hevu/tmp70isyz5z.py", line 18
print 13
^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s621670275 | p00222 | u041086527 | 1416062095 | Python | Python | py | Runtime Error | 0 | 0 | 854 | import sys
def is_prime2(q,k=100):
q = abs(q)
if q == 2: return True
if q < 2 or q&1 == 0: return False
for i in xrange(3,k):
x,y = q,i
while y:
x, y = y, x % y
if x != 1: continue
if pow(i, q-1, q) != 1:
return False
return True
if __name__ == "__main__":
while True:
n = input()
if (n == 0):
break
if (n < 19):
print 13
else:
tmp = int((n - 19) / 30)
if tmp == 0:
print 19
while tmp > 0:
x = 30 * tmp + 19
if (is_prime2(x) and is_prime2(x - 2) and is_prime2(x - 6) and is_prime2(x - 8)):
print x
break
tmp -= 1
| File "/tmp/tmpughcum5f/tmpfar8rnwf.py", line 21
print 13
^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s920729290 | p00222 | u041086527 | 1416062344 | Python | Python | py | Runtime Error | 0 | 0 | 812 | import sys
def is_prime2(q,k=100):
q = abs(q)
if q == 2: return True
if q < 2 or q&1 == 0: return False
for i in xrange(3,k):
x,y = q,i
while y:
x, y = y, x % y
if x != 1: continue
if pow(i, q-1, q) != 1:
return False
return True
if __name__ == "__main__":
while True:
n = input()
if (n == 0):
break
if (n < 19):
print 13
else:
tmp = int((n - 19) / 30)
if tmp == 0:
print 19
while tmp > 0:
x = 30 * tmp + 19
if (is_prime2(x) and is_prime2(x - 2) and is_prime2(x - 6) and is_prime2(x - 8)):
print x
break
tmp -= 1
break | File "/tmp/tmp_qkt9c2s/tmpxeb8uu3f.py", line 21
print 13
^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s622084922 | p00222 | u041086527 | 1416062693 | Python | Python | py | Runtime Error | 0 | 0 | 647 |
def is_prime2(q,k=100):
q = abs(q)
if q == 2: return True
if q < 2 or q&1 == 0: return False
for i in xrange(3,k):
x,y = q,i
while y:
x, y = y, x % y
if x != 1: continue
if pow(i, q-1, q) != 1:
return False
return True
while True:
n = input()
if (n == 0):
break
if (n < 19):
print 13
else:
tmp = int((n - 19) / 30)
while tmp > 0:
x = 30 * tmp + 19
if (is_prime2(x) and is_prime2(x - 2) and is_prime2(x - 6) and is_prime2(x - 8)):
print x
break
tmp -= 1 | File "/tmp/tmpw2d4lnup/tmpou5qiqh7.py", line 20
print 13
^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s130942874 | p00222 | u041086527 | 1416062771 | Python | Python | py | Runtime Error | 0 | 0 | 632 |
def is_prime2(q,k=100):
if q == 2: return True
if q < 2 or q&1 == 0: return False
for i in xrange(3,k):
x,y = q,i
while y:
x, y = y, x % y
if x != 1: continue
if pow(i, q-1, q) != 1:
return False
return True
while True:
n = input()
if (n == 0):
break
if (n < 19):
print 13
else:
tmp = int((n - 19) / 30)
while tmp > 0:
x = 30 * tmp + 19
if (is_prime2(x) and is_prime2(x - 2) and is_prime2(x - 6) and is_prime2(x - 8)):
print x
break
tmp -= 1 | File "/tmp/tmpf8mgt9l4/tmptv7uvs_k.py", line 19
print 13
^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s857922977 | p00222 | u766477342 | 1419606032 | Python | Python3 | py | Runtime Error | 0 | 0 | 453 | MAX_N = 10000000+1
def make_sosu_tbl():
for i in range(2, MAX_N):
if sos[i]:
for j in range(i+i, MAX_N+1, i):
sos[j] = 0
if i**2 >= MAX_N:break
sos = [1] * (MAX_N+1)
make_sosu_tbl()
while 1:
# MAX_N = int(input())
# if not MAX_N: break
#
n = int(input())
for i in reversed(range(13,n+1)):
if sos[i] and sos[i-2] and sos[i-6] and sos[i-8]:
print(i)
break | Traceback (most recent call last):
File "/tmp/tmpvfoayx4h/tmp7s8u4wrs.py", line 16, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s504863364 | p00222 | u766477342 | 1419606090 | Python | Python3 | py | Runtime Error | 0 | 0 | 472 | MAX_N = 10000000+1
def make_sosu_tbl():
for i in range(2, MAX_N):
if sos[i]:
for j in range(i+i, MAX_N+1, i):
sos[j] = 0
if i**2 >= MAX_N:break
sos = [1] * (MAX_N+1)
make_sosu_tbl()
while 1:
# MAX_N = int(input())
# if not MAX_N: break
#
n = int(input())
if not n:break
for i in reversed(range(13,n+1)):
if sos[i] and sos[i-2] and sos[i-6] and sos[i-8]:
print(i)
break | Traceback (most recent call last):
File "/tmp/tmpdko4ta1i/tmp38ier9kf.py", line 16, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s433735597 | p00222 | u766477342 | 1419606216 | Python | Python3 | py | Runtime Error | 0 | 0 | 417 | MAX_N = 10000000+1
def make_sosu_tbl():
for i in range(2, MAX_N):
if sos[i]:
for j in range(i+i, MAX_N+1, i):
sos[j] = 0
if i**2 >= MAX_N:break
sos = [1] * (MAX_N+1)
make_sosu_tbl()
while 1:
n = int(input())
if not n: break
for i in reversed(range(13, n+1)):
if sos[i] and sos[i-2] and sos[i-6] and sos[i-8]:
print(i)
break | Traceback (most recent call last):
File "/tmp/tmp6el6ghxk/tmpxb3hu92u.py", line 13, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s595471930 | p00222 | u766477342 | 1419756147 | Python | Python3 | py | Runtime Error | 0 | 0 | 547 | move = [[[10, 10], [4, 4]], [[8, 2],[4, 2]]]
MAX_N = 10000000+1
sos = [1] * (MAX_N+1)
sos[0] = sos[1] = 0
for i in range(2, int(MAX_N**0.5)+1):
if sos[i]:
for j in range(i+i, MAX_N+1, i):
sos[j] = 0
while 1:
n = int(input())
if not n: break
n -= (n%2 == 0)
while n >= 13:
if sos[n] and sos[n-2] and sos[n-6] and sos[n-8]:
print(n)
break
else:
n -= move[sos[n-8]][sos[n-6]][sos[n-2]]
# measure_stop = datetime.now()
# print(measure_stop - measure_start) | Traceback (most recent call last):
File "/tmp/tmplt3cayg1/tmp_9hfsj96.py", line 12, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s584894405 | p00222 | u567380442 | 1427203960 | Python | Python3 | py | Runtime Error | 0 | 0 | 470 | def sieve(n):
p = [True] * (n + 1)
p[0] = p[1] = False
for i in range(int(n ** 0.5) + 1):
if p[i]:
for j in range(2 * i, len(p), i):
p[j] = False
return p
def get_quad(n, p):
for ni in range(n,0,-1):
if p[ni] and p[ni - 2] and p[ni - 6] and p[ni - 8]:
return ni
import sys
f = sys.stdin
n = [int(line) for line in f][:-1]
prime = sieve(max(n))
for ni in n:
print(get_quad(ni, prime)) | Traceback (most recent call last):
File "/tmp/tmp2c4rhskr/tmp3ki0b2ol.py", line 19, in <module>
prime = sieve(max(n))
^^^^^^
ValueError: max() arg is an empty sequence
| |
s410745949 | p00222 | u567380442 | 1427204248 | Python | Python3 | py | Runtime Error | 0 | 0 | 461 | def sieve(n):
p = [1] * (n + 1)
p[0] = p[1] = 0
for i in range(int(n ** 0.5) + 1):
if p[i]:
for j in range(2 * i, len(p), i):
p[j] = 0
return p
def get_quad(n, p):
for ni in range(n,0,-1):
if p[ni] and p[ni - 2] and p[ni - 6] and p[ni - 8]:
return ni
import sys
f = sys.stdin
n = [int(line) for line in f][:-1]
prime = sieve(max(n))
for ni in n:
print(get_quad(ni, prime)) | Traceback (most recent call last):
File "/tmp/tmpxk9_tvfw/tmphta9q29x.py", line 21, in <module>
prime = sieve(max(n))
^^^^^^
ValueError: max() arg is an empty sequence
| |
s453419466 | p00222 | u567380442 | 1427204588 | Python | Python3 | py | Runtime Error | 0 | 0 | 517 | def get_quad(n, p):
for ni in range(n,0,-1):
if p[ni] and p[ni - 2] and p[ni - 6] and p[ni - 8]:
return ni
def sieve(n):
p = [1] * (n + 1)
p[0] = p[1] = 0
for i in range(int(n ** 0.5) + 1):
if p[i]:
for j in range(2 * i, len(p), i):
p[j] = 0
return p
import sys
f = sys.stdin
n = []
while True:
ni = int(f.readline())
if ni == 0:
break
n.append(ni)
prime = sieve(max(n))
for ni in n:
print(get_quad(ni, prime)) | Traceback (most recent call last):
File "/tmp/tmpd0rxqjjz/tmpz6wxy046.py", line 19, in <module>
ni = int(f.readline())
^^^^^^^^^^^^^^^^^
ValueError: invalid literal for int() with base 10: ''
| |
s301541135 | p00222 | u567380442 | 1427242978 | Python | Python3 | py | Runtime Error | 0 | 0 | 488 | def get_quad(n, p):
for ni in range(n,0,-1):
if p[ni] and p[ni - 2] and p[ni - 6] and p[ni - 8]:
return ni
def sieve():
n = 10000001
p = [1] * n
p[0] = p[1] = 0
for i in range(int(n ** 0.5)):
if p[i]:
for j in range(2 * i, len(p), i):
p[j] = 0
return p
import sys
f = sys.stdin
prime = sieve()
while True:
ni = int(f.readline())
if ni == 0:
break
print(get_quad(ni, prime)) | Traceback (most recent call last):
File "/tmp/tmp2388p2v8/tmp3x_txn0h.py", line 21, in <module>
ni = int(f.readline())
^^^^^^^^^^^^^^^^^
ValueError: invalid literal for int() with base 10: ''
| |
s990717367 | p00222 | u567380442 | 1427243753 | Python | Python3 | py | Runtime Error | 0 | 0 | 390 | def get_quad(n, p):
return 0
def sieve():
n = 10000001
p = [1] * n
p[0] = p[1] = 0
for i in range(int(n ** 0.5)):
if p[i]:
for j in range(2 * i, len(p), i):
p[j] = 0
return p
import sys
f = sys.stdin
prime = sieve()
while True:
ni = int(f.readline())
if ni == 0:
break
print(get_quad(ni, prime)) | Traceback (most recent call last):
File "/tmp/tmptjck3mov/tmpofqkvurd.py", line 19, in <module>
ni = int(f.readline())
^^^^^^^^^^^^^^^^^
ValueError: invalid literal for int() with base 10: ''
| |
s081856350 | p00222 | u567380442 | 1427243847 | Python | Python3 | py | Runtime Error | 0 | 0 | 359 | def get_quad(n, p):
return 0
def sieve():
n = 10000001
p = [1] * n
p[0] = p[1] = 0
for i in range(int(n ** 0.5)):
if p[i]:
for j in range(2 * i, len(p), i):
p[j] = 0
return p
import sys
f = sys.stdin
prime = sieve()
while True:
ni = int(f.readline())
if ni == 0:
break | Traceback (most recent call last):
File "/tmp/tmp7mkvhlbk/tmpz5998rxk.py", line 19, in <module>
ni = int(f.readline())
^^^^^^^^^^^^^^^^^
ValueError: invalid literal for int() with base 10: ''
| |
s816969520 | p00222 | u567380442 | 1427243918 | Python | Python3 | py | Runtime Error | 0 | 0 | 312 | def sieve():
n = 10000001
p = [1] * n
p[0] = p[1] = 0
for i in range(int(n ** 0.5)):
if p[i]:
for j in range(2 * i, len(p), i):
p[j] = 0
return p
import sys
f = sys.stdin
prime = sieve()
while True:
ni = int(input())
if ni == 0:
break | Traceback (most recent call last):
File "/tmp/tmpwcrv3yzm/tmpugn5dgkm.py", line 16, in <module>
ni = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s364652017 | p00222 | u567380442 | 1427243969 | Python | Python3 | py | Runtime Error | 0 | 0 | 79 |
while True:
ni = int(input())
if ni == 0:
break
print('0') | Traceback (most recent call last):
File "/tmp/tmp01zkayyp/tmpszilpsej.py", line 3, in <module>
ni = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s742624392 | p00222 | u567380442 | 1427245767 | Python | Python3 | py | Runtime Error | 0 | 0 | 584 | def get_quad(n, p):
if n < 19:
return 13
n = (n + 1) // 10 * 10 - 1
for ni in range(n,0,-10):
if p[ni] and p[ni - 2] and p[ni - 6] and p[ni - 8]:
return ni
def sieve():
n = 10000001
p = [1] * n
p[0] = p[1] = 0
for i in range(int(n ** 0.5)):
if p[i]:
for j in range(2 * i, len(p), i):
p[j] = 0
return p
prime = sieve()
while True:
n = f.readline().strip()
if not n.isdigit():
continue
n = int(n)
if n == 0:
break
print(get_quad(n, prime)) | Traceback (most recent call last):
File "/tmp/tmp5d5tgiae/tmpf5k3s0u7.py", line 22, in <module>
n = f.readline().strip()
^
NameError: name 'f' is not defined
| |
s910424754 | p00222 | u546285759 | 1491125957 | Python | Python3 | py | Runtime Error | 0 | 0 | 318 | primes = [0, 0] + [1]*999999
for i in range(2, 1001):
for j in range(i*i, 1000001, i):
primes[j] = 0
while True:
n = int(input())
if n == 0:
break
for i in range(5, n+1)[::-1]:
if primes[i] and primes[i-2] and primes[i-6] and primes[i-8]:
print(i)
break | Traceback (most recent call last):
File "/tmp/tmpbe_8u5gu/tmp_2py7uly.py", line 7, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s194367573 | p00222 | u546285759 | 1507866779 | Python | Python3 | py | Runtime Error | 0 | 0 | 362 | primes = [0, 0] + [1] * 9999991
for i in range(2, 3163):
for j in range(i*i, 9999992, i):
if primes[j]:
primes[j] = 0
while True:
n = int(input())
if n == 0:
break
while True:
if primes[n-8] and primes[n-6] and primes[n-2] and primes[n]:
print(n)
break
else:
n -= 1 | ||
s553182694 | p00222 | u546285759 | 1507867239 | Python | Python3 | py | Runtime Error | 0 | 0 | 343 | primes = [0, 0] + [1] * 9999999
for i in range(2, 3163):
if primes[i]:
for j in range(i*i, 10000001, i):
primes[j] = 0
while True:
n = int(input())
if n == 0:
break
for i in range(5, n+1)[::-1]:
if primes[i-8] & primes[i-6] & primes[i-2] & primes[i]):
print(i)
break | File "/tmp/tmp_he8q_oi/tmp9cj0yg3d.py", line 12
if primes[i-8] & primes[i-6] & primes[i-2] & primes[i]):
^
SyntaxError: unmatched ')'
| |
s536385974 | p00222 | u633068244 | 1399119256 | Python | Python | py | Runtime Error | 0 | 0 | 266 | r = 10000001
s = int(r**0.5)
p = [1]*r
p[0] = p[1] = 0
for i in range(2,s):
if p[i]:
p[2*i::i] = [0 for x in range(2*i,r,i)]
while 1:
n = input()
if n == 0: break
for i in range(n-(1-n%2),12,-4):
if p[i] and p[i-2] and p[i-6] and p[i-8]:
print i
break | File "/tmp/tmpa9u4x5am/tmpt0gnkemr.py", line 14
print i
^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s155203701 | p00222 | u633068244 | 1399122604 | Python | Python | py | Runtime Error | 0 | 0 | 474 | def isP(n):
for i in prime:
if i >= n:
break
if n%i == 0:
return False
return True
r = int(10000001**0.5)
s = int(r**0.5)
p = [1]*r
p[0] = p[1] = 0
for i in range(2,s):
if p[i]:
p[2*i::i] = [0 for x in range(2*i,r,i)]
prime = []
for i in range(r):
if p[i]:
prime.append(i)
while 1:
n = input()
if n == 0: break
i = n-(1-n%2)
while i > 12:
if not isP(i-8) or not isP(i-2):
i -= 4
continue
if isP(i) and isP(i-6):
print i
break
i -= 2 | File "/tmp/tmp3r1mk93d/tmpnfi0bzvg.py", line 30
print i
^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s422217419 | p00222 | u633068244 | 1399122736 | Python | Python | py | Runtime Error | 0 | 0 | 520 | def isP(n):
for i in prime:
if i >= n:
break
if n%i == 0:
return False
return True
r = int(10000001**0.5)
s = int(r**0.5)
p = [1]*r
p[0] = p[1] = 0
for i in range(2,s):
if p[i]:
p[2*i::i] = [0 for x in range(2*i,r,i)]
prime = []
for i in range(r):
if p[i]:
prime.append(i)
while 1:
n = input()
if n == 0: break
i = n-(1-n%2)
while i > 12:
p6 = isP(i-6)
if not isP(i-8) or not isP(i-2):
if not p6:
i -= 10
else:
i -= 4
continue
if isP(i) and p6:
print i
break
i -= 2 | File "/tmp/tmpd9x4tk32/tmpv57vorwe.py", line 34
print i
^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s170234020 | p00222 | u633068244 | 1399123569 | Python | Python | py | Runtime Error | 0 | 0 | 534 | MAX = 10000000
def isP(n):
for i in prime:
if i >= n:
break
if n%i == 0:
return False
return True
r = int((MAX+1)**0.5)
s = int(r**0.5)
p = [1]*r
p[0] = p[1] = 0
for i in range(2,s):
if p[i]:
p[2*i::i] = [0 for x in range(2*i,r,i)]
prime = []
for i in range(r):
if p[i]:
prime.append(i)
while 1:
n = input()
if n == 0: break
i = n-(1-n%2)
while i > 12:
p6 = isP(i-6)
if not isP(i-8) or not isP(i-2):
if not p6:
i -= 10
else:
i -= 4
continue
if isP(i) and p6:
print i
break
i -= 2 | File "/tmp/tmpsr1aemu9/tmp86a31p2d.py", line 35
print i
^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.