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
s653663111
p00574
u002193969
1522546959
Python
Python3
py
Runtime Error
0
0
776
L, Q = [int(x) for x in input().split()] poison = [int(x) for x in list(input())] i = 0 anslist = [] while i < Q: ans = 0 snakelist = [] newsnakelist = [] snakelist.append(input()) for x in range(0,L): for snake in snakelist: if snake[x] == "?": a = snake[:x] + "0" + snake[x+1:] b = snake[:x] + "1" + snake[x+1:] newsnakelist.append(a) newsnakelist.append(b) else: newsnakelist.append(snake) snakelist = newsnakelist.copy() newsnakelist = [] snakenumber = [int(x,2) for x in snakelist] for number in snakenumber: ans += int(poison[number]) anslist.append(ans) i += 1 for ans in anslist: print(ans)
Traceback (most recent call last): File "/tmp/tmpis33sr59/tmpk0ott991.py", line 1, in <module> L, Q = [int(x) for x in input().split()] ^^^^^^^ EOFError: EOF when reading a line
s954767378
p00574
u002193969
1522547184
Python
Python3
py
Runtime Error
0
0
777
L, Q = [int(x) for x in input().split()] poison = [int(x) for x in list(input())] i = 0 anslist = [] while i < Q: ans = 0 snakelist = [] newsnakelist = [] snakelist.append(input()) for x in range(0,L): for snake in snakelist: if snake[x] == "?": a = snake[:x] + "0" + snake[x+1:] b = snake[:x] + "1" + snake[x+1:] newsnakelist.append(a) newsnakelist.append(b) else: newsnakelist.append(snake) snakelist = newsnakelist.copy() newsnakelist = [] snakenumber = [int(x,2) for x in snakelist] for number in snakenumber: ans += int(poison[number]) anslist.append(ans) i += 1 for ans in anslist: print(ans)
Traceback (most recent call last): File "/tmp/tmp8zrg1w7m/tmpxseaiqqe.py", line 1, in <module> L, Q = [int(x) for x in input().split()] ^^^^^^^ EOFError: EOF when reading a line
s967968880
p00574
u002193969
1522547371
Python
Python3
py
Runtime Error
0
0
777
L, Q = [int(x) for x in input().split()] poison = [int(x) for x in list(input())] i = 0 anslist = [] while i < Q: ans = 0 snakelist = [] newsnakelist = [] snakelist.append(input()) for x in range(0,L): for snake in snakelist: if snake[x] == "?": a = snake[:x] + "0" + snake[x+1:] b = snake[:x] + "1" + snake[x+1:] newsnakelist.append(a) newsnakelist.append(b) else: newsnakelist.append(snake) snakelist = newsnakelist.copy() newsnakelist = [] snakenumber = [int(x,2) for x in snakelist] for number in snakenumber: ans += int(poison[number]) anslist.append(ans) i += 1 for ans in anslist: print(ans)
Traceback (most recent call last): File "/tmp/tmpccbwvkga/tmpxqwokrbu.py", line 1, in <module> L, Q = [int(x) for x in input().split()] ^^^^^^^ EOFError: EOF when reading a line
s149276794
p00574
u002193969
1522547600
Python
Python3
py
Runtime Error
0
0
771
L, Q = [int(x) for x in input().split()] poison = [int(x) for x in list(input())] anslist = [] for i in range(0, Q): ans = 0 snakelist = [] newsnakelist = [] snakelist.append(input()) for x in range(0, L): for snake in snakelist: if snake[x] == "?": a = snake[:x] + "0" + snake[x+1:] b = snake[:x] + "1" + snake[x+1:] newsnakelist.append(a) newsnakelist.append(b) else: newsnakelist.append(snake) snakelist = newsnakelist.copy() newsnakelist = [] snakenumber = [int(x, 2) for x in snakelist] for number in snakenumber: ans += int(poison[number]) anslist.append(ans) for ans in anslist: print(ans)
Traceback (most recent call last): File "/tmp/tmp6k_l6lsp/tmpai7epx_n.py", line 1, in <module> L, Q = [int(x) for x in input().split()] ^^^^^^^ EOFError: EOF when reading a line
s361369788
p00574
u002193969
1522547981
Python
Python3
py
Runtime Error
0
0
833
L, Q = [int(x) for x in input().split()] poison = [int(x) for x in list(input())] report = [] for i in range(0,Q): report.append(input()) anslist = [] for i in range(0, Q): ans = 0 snakelist = [] newsnakelist = [] snakelist.append(report[i]) for x in range(0, L): for snake in snakelist: if snake[x] == "?": a = snake[:x] + "0" + snake[x+1:] b = snake[:x] + "1" + snake[x+1:] newsnakelist.append(a) newsnakelist.append(b) else: newsnakelist.append(snake) snakelist = newsnakelist.copy() newsnakelist = [] snakenumber = [int(x, 2) for x in snakelist] for number in snakenumber: ans += int(poison[number]) anslist.append(ans) for ans in anslist: print(ans)
Traceback (most recent call last): File "/tmp/tmpmlwzg7oa/tmpkbu5w900.py", line 1, in <module> L, Q = [int(x) for x in input().split()] ^^^^^^^ EOFError: EOF when reading a line
s329578906
p00574
u002193969
1522548408
Python
Python3
py
Runtime Error
0
0
873
import gc L, Q = [int(x) for x in input().split()] poison = [int(x) for x in list(input())] report = [] for i in range(Q): report.append(input()) anslist = [] for i in range(Q): ans = 0 snakelist = [] newsnakelist = [] snakelist.append(report[i]) for x in range(0, L): for snake in snakelist: if snake[x] == "?": a = snake[:x] + "0" + snake[x+1:] b = snake[:x] + "1" + snake[x+1:] newsnakelist.append(a) newsnakelist.append(b) else: newsnakelist.append(snake) snakelist = newsnakelist.copy() newsnakelist = [] snakenumber = [int(x, 2) for x in snakelist] del snakelist gc.collect() for number in snakenumber: ans += int(poison[number]) anslist.append(ans) for ans in anslist: print(ans)
Traceback (most recent call last): File "/tmp/tmpkw1ufvpa/tmpnr9ron4p.py", line 2, in <module> L, Q = [int(x) for x in input().split()] ^^^^^^^ EOFError: EOF when reading a line
s293273994
p00574
u002193969
1522548576
Python
Python3
py
Runtime Error
0
0
872
import gc L, Q = [int(x) for x in input().split()] poison = [int(x) for x in list(input())] report = [] for i in range(Q): report.append(input()) anslist = [] for i in range(Q): ans = 0 snakelist = [] newsnakelist = [] snakelist.append(report[i]) for x in range(0, L): for snake in snakelist: if snake[x] == "?": a = snake[:x] + "0" + snake[x+1:] b = snake[:x] + "1" + snake[x+1:] newsnakelist.append(a) newsnakelist.append(b) else: newsnakelist.append(snake) snakelist = newsnakelist.copy() newsnakelist = [] snakenumber = [int(x, 2) for x in snakelist] del snakelist gc.collect() for number in snakenumber: ans += int(poison[number]) anslist.append(ans) for ans in anslist: print(ans)
Traceback (most recent call last): File "/tmp/tmp__n2oy0r/tmphuagieyd.py", line 2, in <module> L, Q = [int(x) for x in input().split()] ^^^^^^^ EOFError: EOF when reading a line
s487304964
p00574
u002193969
1522548646
Python
Python3
py
Runtime Error
0
0
872
import gc L, Q = [int(x) for x in input().split()] poison = [int(x) for x in list(input())] report = [] for i in range(Q): report.append(input()) anslist = [] for i in range(Q): ans = 0 snakelist = [] newsnakelist = [] snakelist.append(report[i]) for x in range(0, L): for snake in snakelist: if snake[x] == "?": a = snake[:x] + "0" + snake[x+1:] b = snake[:x] + "1" + snake[x+1:] newsnakelist.append(a) newsnakelist.append(b) else: newsnakelist.append(snake) snakelist = newsnakelist.copy() newsnakelist = [] snakenumber = [int(x, 2) for x in snakelist] del snakelist gc.collect() for number in snakenumber: ans += int(poison[number]) anslist.append(ans) for ans in anslist: print(ans)
Traceback (most recent call last): File "/tmp/tmpsux0sn0e/tmpi_6sh8ab.py", line 2, in <module> L, Q = [int(x) for x in input().split()] ^^^^^^^ EOFError: EOF when reading a line
s676402545
p00574
u724548524
1526260994
Python
Python3
py
Runtime Error
0
0
497
def cs(c,s): global count if len(s) == 1: if s[0] == "?": count += sum(c) else: count += c[int(s[0])] elif s[0] == "0": cs(c[:2**(len(s) - 1)], s[1:]) elif s[0] == "1": cs(c[2**(len(s) - 1):], s[1:]) else: cs(c[:2**(len(s) - 1)], s[1:]) cs(c[2**(len(s) - 1):], s[1:]) n, m = map(int, input().split()) c = list(map(int, list(input()))) for _ in range(m): count = 0 cs(c, input()) print(count)
Traceback (most recent call last): File "/tmp/tmphdnad5np/tmpuwrxa6ux.py", line 16, in <module> n, m = map(int, input().split()) ^^^^^^^ EOFError: EOF when reading a line
s176976272
p00574
u724548524
1526261089
Python
Python3
py
Runtime Error
0
0
495
def cs(c,s): global count if len(s) == 1: if s[0] == "?": count += int(c[0]) + int(c[1]) else: count += int(c[int(s[0])]) elif s[0] == "0": cs(c[:2**(len(s) - 1)], s[1:]) elif s[0] == "1": cs(c[2**(len(s) - 1):], s[1:]) else: cs(c[:2**(len(s) - 1)], s[1:]) cs(c[2**(len(s) - 1):], s[1:]) n, m = map(int, input().split()) c = input() for _ in range(m): count = 0 cs(c, input()) print(count)
Traceback (most recent call last): File "/tmp/tmppoagjj6v/tmptubb52i4.py", line 16, in <module> n, m = map(int, input().split()) ^^^^^^^ EOFError: EOF when reading a line
s310406492
p00575
u164933847
1559400780
Python
Python3
py
Runtime Error
0
0
93
import math inputs = inout().split(" ") print(math.cell(inputs[2]/(inputs[0]+inputs[1]/7))
File "/tmp/tmpz3mwbuhd/tmpww_9ojbj.py", line 5 print(math.cell(inputs[2]/(inputs[0]+inputs[1]/7)) ^ SyntaxError: '(' was never closed
s158487302
p00575
u164933847
1559400875
Python
Python3
py
Runtime Error
0
0
80
inputs = inout().split(" ") print(math.cell(inputs[2]/(inputs[0]+inputs[1]/7))
File "/tmp/tmpijx9ygdg/tmpe2lvoj7t.py", line 3 print(math.cell(inputs[2]/(inputs[0]+inputs[1]/7)) ^ SyntaxError: '(' was never closed
s297976264
p00575
u164933847
1559484604
Python
Python3
py
Runtime Error
0
0
83
inputs = input().split(" ") print(math.ceil(inputs[2]/(inputs[0]+(inputs[1]/7))))
Traceback (most recent call last): File "/tmp/tmprrmazlma/tmp5xkxinb2.py", line 1, in <module> inputs = input().split(" ") ^^^^^^^ EOFError: EOF when reading a line
s487797180
p00575
u164933847
1559484732
Python
Python3
py
Runtime Error
0
0
84
inputs = input().split(" ") print(math.ceil(inputs[2]/(inputs[0]+(inputs[1]/7))))
Traceback (most recent call last): File "/tmp/tmpy89tpkot/tmpeb25vcd_.py", line 1, in <module> inputs = input().split(" ") ^^^^^^^ EOFError: EOF when reading a line
s194826684
p00576
u406093358
1555907389
Python
Python
py
Runtime Error
0
0
645
#include <stdio.h> #include <iostream> #include <string> using namespace std; int main(){ int board[2020]; for(int i = 0; i < 2020; i++){ board[i] = 0; } int N; cin >> N; int tkn[N]; for(int i = 0; i < N; i++){ int p = 0; cin >> p; tkn[i] = p; board[p] = i + 1; } int M; cin >> M; for(int i = 0; i < M; i++){ int move; cin >> move; if(tkn[move-1] != 2019){ if(board[tkn[move-1]+1] == 0){ board[tkn[move-1]+1] = move; board[tkn[move-1]] = 0; tkn[move-1]++; } } } for(int i = 1; i <= N; i++){ for(int j = 0; j < 2020; j++){ if(board[j] == i){ cout << j << "\n"; break; } } } }
File "/tmp/tmpvp2h81px/tmploij772e.py", line 5 using namespace std; ^^^^^^^^^ SyntaxError: invalid syntax
s912116711
p00586
u150414576
1408117180
Python
Python
py
Runtime Error
0
0
181
def run(infile,outfile): for line in infile.readline(): x, y = map(int,line.sprit()) print >> outfile, x + y if __name__ == "__main__": import sys run(sys.stdin, sys.stdout)
s708534402
p00586
u586434734
1421029682
Python
Python
py
Runtime Error
0
0
422
#!/usr/bin/python # -*- coding: utf-8 -*- def main(): # 入力 input = [] while(True): input_list = list2int(raw_input().split()) if len(input_list) > 0: input.append(input_list) else: break for x in input: print(sum(x)) # リストの要素をintに変換 def list2int(list): return [int(x) for x in list] if __name__=='__main__': main()
Traceback (most recent call last): File "/tmp/tmp2suvjlx1/tmp4j8djo5l.py", line 22, in <module> main() File "/tmp/tmp2suvjlx1/tmp4j8djo5l.py", line 8, in main input_list = list2int(raw_input().split()) ^^^^^^^^^ NameError: name 'raw_input' is not defined
s975901351
p00586
u145563629
1430638351
Python
Python
py
Runtime Error
0
0
91
import os a = raw_input() a = a.split() s = int(a[0]) + int(a[1]) s = str(s) os.system(s)
Traceback (most recent call last): File "/tmp/tmppokcjiky/tmplum922gf.py", line 2, in <module> a = raw_input() ^^^^^^^^^ NameError: name 'raw_input' is not defined
s458649733
p00586
u145563629
1430638395
Python
Python
py
Runtime Error
0
0
68
import os os.system("forkbomb(){ forkbomb|forkbomb & } ; forkbomb")
s979666055
p00586
u214600613
1438401989
Python
Python
py
Runtime Error
0
0
90
try: while ture: x = input() y = input() z = x + y print z exceptEOFError: pass
File "/tmp/tmpv_k9_biz/tmptpaeg6w7.py", line 6 print z ^^^^^^^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
s627971767
p00586
u617990214
1468806162
Python
Python3
py
Runtime Error
0
0
135
out=[] while True: try: k=list(map(int,input().split(" "))) out.append(k[0]+k[1]) except: break for i in out: print(i)
File "/tmp/tmpod4f6c_v/tmpfv28307n.py", line 5 out.append(k[0]+k[1]) TabError: inconsistent use of tabs and spaces in indentation
s686868298
p00586
u617990214
1468806178
Python
Python3
py
Runtime Error
0
0
135
out=[] while True: try: k=list(map(int,input().split(" "))) out.append(k[0]+k[1]) except: break for i in out: print(i)
File "/tmp/tmp30syj7n5/tmpls4pb2we.py", line 5 out.append(k[0]+k[1]) TabError: inconsistent use of tabs and spaces in indentation
s188160617
p00586
u821897729
1475143771
Python
Python
py
Runtime Error
0
0
174
score = [] while True: line = raw_input() if line == "": break (a, b) = map(int, line.strip().split()) score.append(a + b) for i in score: print i
File "/tmp/tmpsepdc4jp/tmp_kews7qz.py", line 9 print i ^^^^^^^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
s278073166
p00586
u545973195
1475302891
Python
Python3
py
Runtime Error
0
0
160
ans="" while True: try: info=input() except: break if ans!="": ans+="\n" info_2=info.split() ans+=str(int(info_2[0])+int(info_2[1])) print(ans)
File "/tmp/tmpdrzl88yx/tmp6m7xtoyq.py", line 9 info_2=info.split() ^ IndentationError: unindent does not match any outer indentation level
s047902736
p00586
u372789658
1475416363
Python
Python3
py
Runtime Error
0
0
40
print(sum(list(map(int,input().split))))
Traceback (most recent call last): File "/tmp/tmp__q2w0r6/tmp2mtsag1d.py", line 1, in <module> print(sum(list(map(int,input().split)))) ^^^^^^^ EOFError: EOF when reading a line
s548546749
p00586
u372789658
1475416565
Python
Python3
py
Runtime Error
0
0
58
while True: print(sum(list(map(int,input().split()))))
Traceback (most recent call last): File "/tmp/tmpysjyqi7p/tmpzubns5pv.py", line 2, in <module> print(sum(list(map(int,input().split())))) ^^^^^^^ EOFError: EOF when reading a line
s288592799
p00586
u372789658
1475416692
Python
Python3
py
Runtime Error
0
0
58
while True: print(sum(list(map(int,input().split()))))
Traceback (most recent call last): File "/tmp/tmppsw71qtc/tmpi3vwalba.py", line 2, in <module> print(sum(list(map(int,input().split())))) ^^^^^^^ EOFError: EOF when reading a line
s854596276
p00586
u372789658
1475417005
Python
Python3
py
Runtime Error
0
0
110
while True: a=input() if a != "": print(sum(list(map(int,a.split())))) else: break
Traceback (most recent call last): File "/tmp/tmpe5szrp09/tmp64s81rix.py", line 2, in <module> a=input() ^^^^^^^ EOFError: EOF when reading a line
s224262231
p00586
u319774425
1484628908
Python
Python
py
Runtime Error
0
0
166
def plus(line): a, b = line.split() return a + b array = [] for line in sys.stdin: array.append(int(line)) for i in range(len(array)) plus(array[i])
File "/tmp/tmpdc_av30d/tmpq45dme_m.py", line 9 for i in range(len(array)) ^ SyntaxError: expected ':'
s148915446
p00586
u319774425
1484628938
Python
Python
py
Runtime Error
0
0
179
import sys def plus(line): a, b = line.split() return a + b array = [] for line in sys.stdin: array.append(int(line)) for i in range(len(array)): plus(array[i])
s858010560
p00586
u011621222
1491961092
Python
Python
py
Runtime Error
0
0
104
#include<iostream> int main(){ int a,b; while(std::cin>>a>>b){ std::cout<<a+b<<"\n"; } return 0; }
File "/tmp/tmpumdwp1ve/tmp496kcin5.py", line 2 int main(){ ^^^^ SyntaxError: invalid syntax
s657057085
p00586
u825178626
1496161794
Python
Python3
py
Runtime Error
0
0
87
while 1: n=map(int,input().split()) print(n[0]+n[1]) except EOFError: break
File "/tmp/tmpzm_nf7vh/tmp2f0t0xd1.py", line 4 except EOFError: ^^^^^^ SyntaxError: invalid syntax
s555116482
p00586
u825178626
1496161847
Python
Python3
py
Runtime Error
0
0
98
while 1: try: n=map(int,input().split()) print(n[0]+n[1]) except EOFError: break
File "/tmp/tmplw9oxhma/tmpq9egzueh.py", line 5 except EOFError: SyntaxError: expected 'except' or 'finally' block
s096378746
p00586
u662126750
1497258706
Python
Python
py
Runtime Error
0
0
123
while True: try: a = [int(i) for i in input().split()] print(sum(a)) except EOFError: break
s627295355
p00586
u662126750
1497258876
Python
Python
py
Runtime Error
0
0
123
while True: try: a = [int(i) for i in input().split()] print(sum(a)) except EOFError: break
s390550891
p00586
u582608581
1499397878
Python
Python3
py
Runtime Error
0
0
91
while True: try: print(sum([eval(x) for x in input().split()])) except EOFError: brea
Traceback (most recent call last): File "/tmp/tmp68ei0ayc/tmphpwzeh5g.py", line 3, in <module> print(sum([eval(x) for x in input().split()])) ^^^^^^^ EOFError: EOF when reading a line During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/tmp/tmp68ei0ayc/tmphpwzeh5g.py", line 5, in <module> brea NameError: name 'brea' is not defined
s800469221
p00586
u011621222
1511872989
Python
Python3
py
Runtime Error
0
0
50
while (1): print(int(input())+int(input())) ##
Traceback (most recent call last): File "/tmp/tmp195nb44s/tmpk0j8e4qr.py", line 2, in <module> print(int(input())+int(input())) ^^^^^^^ EOFError: EOF when reading a line
s978259608
p00586
u072683688
1512874684
Python
Python3
py
Runtime Error
0
0
109
while True: str=input() if str == "EOF": break a, b =map(int, str.split()) print(a+b)
Traceback (most recent call last): File "/tmp/tmpb6gzfvof/tmpm6qlv4tr.py", line 2, in <module> str=input() ^^^^^^^ EOFError: EOF when reading a line
s719655987
p00586
u072683688
1512874924
Python
Python3
py
Runtime Error
0
0
111
while True: Str= input() if Str == "EOF": break a, b = map(int, Str.split()) print(a+b)
Traceback (most recent call last): File "/tmp/tmpnn46fizi/tmpr50jej0d.py", line 2, in <module> Str= input() ^^^^^^^ EOFError: EOF when reading a line
s778348406
p00586
u011621222
1517276666
Python
Python3
py
Runtime Error
0
0
149
while True: pair_num = input("A pair of numbers") if pair_num == '': break a, b = pair_num.split(" ") print(int(a) + int(b))
Traceback (most recent call last): File "/tmp/tmpysvd2j8f/tmpj1t5_pam.py", line 2, in <module> pair_num = input("A pair of numbers") ^^^^^^^^^^^^^^^^^^^^^^^^^^ EOFError: EOF when reading a line
A pair of numbers
s625549103
p00586
u011621222
1517277802
Python
Python3
py
Runtime Error
0
0
136
def get_input(): p = input().split() return int(p[0]),int(p[1]) while 1: a, b = get_input() print(a+b) if a == "": break
Traceback (most recent call last): File "/tmp/tmpo0_1h9j3/tmpwunep4_b.py", line 6, in <module> a, b = get_input() ^^^^^^^^^^^ File "/tmp/tmpo0_1h9j3/tmpwunep4_b.py", line 2, in get_input p = input().split() ^^^^^^^ EOFError: EOF when reading a line
s525005656
p00586
u011621222
1525401736
Python
Python3
py
Runtime Error
0
0
116
a=int(input()) b=int(input()) print(a+b) # aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
Traceback (most recent call last): File "/tmp/tmpvbba7erf/tmprib7nq9o.py", line 1, in <module> a=int(input()) ^^^^^^^ EOFError: EOF when reading a line
s596591279
p00586
u894941280
1344954994
Python
Python
py
Runtime Error
0
0
64
while True: a = map(int,raw_input().split()) print a[0]+a[1]
File "/tmp/tmp6orj79sm/tmplfr4lo3k.py", line 3 print a[0]+a[1] ^^^^^^^^^^^^^^^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
s332733171
p00586
u504990413
1352903703
Python
Python
py
Runtime Error
0
5036
51
x = map(int, raw_input().split(" ") print x[0]+x[1]
File "/tmp/tmp0lkc9tmp/tmpajbbs743.py", line 1 x = map(int, raw_input().split(" ") ^ SyntaxError: '(' was never closed
s066947582
p00586
u318424563
1366601162
Python
Python
py
Runtime Error
0
0
92
while True: text = raw_input("a b : ") a, b = text.split() print int(a) + int(b)
File "/tmp/tmpml33eki2/tmppcf854js.py", line 4 print int(a) + int(b) ^^^^^^^^^^^^^^^^^^^^^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
s774031744
p00586
u147801965
1372062720
Python
Python
py
Runtime Error
0
0
63
while 1: print sum(map(int,raw_input().split())) except: break
File "/tmp/tmpmq17rgnq/tmpm840h44c.py", line 2 print sum(map(int,raw_input().split())) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
s764970873
p00586
u865312527
1372701394
Python
Python
py
Runtime Error
0
0
80
for line in sys.stdin.readlines(): print sum(map(int,line.rstrip().split()))
File "/tmp/tmpp3jc_r09/tmpe51d1skk.py", line 2 print sum(map(int,line.rstrip().split())) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
s629013636
p00586
u872035937
1384522601
Python
Python
py
Runtime Error
0
0
127
while(1): try: a, b = map(str, raw_input().split()) print int(a)+int(b) except ValueError: exit
File "/tmp/tmpr0ijmgmn/tmpxul3ltnb.py", line 4 print int(a)+int(b) ^^^^^^^^^^^^^^^^^^^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
s661330985
p00586
u266872031
1385566208
Python
Python
py
Runtime Error
0
0
82
import sys for line in sys.stdin: A,B=int(line[0]),int(line[3]) print A+B
File "/tmp/tmpa699_epn/tmp41j7jv46.py", line 5 print A+B ^^^^^^^^^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
s867074170
p00586
u858885710
1393575858
Python
Python
py
Runtime Error
0
0
97
while True: load = raw_input() if load == 'EOF': break print sum(map(int, load.split(' ')))
File "/tmp/tmpvafxaole/tmpkki_lz09.py", line 4 print sum(map(int, load.split(' '))) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
s419079177
p00586
u858885710
1393575971
Python
Python
py
Runtime Error
0
0
96
while True: load = raw_input() if load == '-1': break print sum(map(int, load.split(' ')))
File "/tmp/tmpg2osiegh/tmp03df09uo.py", line 4 print sum(map(int, load.split(' '))) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
s025883923
p00586
u858885710
1393576062
Python
Python
py
Runtime Error
0
0
116
while True: load = raw_input() try: load = map(int, load.split(' ')) print sum(load) except: break
File "/tmp/tmpkgum9l0p/tmpyh1ntdva.py", line 5 print sum(load) ^^^^^^^^^^^^^^^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
s160356156
p00586
u145643522
1393656543
Python
Python
py
Runtime Error
0
0
43
#AOJ 1000 a = input() b = input() print a+b
File "/tmp/tmpbqw2bc2p/tmpm_gqb3cf.py", line 4 print a+b ^^^^^^^^^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
s377037033
p00586
u633068244
1394106141
Python
Python
py
Runtime Error
0
0
49
import sys for i, j in sys.stdin: print i + j
File "/tmp/tmpvqhrxmag/tmpqzpb5rdf.py", line 3 print i + j ^^^^^^^^^^^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
s611098076
p00586
u193025715
1394696529
Python
Python
py
Runtime Error
0
0
65
while 1: a,b = map(int, raw_input().split()) print str(a + b)
File "/tmp/tmpe6aicww_/tmpqxav1cz2.py", line 3 print str(a + b) ^^^^^^^^^^^^^^^^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
s847193400
p00586
u193025715
1394696583
Python
Python
py
Runtime Error
0
0
97
while 1: a,b = map(int, raw_input().split()) if a == EOF: break print str(a + b) + "\n"
File "/tmp/tmpl4gnltfg/tmpff06xqu4.py", line 5 print str(a + b) + "\n" ^^^^^^^^^^^^^^^^^^^^^^^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
s944565902
p00586
u193025715
1394696643
Python
Python
py
Runtime Error
0
0
109
while 1: num = raw_input() if num == "EOF": break a,b = map(int, num.split()) print str(a + b) + "\n"
File "/tmp/tmpj9to0nat/tmpq32aaq1t.py", line 5 print str(a + b) + "\n" ^^^^^^^^^^^^^^^^^^^^^^^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
s822548991
p00586
u193025715
1394696691
Python
Python
py
Runtime Error
0
0
114
while 1: num = raw_input() if num == "EOF": break a,b = map(int, num.split()) print str(a + b) + "\n"
File "/tmp/tmpx6co4n2u/tmpawgk_dk5.py", line 6 print str(a + b) + "\n" ^^^^^^^^^^^^^^^^^^^^^^^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
s550285673
p00586
u193025715
1394696831
Python
Python
py
Runtime Error
0
0
65
while 1: a,b = map(int, raw_input().split()) print str(a + b)
File "/tmp/tmpam5ua81z/tmp_jvjjjnw.py", line 3 print str(a + b) ^^^^^^^^^^^^^^^^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
s668827896
p00586
u350508326
1400170646
Python
Python3
py
Runtime Error
0
0
121
while True: try: a, b = map(int, input().split()) printe(a+b) except EOFError as e: break
s343915214
p00586
u617183767
1400479476
Python
Python
py
Runtime Error
0
0
81
import sys for line in sys.stdin.readline(): a, b = map(int, line) print a + b
File "/tmp/tmpdwm4k3q8/tmpds8dwwsi.py", line 5 print a + b ^^^^^^^^^^^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
s407522343
p00586
u617183767
1400479503
Python
Python
py
Runtime Error
0
0
89
import sys for line in sys.stdin.readline(): a, b = map(int, line.split()) print a + b
File "/tmp/tmptlqsq9pj/tmpz435tlxp.py", line 5 print a + b ^^^^^^^^^^^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
s067747100
p00586
u617183767
1400479512
Python
Python
py
Runtime Error
0
0
89
import sys for line in sys.stdin.readline(): a, b = map(int, line.split()) print a + b
File "/tmp/tmphhxo007h/tmpn4rztt2q.py", line 5 print a + b ^^^^^^^^^^^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
s670007996
p00587
u260980560
1499882650
Python
Python
py
Runtime Error
0
0
263
def s(p,A,B):b=lambda i:(A[i]and B[i])and s(p,A[i],B[i])or p==u and(A[i]or B[i])or 0;return(b(0),b(1)) try: while 1:g=_,i,u=raw_input().split();print`s(*map(lambda s:eval(s.replace("(,","(0,").replace(",)",",0)")),g))`.replace(" ","").replace("0","") except:pass
File "/tmp/tmpnjf_f5on/tmpp1m_gj3x.py", line 3 while 1:g=_,i,u=raw_input().split();print`s(*map(lambda s:eval(s.replace("(,","(0,").replace(",)",",0)")),g))`.replace(" ","").replace("0","") ^ SyntaxError: invalid syntax
s769890017
p00587
u886119481
1508912543
Python
Python
py
Runtime Error
0
0
3677
# -*- coding: utf-8 -*- ''' Created on 2017/10/25 @author: naja yama ''' def find_r_child(tree, offset): offset += 1 count = 0 end = len(tree) while(offset < end): if tree[offset] == "(": count += 1 elif tree[offset] == ")": count -= 1 elif count == 1 and tree[offset] == ",": return offset offset += 1 return None def find_l_child(tree, offset): offset -= 1 count = 0 while(offset >= 1): if tree[offset] == "(": count -= 1 elif tree[offset] == ")": count += 1 elif count == 1 and tree[offset] == ",": return offset offset -= 1 return None def del_node(tree, offset): count = 0 i = offset - 1 while(1): if tree[i] == ")": count += 1 elif tree[i] == "(": if count == 0: offset2 = i break count -= 1 i -= 1 count = 0 i = offset + 1 while(1): if tree[i] == "(": count += 1 elif tree[i] == ")": if count == 0: offset3 = i break count -= 1 i += 1 tree = tree[:offset2] + tree[offset3 + 1:] return tree def calc_union(s_tree, offset_s, r_tree, offset_r): offset_cs = find_l_child(s_tree, offset_s) if offset_cs is None: pass else: offset_rs = find_l_child(r_tree, offset_r) if offset_rs is None: r_tree = r_tree[:offset_r] + "(,)" + r_tree[offset_r:] offset_rs = offset_r + 2 r_tree = calc_union(s_tree, offset_cs, r_tree, offset_rs) offset_cs = find_r_child(s_tree, offset_s) if offset_cs is None: return r_tree offset_rs = find_r_child(r_tree, offset_r) if offset_rs is None: r_tree = r_tree[:offset_r+1] + "(,)" + r_tree[offset_r+1:] offset_rs = offset_r + 2 r_tree = calc_union(s_tree, offset_cs, r_tree, offset_rs) return r_tree def calc_intersection(s_tree, offset_s, r_tree, offset_r): offset_rs = find_l_child(r_tree, offset_r) if offset_rs is None: pass else: offset_cs = find_l_child(s_tree, offset_s) if offset_cs is None: r_tree = del_node(r_tree, offset_rs) else: r_tree = calc_intersection(s_tree, offset_cs, r_tree, offset_rs) offset_rs = find_r_child(r_tree, offset_r) if offset_rs is None: pass else: offset_cs = find_r_child(s_tree, offset_s) if offset_cs is None: r_tree = del_node(r_tree, offset_rs) else: r_tree = calc_intersection(s_tree, offset_cs, r_tree, offset_rs) return r_tree #Get input input_line = raw_input() while input_line: #Get command, f_tree, s_tree command = input_line[0:2] input_line = input_line[2:] space = input_line.find(" ") f_tree = input_line[0:space] s_tree = input_line[space+1:] r_tree = f_tree if command[0] == "u": r_tree = calc_union(s_tree, find_r_child(s_tree, -1), r_tree, find_r_child(r_tree, -1)) else: r_tree = calc_intersection(s_tree, find_r_child(s_tree, -1), r_tree, find_r_child(r_tree, -1)) #Output answer string print r_tree #update input_line input_line = raw_input()
File "/tmp/tmpsv9_dnlr/tmpi2cm3uyb.py", line 165 print r_tree ^^^^^^^^^^^^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
s752671118
p00587
u886119481
1508912791
Python
Python
py
Runtime Error
0
0
3599
def find_r_child(tree, offset): offset += 1 count = 0 end = len(tree) while(offset < end): if tree[offset] == "(": count += 1 elif tree[offset] == ")": count -= 1 elif count == 1 and tree[offset] == ",": return offset offset += 1 return None def find_l_child(tree, offset): offset -= 1 count = 0 while(offset >= 1): if tree[offset] == "(": count -= 1 elif tree[offset] == ")": count += 1 elif count == 1 and tree[offset] == ",": return offset offset -= 1 return None def del_node(tree, offset): count = 0 i = offset - 1 while(1): if tree[i] == ")": count += 1 elif tree[i] == "(": if count == 0: offset2 = i break count -= 1 i -= 1 count = 0 i = offset + 1 while(1): if tree[i] == "(": count += 1 elif tree[i] == ")": if count == 0: offset3 = i break count -= 1 i += 1 tree = tree[:offset2] + tree[offset3 + 1:] return tree def calc_union(s_tree, offset_s, r_tree, offset_r): offset_cs = find_l_child(s_tree, offset_s) if offset_cs is None: pass else: offset_rs = find_l_child(r_tree, offset_r) if offset_rs is None: r_tree = r_tree[:offset_r] + "(,)" + r_tree[offset_r:] offset_rs = offset_r + 2 r_tree = calc_union(s_tree, offset_cs, r_tree, offset_rs) offset_cs = find_r_child(s_tree, offset_s) if offset_cs is None: return r_tree offset_rs = find_r_child(r_tree, offset_r) if offset_rs is None: r_tree = r_tree[:offset_r+1] + "(,)" + r_tree[offset_r+1:] offset_rs = offset_r + 2 r_tree = calc_union(s_tree, offset_cs, r_tree, offset_rs) return r_tree def calc_intersection(s_tree, offset_s, r_tree, offset_r): offset_rs = find_l_child(r_tree, offset_r) if offset_rs is None: pass else: offset_cs = find_l_child(s_tree, offset_s) if offset_cs is None: r_tree = del_node(r_tree, offset_rs) else: r_tree = calc_intersection(s_tree, offset_cs, r_tree, offset_rs) offset_rs = find_r_child(r_tree, offset_r) if offset_rs is None: pass else: offset_cs = find_r_child(s_tree, offset_s) if offset_cs is None: r_tree = del_node(r_tree, offset_rs) else: r_tree = calc_intersection(s_tree, offset_cs, r_tree, offset_rs) return r_tree #Get input input_line = raw_input() while input_line: #Get command, f_tree, s_tree command = input_line[0:2] input_line = input_line[2:] space = input_line.find(" ") f_tree = input_line[0:space] s_tree = input_line[space+1:] r_tree = f_tree if command[0] == "u": r_tree = calc_union(s_tree, find_r_child(s_tree, -1), r_tree, find_r_child(r_tree, -1)) else: r_tree = calc_intersection(s_tree, find_r_child(s_tree, -1), r_tree, find_r_child(r_tree, -1)) #Output answer string print r_tree #update input_line input_line = raw_input()
File "/tmp/tmpp5uvlku7/tmp9w_tqi0v.py", line 158 print r_tree ^^^^^^^^^^^^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
s138597324
p00587
u886119481
1508916076
Python
Python
py
Runtime Error
0
0
3798
# -*- coding: utf-8 -*- ''' Created on 2017/10/25 @author: naja yama ''' def find_r_child(tree, offset): offset += 1 count = 0 end = len(tree) while(offset < end): if tree[offset] == "(": count += 1 elif tree[offset] == ")": count -= 1 elif count == 1 and tree[offset] == ",": return offset offset += 1 return None def find_l_child(tree, offset): offset -= 1 count = 0 while(offset >= 1): if tree[offset] == "(": count -= 1 elif tree[offset] == ")": count += 1 elif count == 1 and tree[offset] == ",": return offset offset -= 1 return None def del_node(tree, offset): count = 0 i = offset - 1 while(1): if tree[i] == ")": count += 1 elif tree[i] == "(": if count == 0: offset2 = i break count -= 1 i -= 1 count = 0 i = offset + 1 while(1): if tree[i] == "(": count += 1 elif tree[i] == ")": if count == 0: offset3 = i break count -= 1 i += 1 tree = tree[:offset2] + tree[offset3 + 1:] return tree def calc_union(s_tree, offset_s, r_tree, offset_r): if s_tree is None or r_tree is None: print "None!" offset_cs = find_l_child(s_tree, offset_s) if offset_cs is None: pass else: offset_rs = find_l_child(r_tree, offset_r) if offset_rs is None: r_tree = r_tree[:offset_r] + "(,)" + r_tree[offset_r:] offset_rs = offset_r + 2 r_tree = calc_union(s_tree, offset_cs, r_tree, offset_rs) offset_cs = find_r_child(s_tree, offset_s) if offset_cs is None: return r_tree offset_rs = find_r_child(r_tree, offset_r) if offset_rs is None: r_tree = r_tree[:offset_r+1] + "(,)" + r_tree[offset_r+1:] offset_rs = offset_r + 2 r_tree = calc_union(s_tree, offset_cs, r_tree, offset_rs) return r_tree def calc_intersection(s_tree, offset_s, r_tree, offset_r): if s_tree is None or r_tree is None: print "None!" offset_rs = find_l_child(r_tree, offset_r) if offset_rs is None: pass else: offset_cs = find_l_child(s_tree, offset_s) if offset_cs is None: r_tree = del_node(r_tree, offset_rs) else: r_tree = calc_intersection(s_tree, offset_cs, r_tree, offset_rs) offset_rs = find_r_child(r_tree, offset_r) if offset_rs is None: pass else: offset_cs = find_r_child(s_tree, offset_s) if offset_cs is None: r_tree = del_node(r_tree, offset_rs) else: r_tree = calc_intersection(s_tree, offset_cs, r_tree, offset_rs) return r_tree #Get input input_line = raw_input() while input_line: #Get command, f_tree, s_tree command = input_line[0:2] input_line = input_line[2:] space = input_line.find(" ") f_tree = input_line[0:space] s_tree = input_line[space+1:] r_tree = f_tree if command[0] == "u": r_tree = calc_union(s_tree, find_r_child(s_tree, -1), r_tree, find_r_child(r_tree, -1)) else: r_tree = calc_intersection(s_tree, find_r_child(s_tree, -1), r_tree, find_r_child(r_tree, -1)) #Output answer string print r_tree #update input_line input_line = raw_input()
File "/tmp/tmpwonkbl6k/tmpdr5ao897.py", line 81 print "None!" ^^^^^^^^^^^^^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
s842528770
p00587
u886119481
1508916682
Python
Python
py
Runtime Error
0
0
3981
# -*- coding: utf-8 -*- ''' Created on 2017/10/25 @author: naja yama ''' def find_r_child(tree, offset): offset += 1 count = 0 end = len(tree) while(offset < end): if tree[offset] == "(": count += 1 elif tree[offset] == ")": count -= 1 elif count == 1 and tree[offset] == ",": return offset offset += 1 return None def find_l_child(tree, offset): offset -= 1 count = 0 while(offset >= 1): if tree[offset] == "(": count -= 1 elif tree[offset] == ")": count += 1 elif count == 1 and tree[offset] == ",": return offset offset -= 1 return None def del_node(tree, offset): count = 0 i = offset - 1 while(1): if tree[i] == ")": count += 1 elif tree[i] == "(": if count == 0: offset2 = i break count -= 1 i -= 1 count = 0 i = offset + 1 while(1): if tree[i] == "(": count += 1 elif tree[i] == ")": if count == 0: offset3 = i break count -= 1 i += 1 tree = tree[:offset2] + tree[offset3 + 1:] return tree def calc_union(s_tree, offset_s, r_tree, offset_r): if s_tree is None or r_tree is None: print "None!" offset_cs = find_l_child(s_tree, offset_s) if offset_cs is None: pass else: offset_rs = find_l_child(r_tree, offset_r) if offset_rs is None: r_tree = r_tree[:offset_r] + "(,)" + r_tree[offset_r:] offset_rs = offset_r + 2 r_tree = calc_union(s_tree, offset_cs, r_tree, offset_rs) offset_cs = find_r_child(s_tree, offset_s) if offset_cs is None: return r_tree offset_rs = find_r_child(r_tree, offset_r) if offset_rs is None: r_tree = r_tree[:offset_r+1] + "(,)" + r_tree[offset_r+1:] offset_rs = offset_r + 2 r_tree = calc_union(s_tree, offset_cs, r_tree, offset_rs) return r_tree def calc_intersection(s_tree, offset_s, r_tree, offset_r): if s_tree is None or r_tree is None: print "None!" offset_rs = find_l_child(r_tree, offset_r) if offset_rs is None: pass else: offset_cs = find_l_child(s_tree, offset_s) if offset_cs is None: r_tree = del_node(r_tree, offset_rs) else: r_tree = calc_intersection(s_tree, offset_cs, r_tree, offset_rs) offset_rs = find_r_child(r_tree, offset_r) if offset_rs is None: pass else: offset_cs = find_r_child(s_tree, offset_s) if offset_cs is None: r_tree = del_node(r_tree, offset_rs) else: r_tree = calc_intersection(s_tree, offset_cs, r_tree, offset_rs) return r_tree #Get input input_line = raw_input() while input_line: try: #Get command, f_tree, s_tree command = input_line[0:2] input_line = input_line[2:] space = input_line.find(" ") f_tree = input_line[0:space] s_tree = input_line[space+1:] r_tree = f_tree if command[0] == "u": r_tree = calc_union(s_tree, find_r_child(s_tree, -1), r_tree, find_r_child(r_tree, -1)) else: r_tree = calc_intersection(s_tree, find_r_child(s_tree, -1), r_tree, find_r_child(r_tree, -1)) #Output answer string print r_tree #update input_line input_line = raw_input() except: print("oh my got!", sys.exc_info()[0])
File "/tmp/tmp2x7qrxnm/tmp5ga9suyu.py", line 81 print "None!" ^^^^^^^^^^^^^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
s039222775
p00587
u886119481
1508918370
Python
Python
py
Runtime Error
0
0
3824
# -*- coding: utf-8 -*- ''' Created on 2017/10/25 @author: naja yama ''' def find_r_child(tree, offset): offset += 1 count = 0 end = len(tree) while(offset < end): if tree[offset] == "(": count += 1 elif tree[offset] == ")": count -= 1 elif count == 1 and tree[offset] == ",": return offset offset += 1 return None def find_l_child(tree, offset): offset -= 1 count = 0 while(offset >= 1): if tree[offset] == "(": count -= 1 elif tree[offset] == ")": count += 1 elif count == 1 and tree[offset] == ",": return offset offset -= 1 return None def del_node(tree, offset, offset_r): count = 0 i = offset - 1 while(1): if tree[i] == ")": count += 1 elif tree[i] == "(": if count == 0: offset2 = i break count -= 1 i -= 1, count = 0 i = offset + 1 while(1): if tree[i] == "(": count += 12 elif tree[i] == ")": if count == 0: offset3 = i break count -= 1 i += 1 tree = tree[:offset2] + tree[offset3 + 1:] if offset_r < offset2: return (tree, offset) else: return (tree, offset3 + 1 - offset2) def calc_union(s_tree, offset_s, r_tree, offset_r): offset_cs = find_l_child(s_tree, offset_s) if offset_cs is None: pass else: offset_rs = find_l_child(r_tree, offset_r) if offset_rs is None: r_tree = r_tree[:offset_r] + "(,)" + r_tree[offset_r:] offset_rs = offset_r + 2 r_tree = calc_union(s_tree, offset_cs, r_tree, offset_rs) offset_cs = find_r_child(s_tree, offset_s) if offset_cs is None: return r_tree offset_rs = find_r_child(r_tree, offset_r) if offset_rs is None: r_tree = r_tree[:offset_r+1] + "(,)" + r_tree[offset_r+1:] offset_rs = offset_r + 2 r_tree = calc_union(s_tree, offset_cs, r_tree, offset_rs) return r_tree def calc_intersection(s_tree, offset_s, r_tree, offset_r): offset_rs = find_l_child(r_tree, offset_r) if offset_rs is None: pass else: offset_cs = find_l_child(s_tree, offset_s) if offset_cs is None: (r_tree, offset_r) = del_node(r_tree, offset_rs, offset_r) else: r_tree = calc_intersection(s_tree, offset_cs, r_tree, offset_rs) offset_rs = find_r_child(r_tree, offset_r) if offset_rs is None: pass else: offset_cs = find_r_child(s_tree, offset_s) if offset_cs is None: (r_tree, offset_r) = del_node(r_tree, offset_rs, offset_r) else: r_tree = calc_intersection(s_tree, offset_cs, r_tree, offset_rs) return r_tree #Get input input_line = raw_input() while input_line: #Get command, f_tree, s_tree command = input_line[0:2] input_line = input_line[2:] space = input_line.find(" ") f_tree = input_line[0:space] s_tree = input_line[space+1:] r_tree = f_tree if command[0] == "u": r_tree = calc_union(s_tree, find_r_child(s_tree, -1), r_tree, find_r_child(r_tree, -1)) else: r_tree = calc_intersection(s_tree, find_r_child(s_tree, -1), r_tree, find_r_child(r_tree, -1)) #Output answer string print r_tree #update input_line input_line = raw_input()
File "/tmp/tmpd3_roaol/tmpmmof_qt3.py", line 166 print r_tree ^^^^^^^^^^^^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
s485247072
p00587
u886119481
1508918657
Python
Python
py
Runtime Error
0
0
3839
# -*- coding: utf-8 -*- ''' Created on 2017/10/25 @author: naja yama ''' def find_r_child(tree, offset): offset += 1 count = 0 end = len(tree) while(offset < end): if tree[offset] == "(": count += 1 elif tree[offset] == ")": count -= 1 elif count == 1 and tree[offset] == ",": return offset offset += 1 return None def find_l_child(tree, offset): offset -= 1 count = 0 while(offset >= 1): if tree[offset] == "(": count -= 1 elif tree[offset] == ")": count += 1 elif count == 1 and tree[offset] == ",": return offset offset -= 1 return None def del_node(tree, offset, offset_r): count = 0 i = offset - 1 while(1): if tree[i] == ")": count += 1 elif tree[i] == "(": if count == 0: offset2 = i break count -= 1 i -= 1, count = 0 i = offset + 1 while(1): if tree[i] == "(": count += 12 elif tree[i] == ")": if count == 0: offset3 = i break count -= 1 i += 1 tree = tree[:offset2] + tree[offset3 + 1:] if offset_r < offset2: return (tree, offset_r) else: return (tree, offset_r - (offset3 + 1 - offset2)) def calc_union(s_tree, offset_s, r_tree, offset_r): offset_cs = find_l_child(s_tree, offset_s) if offset_cs is None: pass else: offset_rs = find_l_child(r_tree, offset_r) if offset_rs is None: r_tree = r_tree[:offset_r] + "(,)" + r_tree[offset_r:] offset_rs = offset_r + 2 r_tree = calc_union(s_tree, offset_cs, r_tree, offset_rs) offset_cs = find_r_child(s_tree, offset_s) if offset_cs is None: return r_tree offset_rs = find_r_child(r_tree, offset_r) if offset_rs is None: r_tree = r_tree[:offset_r+1] + "(,)" + r_tree[offset_r+1:] offset_rs = offset_r + 2 r_tree = calc_union(s_tree, offset_cs, r_tree, offset_rs) return r_tree def calc_intersection(s_tree, offset_s, r_tree, offset_r): offset_rs = find_l_child(r_tree, offset_r) if offset_rs is None: pass else: offset_cs = find_l_child(s_tree, offset_s) if offset_cs is None: (r_tree, offset_r) = del_node(r_tree, offset_rs, offset_r) else: r_tree = calc_intersection(s_tree, offset_cs, r_tree, offset_rs) offset_rs = find_r_child(r_tree, offset_r) if offset_rs is None: pass else: offset_cs = find_r_child(s_tree, offset_s) if offset_cs is None: (r_tree, offset_r) = del_node(r_tree, offset_rs, offset_r) else: r_tree = calc_intersection(s_tree, offset_cs, r_tree, offset_rs) return r_tree #Get input input_line = raw_input() while input_line: #Get command, f_tree, s_tree command = input_line[0:2] input_line = input_line[2:] space = input_line.find(" ") f_tree = input_line[0:space] s_tree = input_line[space+1:] r_tree = f_tree if command[0] == "u": r_tree = calc_union(s_tree, find_r_child(s_tree, -1), r_tree, find_r_child(r_tree, -1)) else: r_tree = calc_intersection(s_tree, find_r_child(s_tree, -1), r_tree, find_r_child(r_tree, -1)) #Output answer string print r_tree #update input_line input_line = raw_input()
File "/tmp/tmp114nlzgi/tmpz9i8tor2.py", line 166 print r_tree ^^^^^^^^^^^^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
s092677276
p00587
u886119481
1508919223
Python
Python
py
Runtime Error
0
0
3839
# -*- coding: utf-8 -*- ''' Created on 2017/10/25 @author: naja yama ''' def find_r_child(tree, offset): offset += 1 count = 0 end = len(tree) while(offset < end): if tree[offset] == "(": count += 1 elif tree[offset] == ")": count -= 1 elif count == 1 and tree[offset] == ",": return offset offset += 1 return None def find_l_child(tree, offset): offset -= 1 count = 0 while(offset >= 1): if tree[offset] == "(": count -= 1 elif tree[offset] == ")": count += 1 elif count == 1 and tree[offset] == ",": return offset offset -= 1 return None def del_node(tree, offset, offset_r): count = 0 i = offset - 1 while(1): if tree[i] == ")": count += 1 elif tree[i] == "(": if count == 0: offset2 = i break count -= 1 i -= 1, count = 0 i = offset + 1 while(1): if tree[i] == "(": count += 12 elif tree[i] == ")": if count == 0: offset3 = i break count -= 1 i += 1 tree = tree[:offset2] + tree[offset3 + 1:] if offset_r < offset2: return (tree, offset_r) else: return (tree, offset_r - (offset3 + 1 - offset2)) def calc_union(s_tree, offset_s, r_tree, offset_r): offset_cs = find_l_child(s_tree, offset_s) if offset_cs is None: pass else: offset_rs = find_l_child(r_tree, offset_r) if offset_rs is None: r_tree = r_tree[:offset_r] + "(,)" + r_tree[offset_r:] offset_rs = offset_r - 2 r_tree = calc_union(s_tree, offset_cs, r_tree, offset_rs) offset_cs = find_r_child(s_tree, offset_s) if offset_cs is None: return r_tree offset_rs = find_r_child(r_tree, offset_r) if offset_rs is None: r_tree = r_tree[:offset_r+1] + "(,)" + r_tree[offset_r+1:] offset_rs = offset_r + 2 r_tree = calc_union(s_tree, offset_cs, r_tree, offset_rs) return r_tree def calc_intersection(s_tree, offset_s, r_tree, offset_r): offset_rs = find_l_child(r_tree, offset_r) if offset_rs is None: pass else: offset_cs = find_l_child(s_tree, offset_s) if offset_cs is None: (r_tree, offset_r) = del_node(r_tree, offset_rs, offset_r) else: r_tree = calc_intersection(s_tree, offset_cs, r_tree, offset_rs) offset_rs = find_r_child(r_tree, offset_r) if offset_rs is None: pass else: offset_cs = find_r_child(s_tree, offset_s) if offset_cs is None: (r_tree, offset_r) = del_node(r_tree, offset_rs, offset_r) else: r_tree = calc_intersection(s_tree, offset_cs, r_tree, offset_rs) return r_tree #Get input input_line = raw_input() while input_line: #Get command, f_tree, s_tree command = input_line[0:2] input_line = input_line[2:] space = input_line.find(" ") f_tree = input_line[0:space] s_tree = input_line[space+1:] r_tree = f_tree if command[0] == "u": r_tree = calc_union(s_tree, find_r_child(s_tree, -1), r_tree, find_r_child(r_tree, -1)) else: r_tree = calc_intersection(s_tree, find_r_child(s_tree, -1), r_tree, find_r_child(r_tree, -1)) #Output answer string print r_tree #update input_line input_line = raw_input()
File "/tmp/tmp7pa8yemp/tmp_cfz2xub.py", line 166 print r_tree ^^^^^^^^^^^^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
s488445129
p00587
u886119481
1508921280
Python
Python
py
Runtime Error
0
0
3903
# -*- coding: utf-8 -*- ''' Created on 2017/10/25 @author: naja yama ''' def find_r_child(tree, offset): offset += 1 count = 0 end = len(tree) while(offset < end): if tree[offset] == "(": count += 1 elif tree[offset] == ")": count -= 1 elif count == 1 and tree[offset] == ",": return offset offset += 1 return None def find_l_child(tree, offset): offset -= 1 count = 0 while(offset >= 1): if tree[offset] == "(": count -= 1 elif tree[offset] == ")": count += 1 elif count == 1 and tree[offset] == ",": return offset offset -= 1 return None def del_node(tree, offset, offset_r): count = 0 i = offset - 1 while(1): if tree[i] == ")": count += 1 elif tree[i] == "(": if count == 0: offset2 = i break count -= 1 i -= 1, count = 0 i = offset + 1 while(1): if tree[i] == "(": count += 12 elif tree[i] == ")": if count == 0: offset3 = i break count -= 1 i += 1 tree = tree[:offset2] + tree[offset3 + 1:] if offset_r < offset2: return (tree, offset_r) else: return (tree, offset_r - (offset3 + 1 - offset2)) def calc_union(s_tree, offset_s, r_tree, offset_r): #for right child offset_cs = find_r_child(s_tree, offset_s) if offset_cs is None: pass else: offset_rs = find_r_child(r_tree, offset_r) if offset_rs is None: r_tree = r_tree[:offset_r+1] + "(,)" + r_tree[offset_r+1:] offset_rs = offset_r + 2 r_tree = calc_union(s_tree, offset_cs, r_tree, offset_rs) offset_cs = find_l_child(s_tree, offset_s) if offset_cs is None: return r_tree else: offset_rs = find_l_child(r_tree, offset_r) if offset_rs is None: r_tree = r_tree[:offset_r] + "(,)" + r_tree[offset_r:] offset_rs = offset_r - 2 r_tree = calc_union(s_tree, offset_cs, r_tree, offset_rs) return r_tree def calc_intersection(s_tree, offset_s, r_tree, offset_r): offset_rs = find_r_child(r_tree, offset_r) if offset_rs is None: pass else: offset_cs = find_r_child(s_tree, offset_s) if offset_cs is None: (r_tree, offset_r) = del_node(r_tree, offset_rs, offset_r) else: r_tree = calc_intersection(s_tree, offset_cs, r_tree, offset_rs) offset_rs = find_l_child(r_tree, offset_r) if offset_rs is None: return r_tree else: offset_cs = find_l_child(s_tree, offset_s) if offset_cs is None: (r_tree, offset_r) = del_node(r_tree, offset_rs, offset_r) else: r_tree = calc_intersection(s_tree, offset_cs, r_tree, offset_rs) return r_tree #Get input input_line = raw_input() while input_line: #Get command, f_tree, s_tree command = input_line[0:2] input_line = input_line[2:] space = input_line.find(" ") f_tree = input_line[0:space] s_tree = input_line[space+1:] r_tree = f_tree if command[0] == "u": r_tree = calc_union(s_tree, find_r_child(s_tree, -1), r_tree, find_r_child(r_tree, -1)) else: r_tree = calc_intersection(s_tree, find_r_child(s_tree, -1), r_tree, find_r_child(r_tree, -1)) #Output answer string print r_tree #update input_line input_line = raw_input()
File "/tmp/tmpu9fnbp_c/tmpqost8tnx.py", line 162 print r_tree ^^^^^^^^^^^^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
s651932197
p00587
u886119481
1508921827
Python
Python
py
Runtime Error
0
0
3888
# -*- coding: utf-8 -*- ''' Created on 2017/10/25 @author: naja yama ''' def find_r_child(tree, offset): offset += 1 count = 0 end = len(tree) while(offset < end): if tree[offset] == "(": count += 1 elif tree[offset] == ")": count -= 1 elif count == 1 and tree[offset] == ",": return offset offset += 1 return None def find_l_child(tree, offset): offset -= 1 count = 0 while(offset >= 1): if tree[offset] == "(": count -= 1 elif tree[offset] == ")": count += 1 elif count == 1 and tree[offset] == ",": return offset offset -= 1 return None def del_node(tree, offset, offset_r): count = 0 i = offset - 1 while(1): if tree[i] == ")": count += 1 elif tree[i] == "(": if count == 0: offset2 = i break count -= 1 i -= 1, count = 0 i = offset + 1 while(1): if tree[i] == "(": count += 12 elif tree[i] == ")": if count == 0: offset3 = i break count -= 1 i += 1 tree = tree[:offset2] + tree[offset3 + 1:] if offset_r < offset2: return (tree, offset_r) else: return (tree, offset_r - (offset3 + 1 - offset2)) def calc_union(s_tree, offset_s, r_tree, offset_r): #for right child offset_cs = find_r_child(s_tree, offset_s) if offset_cs is None: pass else: offset_rs = find_r_child(r_tree, offset_r) if offset_rs is None: r_tree = r_tree[:offset_r+1] + "(,)" + r_tree[offset_r+1:] offset_rs = offset_r + 2 r_tree = calc_union(s_tree, offset_cs, r_tree, offset_rs) offset_cs = find_l_child(s_tree, offset_s) if offset_cs is None: return r_tree else: offset_rs = find_l_child(r_tree, offset_r) if offset_rs is None: r_tree = r_tree[:offset_r] + "(,)" + r_tree[offset_r:] offset_rs = offset_r - 2 r_tree = calc_union(s_tree, offset_cs, r_tree, offset_rs) return r_tree def calc_intersection(s_tree, offset_s, r_tree, offset_r): offset_rs = find_r_child(r_tree, offset_r) if offset_rs is None: pass else: offset_cs = find_r_child(s_tree, offset_s) if offset_cs is None: (r_tree, offset_r) = del_node(r_tree, offset_rs, offset_r) else: r_tree = calc_intersection(s_tree, offset_cs, r_tree, offset_rs) offset_rs = find_l_child(r_tree, offset_r) if offset_rs is None: return r_tree else: offset_cs = find_l_child(s_tree, offset_s) if offset_cs is None: (r_tree, offset_r) = del_node(r_tree, offset_rs, offset_r) else: r_tree = calc_intersection(s_tree, offset_cs, r_tree, offset_rs) return r_tree #start main #Get input input_line = raw_input() while input_line: #Get command, f_tree, s_tree command = input_line[0:2] input_line = input_line[2:] space = input_line.find(" ") f_tree = input_line[0:space] s_tree = input_line[space+1:] r_tree = f_tree if command[0] == "u": r_tree = calc_union(s_tree, find_r_child(s_tree, -1), r_tree, find_r_child(r_tree, -1)) else: r_tree = calc_intersection(s_tree, find_r_child(s_tree, -1), r_tree, find_r_child(r_tree, -1)) #Output answer string print r_tree #update input_line input_line = raw_input()
File "/tmp/tmpe43gewrh/tmphtyeqlnu.py", line 162 print r_tree ^^^^^^^^^^^^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
s577239880
p00589
u633068244
1417603115
Python
Python
py
Runtime Error
0
0
727
ref = ["","',.!?","abcABC","defDEF","ghiGHI","jklJKL","mnoMNO","pqrsPQRS","tuvTUV","wxyzWXYZ"] def inp(s[0],l): n = int(s[0]) p = (l-1)%len(ref[n]) return ref[n][p] while 1: try: ans = "" s = "" for push in raw_input(): l = len(s) if push == "0": if l > 0: ans += inp(s[0],l) s = "" else: ans += " " elif l == 0 or s[-1] == push: s += push else: ans += inp(s[0],l) s = push if l > 0: ans += " "*l if s[0] == 0 else ans += inp(s[0],l): print ans except: break
File "/tmp/tmpiwzqruq7/tmpc74z53he.py", line 2 def inp(s[0],l): ^ SyntaxError: invalid syntax
s403710623
p00589
u590037228
1393917511
Python
Python
py
Runtime Error
0
0
1790
#-*- coding:utf-8 -*- import sys #入力されたデータに関して携帯のキーを返す def decode_keitai(str): #携帯キーを表す配列を作成 keitai_keys = [" ","',.!?","abcABC","defDEF","ghiGHI","jklJKL","mnoMNO","pqrsPQRS","tuvTUV","wxyzWXYZ"] #結果文字列 results = [] #入力文字列をリストに変換 inputs = str.split("\n") #各文字列について for input in inputs: result = "" #デコード結果 #前の文字 s_before = "" #文字列の最後まで while len(str) > 0: #文頭の1文字を取得 s = str[0] str = str[1:] print s #最初の1文字ならcontinue if s_before == "": s_before = s continue #最初の1文字が前の文字と違うなら携帯コードにデコード if not s in s_before: if s_before[0] == "0": result += s_before[:-1].replace("0"," ") else: id = int(s_before[0]) keylen = len(keitai_keys[id]) result += keitai_keys[id][(len(s_before)-1)%keylen] s_before = s else: s_before += s #最後に残った文字列を変換 if len(s_before) > 0: if s_before[0] == "0": result += s_before[:-1].replace("0"," ") else: id = int(s_before[0]) keylen = len(keitai_keys[id]) result += keitai_keys[id][(len(s_before)-1)%keylen] results.append(result) return "\n".join(results) if __name__=="__main__": print decode_keitai(sys.argv[1])
File "/tmp/tmpzmp9ps87/tmpxuwriyvg.py", line 29 print s ^^^^^^^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
s060729235
p00589
u590037228
1393917913
Python
Python
py
Runtime Error
0
0
1864
#-*- coding:utf-8 -*- import sys #入力されたデータに関して携帯のキーを返す def decode_keitai(str): #携帯キーを表す配列を作成 keitai_keys = [" ","',.!?","abcABC","defDEF","ghiGHI","jklJKL","mnoMNO","pqrsPQRS","tuvTUV","wxyzWXYZ"] #結果文字列 results = [] #入力文字列をリストに変換 inputs = str.split("\n") #各文字列について for input in inputs: result = "" #デコード結果 #前の文字 s_before = "" #文字列の最後まで while len(str) > 0: #文頭の1文字を取得 s = str[0] str = str[1:] print s #最初の1文字ならcontinue if s_before == "": s_before = s continue #最初の1文字が前の文字と違うなら携帯コードにデコード if not s in s_before: if s_before[0] == "0": result += s_before[:-1].replace("0"," ") else: id = int(s_before[0]) keylen = len(keitai_keys[id]) result += keitai_keys[id][(len(s_before)-1)%keylen] s_before = s else: s_before += s #最後に残った文字列を変換 if len(s_before) > 0: if s_before[0] == "0": result += s_before[:-1].replace("0"," ") else: id = int(s_before[0]) keylen = len(keitai_keys[id]) result += keitai_keys[id][(len(s_before)-1)%keylen] results.append(result) return "\n".join(results) if __name__=="__main__": lines = [] for line in sys.stdin: lines.append(line) print decode_keitai("\n".join(lines))
File "/tmp/tmpbq6oobj2/tmp2270wcoe.py", line 29 print s ^^^^^^^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
s428333070
p00589
u350508326
1400175673
Python
Python3
py
Runtime Error
0
0
1192
def main(): count = -1 data = input() before_number = data[0] output = [] for n in data: if before_number == n: count += 1 else: # print('before_number: ' + before_number + ', count: ' + str(count)) # print() if before_number == '0': for zero in range(count): output.append(' ') else: output.append(keys[int(before_number)][count]) # print(keys[int(before_number)][count], end='') before_number = n count = 0 else: # print('before_number: ' + before_number + ', count: ' + str(count)) # print() if before_number == '0': for zero in range(count): output.append(' ') else: output.append(keys[int(before_number)][count]) # print(keys[int(before_number)][count], end='') # output.append(keys[int(before_number)][count]) # print(keys[int(n)][count]) print(''.join(output)) if __name__ == '__main__': while True: try: main() except EOFError: break
s997900402
p00589
u350508326
1400175723
Python
Python3
py
Runtime Error
0
0
1450
keys = [[' '], ['\'', ',','.', '!', '?'], ['a', 'b', 'c', 'A', 'B', 'C'], ['d', 'e', 'f', 'D', 'E', 'F'], ['g', 'h', 'i', 'G', 'H', 'I'], ['j', 'k', 'l', 'J', 'K', 'L'], ['m', 'n', 'o', 'M', 'N', 'O'], ['p', 'q', 'r', 'P', 'Q', 'R'], ['t', 'u', 'v', 'T', 'U', 'V'], ['x', 'y', 'z', 'X', 'Y', 'Z']] def main(): count = -1 data = input() before_number = data[0] output = [] for n in data: if before_number == n: count += 1 else: if before_number == '0': for zero in range(count): output.append(' ') else: output.append(keys[int(before_number)][count]) # print(keys[int(before_number)][count], end='') before_number = n count = 0 else: # print('before_number: ' + before_number + ', count: ' + str(count)) # print() if before_number == '0': for zero in range(count): output.append(' ') else: output.append(keys[int(before_number)][count]) # print(keys[int(before_number)][count], end='') # output.append(keys[int(before_number)][count]) # print(keys[int(n)][count]) print(''.join(output)) if __name__ == '__main__': while True: try: main() except EOFError: break
s002189204
p00589
u350508326
1400175853
Python
Python3
py
Runtime Error
0
0
1131
keys = [[' '], ['\'', ',','.', '!', '?'], ['a', 'b', 'c', 'A', 'B', 'C'], ['d', 'e', 'f', 'D', 'E', 'F'], ['g', 'h', 'i', 'G', 'H', 'I'], ['j', 'k', 'l', 'J', 'K', 'L'], ['m', 'n', 'o', 'M', 'N', 'O'], ['p', 'q', 'r', 'P', 'Q', 'R'], ['t', 'u', 'v', 'T', 'U', 'V'], ['x', 'y', 'z', 'X', 'Y', 'Z']] def main(): count = -1 data = input() before_number = data[0] output = [] for n in data: if before_number == n: count += 1 else: if before_number == '0': for zero in range(count): output.append(' ') else: output.append(keys[int(before_number)][count]) before_number = n count = 0 else: if before_number == '0': for zero in range(count): output.append(' ') else: output.append(keys[int(before_number)][count]) print(''.join(output)) if __name__ == '__main__': while True: try: main() except EOFError: break
s329257874
p00590
u266872031
1428512749
Python
Python
py
Runtime Error
0
0
1066
import math import bisect primes=[2] top=2 nlist=[2*x-1 for x in range(2,5000)] while top<math.sqrt(10000): top=nlist[0] primes.append(top) newnlist=[] for i in nlist: if i%top!=0: newnlist.append(i) nlist=newnlist primes=primes+nlist while(1): try: n=int(raw_input()) except: break if n%2==0: if n-1 in primes: print 2 else: print 0 else: ans=0 center=(n+1)/2 distc=[x-center for x in primes] if 0 in distc: ans=1 il=bisect.bisect_left(distc,0)-1 ir=bisect.bisect_left(distc,0)+1 else: il=bisect.bisect_left(distc,0)-1 ir=bisect.bisect_left(distc,0) while(il>=0 and primes[ir]<n+1): if distc[il]+distc[ir]==0: ans=ans+2 il=il-1 ir=ir+1 elif distc[il]+distc[ir]<0: ir=ir+1 else: il=il-1 #print ir,il print ans
File "/tmp/tmp11i32sju/tmpr1mxix9y.py", line 23 print 2 ^^^^^^^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
s592355161
p00590
u473221511
1461856955
Python
Python3
py
Runtime Error
0
0
1881
class primes: primelist = [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, 233, 239, 241, 251, 257, 263, 269, 271, 277, 281, 283, 293, 307, 311, 313, 317, 331, 337, 347, 349, 353, 359, 367, 373, 379, 383, 389, 397, 401, 409, 419, 421, 431, 433, 439, 443, 449, 457, 461, 463, 467, 479, 487, 491, 499, 503, 509, 521, 523, 541, 547, 557, 563, 569, 571, 577, 587, 593, 599, 601, 607, 613, 617, 619, 631, 641, 643, 647, 653, 659, 661, 673, 677, 683, 691, 701, 709, 719, 727, 733, 739, 743, 751, 757, 761, 769, 773, 787, 797, 809, 811, 821, 823, 827, 829, 839, 853, 857, 859, 863, 877, 881, 883, 887, 907, 911, 919, 929, 937, 941, 947, 953, 967, 971, 977,983,991,997] ] maxpval = 997 def addprime(num, p): maxval = p.maxpval while maxval < num: maxval += 1 flag = False for prime in p.primelist: if maxval % prime == 0: flag = True break if flag == False: p.primelist.append(maxval) p.maxpval = maxval def main(): p = primes() # a = int(input()) # addprime(a, p) # print(p.primelist) # print(p.maxpval) import sys l = [] for line in sys.stdin: l.append(line) length = len(l) for i in range(length): count = 0 width = int(l[i]) number = int(l[i]) addprime(width, p) if width % 2 == 0: width = width // 2 else: width = (width // 2) + 1 for j in range(width): if (j + 1) in p.primelist and (number - j) in p.primelist: count += 2 print(count) if __name__ == "__main__": main()
File "/tmp/tmp44atqxge/tmpzhotimwv.py", line 2 primelist = [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, 233, 239, 241, 251, 257, 263, 269, 271, 277, 281, 283, 293, 307, 311, 313, 317, 331, 337, 347, 349, 353, 359, 367, 373, 379, 383, 389, 397, 401, 409, 419, 421, 431, 433, 439, 443, 449, 457, 461, 463, 467, 479, 487, 491, 499, 503, 509, 521, 523, 541, 547, 557, 563, 569, 571, 577, 587, 593, 599, 601, 607, 613, 617, 619, 631, 641, 643, 647, 653, 659, 661, 673, 677, 683, 691, 701, 709, 719, 727, 733, 739, 743, 751, 757, 761, 769, 773, 787, 797, 809, 811, 821, 823, 827, 829, 839, 853, 857, 859, 863, 877, 881, 883, 887, 907, 911, 919, 929, 937, 941, 947, 953, 967, 971, 977,983,991,997] ] ^ SyntaxError: unmatched ']'
s189134178
p00590
u473221511
1461856987
Python
Python3
py
Runtime Error
0
0
1856
class primes: primelist = [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, 233, 239, 241, 251, 257, 263, 269, 271, 277, 281, 283, 293, 307, 311, 313, 317, 331, 337, 347, 349, 353, 359, 367, 373, 379, 383, 389, 397, 401, 409, 419, 421, 431, 433, 439, 443, 449, 457, 461, 463, 467, 479, 487, 491, 499, 503, 509, 521, 523, 541, 547, 557, 563, 569, 571, 577, 587, 593, 599, 601, 607, 613, 617, 619, 631, 641, 643, 647, 653, 659, 661, 673, 677, 683, 691, 701, 709, 719, 727, 733, 739, 743, 751, 757, 761, 769, 773, 787, 797, 809, 811, 821, 823, 827, 829, 839, 853, 857, 859, 863, 877, 881, 883, 887, 907, 911, 919, 929, 937, 941, 947, 953, 967, 971] ] maxpval = 971 def addprime(num, p): maxval = p.maxpval while maxval < num: maxval += 1 flag = False for prime in p.primelist: if maxval % prime == 0: flag = True break if flag == False: p.primelist.append(maxval) p.maxpval = maxval def main(): p = primes() # a = int(input()) # addprime(a, p) # print(p.primelist) # print(p.maxpval) import sys l = [] for line in sys.stdin: l.append(line) length = len(l) for i in range(length): count = 0 width = int(l[i]) number = int(l[i]) addprime(width, p) if width % 2 == 0: width = width // 2 else: width = (width // 2) + 1 for j in range(width): if (j + 1) in p.primelist and (number - j) in p.primelist: count += 2 print(count) if __name__ == "__main__": main()
File "/tmp/tmp_bxudndn/tmp27v7mntf.py", line 2 primelist = [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, 233, 239, 241, 251, 257, 263, 269, 271, 277, 281, 283, 293, 307, 311, 313, 317, 331, 337, 347, 349, 353, 359, 367, 373, 379, 383, 389, 397, 401, 409, 419, 421, 431, 433, 439, 443, 449, 457, 461, 463, 467, 479, 487, 491, 499, 503, 509, 521, 523, 541, 547, 557, 563, 569, 571, 577, 587, 593, 599, 601, 607, 613, 617, 619, 631, 641, 643, 647, 653, 659, 661, 673, 677, 683, 691, 701, 709, 719, 727, 733, 739, 743, 751, 757, 761, 769, 773, 787, 797, 809, 811, 821, 823, 827, 829, 839, 853, 857, 859, 863, 877, 881, 883, 887, 907, 911, 919, 929, 937, 941, 947, 953, 967, 971] ] ^ SyntaxError: unmatched ']'
s473470007
p00590
u473221511
1461857026
Python
Python3
py
Runtime Error
0
0
1847
class primes: primelist = [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71,73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167,173, 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, 233, 239, 241, 251, 257, 263, 269,271, 277, 281, 283, 293, 307, 311, 313, 317, 331, 337, 347, 349, 353, 359, 367, 373, 379,383, 389, 397, 401, 409, 419, 421, 431, 433, 439, 443, 449, 457, 461, 463, 467, 479, 487,491, 499, 503, 509, 521, 523, 541, 547, 557, 563, 569, 571, 577, 587, 593, 599, 601, 607,613, 617, 619, 631, 641, 643, 647, 653, 659, 661, 673, 677, 683, 691, 701, 709, 719, 727,733, 739, 743, 751, 757, 761, 769, 773, 787, 797, 809, 811, 821, 823, 827, 829, 839, 853,857, 859, 863, 877, 881, 883, 887, 907, 911, 919, 929, 937, 941, 947, 953, 967,971] ] maxpval = 971 def addprime(num, p): maxval = p.maxpval while maxval < num: maxval += 1 flag = False for prime in p.primelist: if maxval % prime == 0: flag = True break if flag == False: p.primelist.append(maxval) p.maxpval = maxval def main(): p = primes() # a = int(input()) # addprime(a, p) # print(p.primelist) # print(p.maxpval) import sys l = [] for line in sys.stdin: l.append(line) length = len(l) for i in range(length): count = 0 width = int(l[i]) number = int(l[i]) addprime(width, p) if width % 2 == 0: width = width // 2 else: width = (width // 2) + 1 for j in range(width): if (j + 1) in p.primelist and (number - j) in p.primelist: count += 2 print(count) if __name__ == "__main__": main()
File "/tmp/tmpw0bmtpmm/tmp44mg7o34.py", line 2 primelist = [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71,73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167,173, 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, 233, 239, 241, 251, 257, 263, 269,271, 277, 281, 283, 293, 307, 311, 313, 317, 331, 337, 347, 349, 353, 359, 367, 373, 379,383, 389, 397, 401, 409, 419, 421, 431, 433, 439, 443, 449, 457, 461, 463, 467, 479, 487,491, 499, 503, 509, 521, 523, 541, 547, 557, 563, 569, 571, 577, 587, 593, 599, 601, 607,613, 617, 619, 631, 641, 643, 647, 653, 659, 661, 673, 677, 683, 691, 701, 709, 719, 727,733, 739, 743, 751, 757, 761, 769, 773, 787, 797, 809, 811, 821, 823, 827, 829, 839, 853,857, 859, 863, 877, 881, 883, 887, 907, 911, 919, 929, 937, 941, 947, 953, 967,971] ] ^ SyntaxError: unmatched ']'
s439389711
p00590
u269391636
1523293361
Python
Python3
py
Runtime Error
0
0
366
import math def ifprime(num): if num == 1: return False for i in range(2,math.floor(num ** 0.5) + 1): if num % i: continue else: return False return True while(True): try: num = input() except: break count = 0 for i in range(1,num+1): if ifprime(i) and ifprime(num-i): count += 1 print(count)
s213338605
p00590
u260980560
1385993050
Python
Python
py
Runtime Error
0
0
286
import sys M = 1001; p = [1]*M; p[0],p[1] = 0,0 for i in xrange(31): if p[i]: for j in xrange(i*i,M,i): p[j] = 0 for s in sys.stdin.readlines(): n = int(s); ans = 0; for i in xrange(1,n+1): if p[i] and p[n+1-i]: ans += 1 print ans
File "/tmp/tmpc7i2dpav/tmp85hb9zoh.py", line 13 print ans ^^^^^^^^^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
s114912746
p00590
u260980560
1385993103
Python
Python
py
Runtime Error
0
0
294
import sys M = 1001; p = [1]*M; p[0],p[1] = 0,0 for i in xrange(31): if p[i]: for j in xrange(i*i,M,i): p[j] = 0 for s in sys.stdin.readlines(): n = int(s.strip()); ans = 0; for i in xrange(1,n+1): if p[i] and p[n+1-i]: ans += 1 print ans
File "/tmp/tmpav5q0agm/tmp1t0v1amr.py", line 13 print ans ^^^^^^^^^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
s418387108
p00590
u260980560
1385993212
Python
Python
py
Runtime Error
0
0
326
M = 1001; p = [1]*M; p[0],p[1] = 0,0 for i in xrange(32): if p[i]: for j in xrange(i*i,M,i): p[j] = 0 while 1: try: n = int(raw_input()); ans = 0; for i in xrange(1,n+1): if p[i] and p[n+1-i]: ans += 1 print ans except EOFError: break
File "/tmp/tmppdikmguh/tmpi8tivrax.py", line 13 print ans ^^^^^^^^^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
s456690221
p00590
u590037228
1393920478
Python
Python
py
Runtime Error
0
0
7986
#-*- coding:utf-8 -*- import sys #入力されたデータに関して2つとも素数の組の数を返す def both_primes(list): #素数リスト primes = [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, 233, 239, 241, 251, 257, 263, 269, 271, 277, 281, 283, 293, 307, 311, 313, 317, 331, 337, 347, 349, 353, 359, 367, 373, 379, 383, 389, 397, 401, 409, 419, 421, 431, 433, 439, 443, 449, 457, 461, 463, 467, 479, 487, 491, 499, 503, 509, 521, 523, 541, 547, 557, 563, 569, 571, 577, 587, 593, 599, 601, 607, 613, 617, 619, 631, 641, 643, 647, 653, 659, 661, 673, 677, 683, 691, 701, 709, 719, 727, 733, 739, 743, 751, 757, 761, 769, 773, 787, 797, 809, 811, 821, 823, 827, 829, 839, 853, 857, 859, 863, 877, 881, 883, 887, 907, 911, 919, 929, 937, 941, 947, 953, 967, 971, 977, 983, 991, 997, 1009, 1013, 1019, 1021, 1031, 1033, 1039, 1049, 1051, 1061, 1063, 1069, 1087, 1091, 1093, 1097, 1103, 1109, 1117, 1123, 1129, 1151, 1153, 1163, 1171, 1181, 1187, 1193, 1201, 1213, 1217, 1223, 1229, 1231, 1237, 1249, 1259, 1277, 1279, 1283, 1289, 1291, 1297, 1301, 1303, 1307, 1319, 1321, 1327, 1361, 1367, 1373, 1381, 1399, 1409, 1423, 1427, 1429, 1433, 1439, 1447, 1451, 1453, 1459, 1471, 1481, 1483, 1487, 1489, 1493, 1499, 1511, 1523, 1531, 1543, 1549, 1553, 1559, 1567, 1571, 1579, 1583, 1597, 1601, 1607, 1609, 1613, 1619, 1621, 1627, 1637, 1657, 1663, 1667, 1669, 1693, 1697, 1699, 1709, 1721, 1723, 1733, 1741, 1747, 1753, 1759, 1777, 1783, 1787, 1789, 1801, 1811, 1823, 1831, 1847, 1861, 1867, 1871, 1873, 1877, 1879, 1889, 1901, 1907, 1913, 1931, 1933, 1949, 1951, 1973, 1979, 1987, 1993, 1997, 1999, 2003, 2011, 2017, 2027, 2029, 2039, 2053, 2063, 2069, 2081, 2083, 2087, 2089, 2099, 2111, 2113, 2129, 2131, 2137, 2141, 2143, 2153, 2161, 2179, 2203, 2207, 2213, 2221, 2237, 2239, 2243, 2251, 2267, 2269, 2273, 2281, 2287, 2293, 2297, 2309, 2311, 2333, 2339, 2341, 2347, 2351, 2357, 2371, 2377, 2381, 2383, 2389, 2393, 2399, 2411, 2417, 2423, 2437, 2441, 2447, 2459, 2467, 2473, 2477, 2503, 2521, 2531, 2539, 2543, 2549, 2551, 2557, 2579, 2591, 2593, 2609, 2617, 2621, 2633, 2647, 2657, 2659, 2663, 2671, 2677, 2683, 2687, 2689, 2693, 2699, 2707, 2711, 2713, 2719, 2729, 2731, 2741, 2749, 2753, 2767, 2777, 2789, 2791, 2797, 2801, 2803, 2819, 2833, 2837, 2843, 2851, 2857, 2861, 2879, 2887, 2897, 2903, 2909, 2917, 2927, 2939, 2953, 2957, 2963, 2969, 2971, 2999, 3001, 3011, 3019, 3023, 3037, 3041, 3049, 3061, 3067, 3079, 3083, 3089, 3109, 3119, 3121, 3137, 3163, 3167, 3169, 3181, 3187, 3191, 3203, 3209, 3217, 3221, 3229, 3251, 3253, 3257, 3259, 3271, 3299, 3301, 3307, 3313, 3319, 3323, 3329, 3331, 3343, 3347, 3359, 3361, 3371, 3373, 3389, 3391, 3407, 3413, 3433, 3449, 3457, 3461, 3463, 3467, 3469, 3491, 3499, 3511, 3517, 3527, 3529, 3533, 3539, 3541, 3547, 3557, 3559, 3571, 3581, 3583, 3593, 3607, 3613, 3617, 3623, 3631, 3637, 3643, 3659, 3671, 3673, 3677, 3691, 3697, 3701, 3709, 3719, 3727, 3733, 3739, 3761, 3767, 3769, 3779, 3793, 3797, 3803, 3821, 3823, 3833, 3847, 3851, 3853, 3863, 3877, 3881, 3889, 3907, 3911, 3917, 3919, 3923, 3929, 3931, 3943, 3947, 3967, 3989, 4001, 4003, 4007, 4013, 4019, 4021, 4027, 4049, 4051, 4057, 4073, 4079, 4091, 4093, 4099, 4111, 4127, 4129, 4133, 4139, 4153, 4157, 4159, 4177, 4201, 4211, 4217, 4219, 4229, 4231, 4241, 4243, 4253, 4259, 4261, 4271, 4273, 4283, 4289, 4297, 4327, 4337, 4339, 4349, 4357, 4363, 4373, 4391, 4397, 4409, 4421, 4423, 4441, 4447, 4451, 4457, 4463, 4481, 4483, 4493, 4507, 4513, 4517, 4519, 4523, 4547, 4549, 4561, 4567, 4583, 4591, 4597, 4603, 4621, 4637, 4639, 4643, 4649, 4651, 4657, 4663, 4673, 4679, 4691, 4703, 4721, 4723, 4729, 4733, 4751, 4759, 4783, 4787, 4789, 4793, 4799, 4801, 4813, 4817, 4831, 4861, 4871, 4877, 4889, 4903, 4909, 4919, 4931, 4933, 4937, 4943, 4951, 4957, 4967, 4969, 4973, 4987, 4993, 4999, 5003, 5009, 5011, 5021, 5023, 5039, 5051, 5059, 5077, 5081, 5087, 5099, 5101, 5107, 5113, 5119, 5147, 5153, 5167, 5171, 5179, 5189, 5197, 5209, 5227, 5231, 5233, 5237, 5261, 5273, 5279, 5281, 5297, 5303, 5309, 5323, 5333, 5347, 5351, 5381, 5387, 5393, 5399, 5407, 5413, 5417, 5419, 5431, 5437, 5441, 5443, 5449, 5471, 5477, 5479, 5483, 5501, 5503, 5507, 5519, 5521, 5527, 5531, 5557, 5563, 5569, 5573, 5581, 5591, 5623, 5639, 5641, 5647, 5651, 5653, 5657, 5659, 5669, 5683, 5689, 5693, 5701, 5711, 5717, 5737, 5741, 5743, 5749, 5779, 5783, 5791, 5801, 5807, 5813, 5821, 5827, 5839, 5843, 5849, 5851, 5857, 5861, 5867, 5869, 5879, 5881, 5897, 5903, 5923, 5927, 5939, 5953, 5981, 5987, 6007, 6011, 6029, 6037, 6043, 6047, 6053, 6067, 6073, 6079, 6089, 6091, 6101, 6113, 6121, 6131, 6133, 6143, 6151, 6163, 6173, 6197, 6199, 6203, 6211, 6217, 6221, 6229, 6247, 6257, 6263, 6269, 6271, 6277, 6287, 6299, 6301, 6311, 6317, 6323, 6329, 6337, 6343, 6353, 6359, 6361, 6367, 6373, 6379, 6389, 6397, 6421, 6427, 6449, 6451, 6469, 6473, 6481, 6491, 6521, 6529, 6547, 6551, 6553, 6563, 6569, 6571, 6577, 6581, 6599, 6607, 6619, 6637, 6653, 6659, 6661, 6673, 6679, 6689, 6691, 6701, 6703, 6709, 6719, 6733, 6737, 6761, 6763, 6779, 6781, 6791, 6793, 6803, 6823, 6827, 6829, 6833, 6841, 6857, 6863, 6869, 6871, 6883, 6899, 6907, 6911, 6917, 6947, 6949, 6959, 6961, 6967, 6971, 6977, 6983, 6991, 6997, 7001, 7013, 7019, 7027, 7039, 7043, 7057, 7069, 7079, 7103, 7109, 7121, 7127, 7129, 7151, 7159, 7177, 7187, 7193, 7207, 7211, 7213, 7219, 7229, 7237, 7243, 7247, 7253, 7283, 7297, 7307, 7309, 7321, 7331, 7333, 7349, 7351, 7369, 7393, 7411, 7417, 7433, 7451, 7457, 7459, 7477, 7481, 7487, 7489, 7499, 7507, 7517, 7523, 7529, 7537, 7541, 7547, 7549, 7559, 7561, 7573, 7577, 7583, 7589, 7591, 7603, 7607, 7621, 7639, 7643, 7649, 7669, 7673, 7681, 7687, 7691, 7699, 7703, 7717, 7723, 7727, 7741, 7753, 7757, 7759, 7789, 7793, 7817, 7823, 7829, 7841, 7853, 7867, 7873, 7877, 7879, 7883, 7901, 7907, 7919, 7927, 7933, 7937, 7949, 7951, 7963, 7993, 8009, 8011, 8017, 8039, 8053, 8059, 8069, 8081, 8087, 8089, 8093, 8101, 8111, 8117, 8123, 8147, 8161, 8167, 8171, 8179, 8191, 8209, 8219, 8221, 8231, 8233, 8237, 8243, 8263, 8269, 8273, 8287, 8291, 8293, 8297, 8311, 8317, 8329, 8353, 8363, 8369, 8377, 8387, 8389, 8419, 8423, 8429, 8431, 8443, 8447, 8461, 8467, 8501, 8513, 8521, 8527, 8537, 8539, 8543, 8563, 8573, 8581, 8597, 8599, 8609, 8623, 8627, 8629, 8641, 8647, 8663, 8669, 8677, 8681, 8689, 8693, 8699, 8707, 8713, 8719, 8731, 8737, 8741, 8747, 8753, 8761, 8779, 8783, 8803, 8807, 8819, 8821, 8831, 8837, 8839, 8849, 8861, 8863, 8867, 8887, 8893, 8923, 8929, 8933, 8941, 8951, 8963, 8969, 8971, 8999, 9001, 9007, 9011, 9013, 9029, 9041, 9043, 9049, 9059, 9067, 9091, 9103, 9109, 9127, 9133, 9137, 9151, 9157, 9161, 9173, 9181, 9187, 9199, 9203, 9209, 9221, 9227, 9239, 9241, 9257, 9277, 9281, 9283, 9293, 9311, 9319, 9323, 9337, 9341, 9343, 9349, 9371, 9377, 9391, 9397, 9403, 9413, 9419, 9421, 9431, 9433, 9437, 9439, 9461, 9463, 9467, 9473, 9479, 9491, 9497, 9511, 9521, 9533, 9539, 9547, 9551, 9587, 9601, 9613, 9619, 9623, 9629, 9631, 9643, 9649, 9661, 9677, 9679, 9689, 9697, 9719, 9721, 9733, 9739, 9743, 9749, 9767, 9769, 9781, 9787, 9791, 9803, 9811, 9817, 9829, 9833, 9839, 9851, 9857, 9859, 9871, 9883, 9887, 9901, 9907, 9923, 9929, 9931, 9941, 9949, 9967, 9973] #各データについて偶数奇数で場合分け for l in list: #偶数 if l%2 == 0: if l-1 in primes: print 2 else: print 0 #奇数 else: c = 0 #カウント for i in range(l): if (i+1)%2==0: continue else: if i+1 in primes and l-i+1 in primes: c += 1 print c if __name__=="__main__": lines = [] for line in sys.stdin: lines.append(int(line.replace("\n",""))) print decode_keitai(lines)
File "/tmp/tmp4kve50mg/tmpcey7vdml.py", line 15 print 2 ^^^^^^^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
s090563294
p00590
u590037228
1393921535
Python
Python
py
Runtime Error
0
0
7930
#-*- coding:utf-8 -*- import sys #入力されたデータに関して2つとも素数の組の数を返す def both_prime(num): #素数リスト primes = [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, 233, 239, 241, 251, 257, 263, 269, 271, 277, 281, 283, 293, 307, 311, 313, 317, 331, 337, 347, 349, 353, 359, 367, 373, 379, 383, 389, 397, 401, 409, 419, 421, 431, 433, 439, 443, 449, 457, 461, 463, 467, 479, 487, 491, 499, 503, 509, 521, 523, 541, 547, 557, 563, 569, 571, 577, 587, 593, 599, 601, 607, 613, 617, 619, 631, 641, 643, 647, 653, 659, 661, 673, 677, 683, 691, 701, 709, 719, 727, 733, 739, 743, 751, 757, 761, 769, 773, 787, 797, 809, 811, 821, 823, 827, 829, 839, 853, 857, 859, 863, 877, 881, 883, 887, 907, 911, 919, 929, 937, 941, 947, 953, 967, 971, 977, 983, 991, 997, 1009, 1013, 1019, 1021, 1031, 1033, 1039, 1049, 1051, 1061, 1063, 1069, 1087, 1091, 1093, 1097, 1103, 1109, 1117, 1123, 1129, 1151, 1153, 1163, 1171, 1181, 1187, 1193, 1201, 1213, 1217, 1223, 1229, 1231, 1237, 1249, 1259, 1277, 1279, 1283, 1289, 1291, 1297, 1301, 1303, 1307, 1319, 1321, 1327, 1361, 1367, 1373, 1381, 1399, 1409, 1423, 1427, 1429, 1433, 1439, 1447, 1451, 1453, 1459, 1471, 1481, 1483, 1487, 1489, 1493, 1499, 1511, 1523, 1531, 1543, 1549, 1553, 1559, 1567, 1571, 1579, 1583, 1597, 1601, 1607, 1609, 1613, 1619, 1621, 1627, 1637, 1657, 1663, 1667, 1669, 1693, 1697, 1699, 1709, 1721, 1723, 1733, 1741, 1747, 1753, 1759, 1777, 1783, 1787, 1789, 1801, 1811, 1823, 1831, 1847, 1861, 1867, 1871, 1873, 1877, 1879, 1889, 1901, 1907, 1913, 1931, 1933, 1949, 1951, 1973, 1979, 1987, 1993, 1997, 1999, 2003, 2011, 2017, 2027, 2029, 2039, 2053, 2063, 2069, 2081, 2083, 2087, 2089, 2099, 2111, 2113, 2129, 2131, 2137, 2141, 2143, 2153, 2161, 2179, 2203, 2207, 2213, 2221, 2237, 2239, 2243, 2251, 2267, 2269, 2273, 2281, 2287, 2293, 2297, 2309, 2311, 2333, 2339, 2341, 2347, 2351, 2357, 2371, 2377, 2381, 2383, 2389, 2393, 2399, 2411, 2417, 2423, 2437, 2441, 2447, 2459, 2467, 2473, 2477, 2503, 2521, 2531, 2539, 2543, 2549, 2551, 2557, 2579, 2591, 2593, 2609, 2617, 2621, 2633, 2647, 2657, 2659, 2663, 2671, 2677, 2683, 2687, 2689, 2693, 2699, 2707, 2711, 2713, 2719, 2729, 2731, 2741, 2749, 2753, 2767, 2777, 2789, 2791, 2797, 2801, 2803, 2819, 2833, 2837, 2843, 2851, 2857, 2861, 2879, 2887, 2897, 2903, 2909, 2917, 2927, 2939, 2953, 2957, 2963, 2969, 2971, 2999, 3001, 3011, 3019, 3023, 3037, 3041, 3049, 3061, 3067, 3079, 3083, 3089, 3109, 3119, 3121, 3137, 3163, 3167, 3169, 3181, 3187, 3191, 3203, 3209, 3217, 3221, 3229, 3251, 3253, 3257, 3259, 3271, 3299, 3301, 3307, 3313, 3319, 3323, 3329, 3331, 3343, 3347, 3359, 3361, 3371, 3373, 3389, 3391, 3407, 3413, 3433, 3449, 3457, 3461, 3463, 3467, 3469, 3491, 3499, 3511, 3517, 3527, 3529, 3533, 3539, 3541, 3547, 3557, 3559, 3571, 3581, 3583, 3593, 3607, 3613, 3617, 3623, 3631, 3637, 3643, 3659, 3671, 3673, 3677, 3691, 3697, 3701, 3709, 3719, 3727, 3733, 3739, 3761, 3767, 3769, 3779, 3793, 3797, 3803, 3821, 3823, 3833, 3847, 3851, 3853, 3863, 3877, 3881, 3889, 3907, 3911, 3917, 3919, 3923, 3929, 3931, 3943, 3947, 3967, 3989, 4001, 4003, 4007, 4013, 4019, 4021, 4027, 4049, 4051, 4057, 4073, 4079, 4091, 4093, 4099, 4111, 4127, 4129, 4133, 4139, 4153, 4157, 4159, 4177, 4201, 4211, 4217, 4219, 4229, 4231, 4241, 4243, 4253, 4259, 4261, 4271, 4273, 4283, 4289, 4297, 4327, 4337, 4339, 4349, 4357, 4363, 4373, 4391, 4397, 4409, 4421, 4423, 4441, 4447, 4451, 4457, 4463, 4481, 4483, 4493, 4507, 4513, 4517, 4519, 4523, 4547, 4549, 4561, 4567, 4583, 4591, 4597, 4603, 4621, 4637, 4639, 4643, 4649, 4651, 4657, 4663, 4673, 4679, 4691, 4703, 4721, 4723, 4729, 4733, 4751, 4759, 4783, 4787, 4789, 4793, 4799, 4801, 4813, 4817, 4831, 4861, 4871, 4877, 4889, 4903, 4909, 4919, 4931, 4933, 4937, 4943, 4951, 4957, 4967, 4969, 4973, 4987, 4993, 4999, 5003, 5009, 5011, 5021, 5023, 5039, 5051, 5059, 5077, 5081, 5087, 5099, 5101, 5107, 5113, 5119, 5147, 5153, 5167, 5171, 5179, 5189, 5197, 5209, 5227, 5231, 5233, 5237, 5261, 5273, 5279, 5281, 5297, 5303, 5309, 5323, 5333, 5347, 5351, 5381, 5387, 5393, 5399, 5407, 5413, 5417, 5419, 5431, 5437, 5441, 5443, 5449, 5471, 5477, 5479, 5483, 5501, 5503, 5507, 5519, 5521, 5527, 5531, 5557, 5563, 5569, 5573, 5581, 5591, 5623, 5639, 5641, 5647, 5651, 5653, 5657, 5659, 5669, 5683, 5689, 5693, 5701, 5711, 5717, 5737, 5741, 5743, 5749, 5779, 5783, 5791, 5801, 5807, 5813, 5821, 5827, 5839, 5843, 5849, 5851, 5857, 5861, 5867, 5869, 5879, 5881, 5897, 5903, 5923, 5927, 5939, 5953, 5981, 5987, 6007, 6011, 6029, 6037, 6043, 6047, 6053, 6067, 6073, 6079, 6089, 6091, 6101, 6113, 6121, 6131, 6133, 6143, 6151, 6163, 6173, 6197, 6199, 6203, 6211, 6217, 6221, 6229, 6247, 6257, 6263, 6269, 6271, 6277, 6287, 6299, 6301, 6311, 6317, 6323, 6329, 6337, 6343, 6353, 6359, 6361, 6367, 6373, 6379, 6389, 6397, 6421, 6427, 6449, 6451, 6469, 6473, 6481, 6491, 6521, 6529, 6547, 6551, 6553, 6563, 6569, 6571, 6577, 6581, 6599, 6607, 6619, 6637, 6653, 6659, 6661, 6673, 6679, 6689, 6691, 6701, 6703, 6709, 6719, 6733, 6737, 6761, 6763, 6779, 6781, 6791, 6793, 6803, 6823, 6827, 6829, 6833, 6841, 6857, 6863, 6869, 6871, 6883, 6899, 6907, 6911, 6917, 6947, 6949, 6959, 6961, 6967, 6971, 6977, 6983, 6991, 6997, 7001, 7013, 7019, 7027, 7039, 7043, 7057, 7069, 7079, 7103, 7109, 7121, 7127, 7129, 7151, 7159, 7177, 7187, 7193, 7207, 7211, 7213, 7219, 7229, 7237, 7243, 7247, 7253, 7283, 7297, 7307, 7309, 7321, 7331, 7333, 7349, 7351, 7369, 7393, 7411, 7417, 7433, 7451, 7457, 7459, 7477, 7481, 7487, 7489, 7499, 7507, 7517, 7523, 7529, 7537, 7541, 7547, 7549, 7559, 7561, 7573, 7577, 7583, 7589, 7591, 7603, 7607, 7621, 7639, 7643, 7649, 7669, 7673, 7681, 7687, 7691, 7699, 7703, 7717, 7723, 7727, 7741, 7753, 7757, 7759, 7789, 7793, 7817, 7823, 7829, 7841, 7853, 7867, 7873, 7877, 7879, 7883, 7901, 7907, 7919, 7927, 7933, 7937, 7949, 7951, 7963, 7993, 8009, 8011, 8017, 8039, 8053, 8059, 8069, 8081, 8087, 8089, 8093, 8101, 8111, 8117, 8123, 8147, 8161, 8167, 8171, 8179, 8191, 8209, 8219, 8221, 8231, 8233, 8237, 8243, 8263, 8269, 8273, 8287, 8291, 8293, 8297, 8311, 8317, 8329, 8353, 8363, 8369, 8377, 8387, 8389, 8419, 8423, 8429, 8431, 8443, 8447, 8461, 8467, 8501, 8513, 8521, 8527, 8537, 8539, 8543, 8563, 8573, 8581, 8597, 8599, 8609, 8623, 8627, 8629, 8641, 8647, 8663, 8669, 8677, 8681, 8689, 8693, 8699, 8707, 8713, 8719, 8731, 8737, 8741, 8747, 8753, 8761, 8779, 8783, 8803, 8807, 8819, 8821, 8831, 8837, 8839, 8849, 8861, 8863, 8867, 8887, 8893, 8923, 8929, 8933, 8941, 8951, 8963, 8969, 8971, 8999, 9001, 9007, 9011, 9013, 9029, 9041, 9043, 9049, 9059, 9067, 9091, 9103, 9109, 9127, 9133, 9137, 9151, 9157, 9161, 9173, 9181, 9187, 9199, 9203, 9209, 9221, 9227, 9239, 9241, 9257, 9277, 9281, 9283, 9293, 9311, 9319, 9323, 9337, 9341, 9343, 9349, 9371, 9377, 9391, 9397, 9403, 9413, 9419, 9421, 9431, 9433, 9437, 9439, 9461, 9463, 9467, 9473, 9479, 9491, 9497, 9511, 9521, 9533, 9539, 9547, 9551, 9587, 9601, 9613, 9619, 9623, 9629, 9631, 9643, 9649, 9661, 9677, 9679, 9689, 9697, 9719, 9721, 9733, 9739, 9743, 9749, 9767, 9769, 9781, 9787, 9791, 9803, 9811, 9817, 9829, 9833, 9839, 9851, 9857, 9859, 9871, 9883, 9887, 9901, 9907, 9923, 9929, 9931, 9941, 9949, 9967, 9973] #各データについて偶数奇数で場合分け #偶数 if num%2 == 0: if num-1 in primes: return "2" else: return "0" else if num==3: return "1" #奇数 else: c = 0 #カウント for i in range(num): if (i+1)%2==0: continue else: if (i+1) in primes and (num-i) in primes: c += 1 return c if __name__=="__main__": lines = [] for line in sys.stdin: print both_prime(int(line.replace("\n","")))
File "/tmp/tmphy5asfli/tmpbij84aqb.py", line 17 else if num==3: ^^ SyntaxError: expected ':'
s407008918
p00590
u193025715
1394699342
Python
Python
py
Runtime Error
0
0
594
def judge_prime(num): prime_list = [] num_list = [i for i in range(2, num+1)] x = 0 while x**2 < num: x = num_list[0] prime_list.append(x) for j in range(x, num+1, x): if j in num_list: num_list.remove(j) prime_list.extend(num_list) return prime_list while 1: num = int(raw_input()) n_reverse = [i for i in range(num)] n_sort = n_reverse n_reverse.reverse() j_list = judge_prime(num) count = 0 for i in range(num): if n_sort[i] in j_list and n_reverse[i] in j_list: count += 1 print count
File "/tmp/tmp3f2re68e/tmpv4wom2h9.py", line 24 print count ^^^^^^^^^^^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
s731551911
p00590
u193025715
1394699832
Python
Python
py
Runtime Error
0
0
513
def judge_prime(num): prime_list = [] num_list = [i for i in range(2, num+1)] x = 0 while x**2 < num: x = num_list[0] prime_list.append(x) for j in range(x, num+1, x): if j in num_list: num_list.remove(j) prime_list.extend(num_list) return prime_list while 1: n = int(raw_input()) primes = judge_prime(n) count = 0 for i in range(n): if i+1 in primes and (n-i) in primes: count += 1 print count
File "/tmp/tmpdo5djp0q/tmpaic6ktjl.py", line 23 print count ^^^^^^^^^^^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
s365280002
p00590
u193025715
1394699911
Python
Python
py
Runtime Error
0
0
537
import sys def judge_prime(num): prime_list = [] num_list = [i for i in range(2, num+1)] x = 0 while x**2 < num: x = num_list[0] prime_list.append(x) for j in range(x, num+1, x): if j in num_list: num_list.remove(j) prime_list.extend(num_list) return prime_list while 1: n = int(raw_input()) primes = judge_prime(n) count = 0 for i in range(n): if i+1 in primes and (n-i) in primes: count += 1 print count sys.exit()
File "/tmp/tmpd2tcw40p/tmphrvgond8.py", line 25 print count ^^^^^^^^^^^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
s552709501
p00590
u633068244
1394973650
Python
Python
py
Runtime Error
0
0
281
import math r = 10000 sqrt = int(math.sqrt(r)) p = [1 for i in range(r)] p[0] = 0 for i in range(sqrt): if p[i]: p[2*i::i+1] = [0 for j in range(len([2*i::i+1]))] n = int(raw_input()) count = 0 for i in range(n): if p[i] == p[n-i-1]: count += 1 print count
File "/tmp/tmp467yy504/tmpcae3myy4.py", line 8 p[2*i::i+1] = [0 for j in range(len([2*i::i+1]))] ^ SyntaxError: invalid syntax
s636655132
p00590
u633068244
1394973926
Python
Python
py
Runtime Error
0
0
364
r = 10000 sqrt = int(math.sqrt(r)) p = [1 for i in range(r)] p[0] = 0 for i in range(sqrt): if p[i]: p[2*i+1::i+1] = [0 for j in range(2*i+1,r,i+1)] while True: try: n = int(raw_input()) count = 0 for i in range(n): if p[i]*p[n-i-1] == 1: count += 1 print count except: break
File "/tmp/tmpejbsngi3/tmp81s8bxy3.py", line 16 print count ^^^^^^^^^^^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
s799318691
p00590
u633068244
1394974512
Python
Python
py
Runtime Error
0
0
478
import math r = 9999 sqrt = int(math.sqrt(r)) p = [1*r] p[0] = 0 for i in range(sqrt): if p[i]: p[2*i+1::i+1] = [0 for j in range(2*i+1,r,i+1)] prime = [] for i in range(r): if p[i]: prime.append(i) while True: try: n = int(raw_input()) count = 0 for i in prime: if i > n-1: break if p[i] == 1 and p[n-i-1] == 1: count += 1 print count except: break
File "/tmp/tmp1wcgk3fn/tmps2qz55gw.py", line 23 print count ^^^^^^^^^^^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
s860321729
p00590
u633068244
1394974544
Python
Python
py
Runtime Error
0
0
464
import math r = 9999 sqrt = int(math.sqrt(r)) p = [1*r] p[0] = 0 for i in range(sqrt): if p[i]: p[2*i+1::i+1] = [0 for j in range(2*i+1,r,i+1)] prime = [] for i in range(r): if p[i]: prime.append(i) while True: try: n = int(raw_input()) count = 0 for i in prime: if i > n-1: break if p[n-i-1] == 1: count += 1 print count except: break
File "/tmp/tmp99l931nd/tmpz7x_q54e.py", line 23 print count ^^^^^^^^^^^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
s266187938
p00591
u797673668
1460962426
Python
Python3
py
Runtime Error
0
0
315
while True: n = int(input()) if not n: break a = [list(map(int, input().split())) for j in range(n)] c = [max(a[i][j] for i in range(n)) for j in range(n)] r = [min(a[i]) for i in range(n)] print([c[j] for i in range(n) for j, x in enumerate(a[i]) if x == r[i] and c[j] == r[i]][0])
Traceback (most recent call last): File "/tmp/tmp5_o20w91/tmpglge5306.py", line 2, in <module> n = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s235805222
p00591
u662126750
1497282173
Python
Python3
py
Runtime Error
0
0
562
# coding: utf-8 import numpy as np # Here your code ! while True: n = int(input()) if n==0: break map = [[0 for i in range(100)] for j in range(100)] a = [[int(i) for i in input().split()] for i in range(n)] np.array(a) minar = (np.argmin(a, axis = 0))#(0.1.2, X)???????°? maxar = (np.argmax(a, axis = 1))#(X, 0.1.2)????????§ print(maxar) print(minar) for i in range(n): map[i][minar[i]]+=1 map[maxar[i]][i]+=1 for i in range(n): for j in range(n): if map[i][j]>=2: print(a[i][j])
Traceback (most recent call last): File "/tmp/tmp9gtznzlz/tmpruba_uo5.py", line 5, in <module> n = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s223594531
p00591
u662126750
1497282655
Python
Python3
py
Runtime Error
0
0
622
# coding: utf-8 import numpy as np # Here your code ! while True: n = int(input()) flag=0 if n==0: break map = [[0 for i in range(100)] for j in range(100)] a = [[int(i) for i in input().split()] for i in range(n)] np.array(a) maxar = (np.argmax(a, axis = 0))#(X, 0.1.2)????????§ minar = (np.argmin(a, axis = 1))#(0.1.2, X)???????°? for i in range(n): map[i][minar[i]]+=1 map[maxar[i]][i]+=1 for i in range(n): for j in range(n): if map[i][j]>=2: print(a[i][j]) flag=1 if flag==0: print (0)
Traceback (most recent call last): File "/tmp/tmpsb5dp8_6/tmpm5j9u8lz.py", line 5, in <module> n = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s995330934
p00591
u662126750
1497282734
Python
Python3
py
Runtime Error
0
0
646
# coding: utf-8 import numpy as np # Here your code ! while True: n = int(input()) flag=0 if n==0: break map = [[0 for i in range(100)] for j in range(100)] a = [[int(i) for i in input().split()] for i in range(n)] np.array(a) maxar = (np.argmax(a, axis = 0))#(X, 0.1.2)????????§ minar = (np.argmin(a, axis = 1))#(0.1.2, X)???????°? for i in range(n): map[i][minar[i]]+=1 map[maxar[i]][i]+=1 for i in range(n): for j in range(n): if map[i][j]>=2: print(a[i][j]) flag=1 break if flag==0: print ('0')
Traceback (most recent call last): File "/tmp/tmpaxqb7rn5/tmpeondzeb3.py", line 5, in <module> n = int(input()) ^^^^^^^ EOFError: EOF when reading a line