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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
s506167374 | p00092 | u811733736 | 1503376195 | Python | Python3 | py | Runtime Error | 600 | 9180 | 3636 | # -*- coding: utf-8 -*-
"""
http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0092
"""
import sys
def find_square0(data):
max_size = 0
lmap = [] # dp??¨???2?¬??????????
# '.'????????????0??????'*'????????????1????????????
for row in data:
temp = []
for c in row:
if c == '.':
temp.append(1)
else:
temp.append(0)
lmap.append(temp)
# ????±?????????????????????????????????£????????????????????£?????¢????¢??????§??????????????§????????????
for y in range(1, len(lmap)):
for x in range(1, len(lmap[0])):
if lmap[y][x] == 1:
lmap[y][x] = min(lmap[y-1][x-1], min(lmap[y-1][x], lmap[y][x-1])) + 1
if lmap[y][x] > max_size:
max_size = lmap[y][x]
return max_size
def find_square(data):
max_size = 0
lmap = []
for row in data:
temp = []
for c in row:
if c == '.':
temp.append(1)
else:
temp.append(0)
lmap.append(temp)
prev_row = lmap[0]
for curr_row in lmap[1:]:
for x in range(1, len(lmap[0])):
if curr_row[x] == 1:
if prev_row[x-1] != 0 and prev_row[x] != 0 and curr_row[x-1] != 0: # ???????????¶?????????
curr_row[x] = min(prev_row[x-1], min(prev_row[x], curr_row[x-1])) + 1
if curr_row[x] > max_size:
max_size = curr_row[x]
prev_row = curr_row
return max_size
def find_square2(data):
max_size = 0
lmap = [] # dp??¨???2?¬??????????
# '.'????????????0??????'*'????????????1????????????
for row in data:
temp = []
for c in row:
if c == '.':
temp.append(1)
else:
temp.append(0)
lmap.append(temp)
# ????±?????????????????????????????????£????????????????????£?????¢????¢??????§??????????????§????????????
# (?????¨???(curr_row)??¨???????????????(prev_row)????????¢????????????????????§?????????????????????)
prev_row = lmap[0]
for curr_row in lmap[1:]:
for x, t in enumerate(curr_row[1:], start=1):
if t == 1:
curr_row[x] = min(prev_row[x-1], min(prev_row[x], curr_row[x-1])) + 1
if curr_row[x] > max_size:
max_size = curr_row[x]
prev_row = curr_row
return max_size
def find_square3(data):
from array import array
max_size = 0
lmap = [array('B', [0]*len(data[0])) for _ in range(len(data))]
# '.'????????????0??????'*'????????????1????????????
for y, row in enumerate(data):
for x, c in enumerate(row):
if c == '.':
lmap[y][x] = 1
# ????±?????????????????????????????????£????????????????????£?????¢????¢??????§??????????????§????????????
# (?????¨???(curr_row)??¨???????????????(prev_row)????????¢????????????????????§?????????????????????)
prev_row = lmap[0]
for curr_row in lmap[1:]:
for x, t in enumerate(curr_row[1:], start=1):
if t == 1:
curr_row[x] = min(prev_row[x-1], min(prev_row[x], curr_row[x-1])) + 1
if curr_row[x] > max_size:
max_size = curr_row[x]
prev_row = curr_row
return max_size
def main(args):
while True:
n = int(input())
if n == 0:
break
data = [input() for _ in range(n)]
result = find_square3(data)
print(result)
if __name__ == '__main__':
main(sys.argv[1:]) | Traceback (most recent call last):
File "/tmp/tmpx_sp6t36/tmpm00w6snp.py", line 115, in <module>
main(sys.argv[1:])
File "/tmp/tmpx_sp6t36/tmpm00w6snp.py", line 106, in main
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s234463879 | p00092 | u811733736 | 1503883301 | Python | Python3 | py | Runtime Error | 0 | 0 | 3160 | # -*- coding: utf-8 -*-
"""
http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0092
"""
import sys
def find_square0(data):
max_size = 0
dp = [] # dp??¨???2?¬??????????
# '.'????????????1??????'*'????????????0????????????
for row in data:
temp = []
for c in row:
if c == '.':
temp.append(1)
else:
temp.append(0)
dp.append(temp)
# ????±?????????????????????????????????£????????????????????£?????¢????¢??????§??????????????§????????????
for y in range(1, len(dp)):
for x in range(1, len(dp[0])):
if dp[y][x] == 1:
dp[y][x] = min(dp[y-1][x-1], dp[y-1][x], dp[y][x-1]) + 1
if dp[y][x] > max_size:
max_size = dp[y][x]
return max_size
def find_square2(data):
max_size = 0
dp = [[0]*len(data[0]) for _ in range(len(data))] # dp??¨???2?¬???????????????¨??????0??§?????????
# '.'????????????1???
for y, row in enumerate(data):
for x, c in enumerate(row):
if c == '.':
dp[y][x] = 1
# (?????¨???(curr_row)??¨???????????????(prev_row)????????¢????????????????????§?????????????????????)
prev_row = dp[0]
for curr_row in dp[1:]:
for x, t in enumerate(curr_row[1:], start=1):
if t == 1:
curr_row[x] = min(prev_row[x-1], prev_row[x], curr_row[x-1]) + 1
if curr_row[x] > max_size:
max_size = curr_row[x]
prev_row = curr_row
return max_size
def find_square3(data):
from array import array
max_size = 0
dp = [array('I', [0]*len(data[0])) for _ in range(len(data))] # ????¬?????????????array??????????????§?¢????
# '.'????????????1???
for y, row in enumerate(data):
for x, c in enumerate(row):
if c == '.':
dp[y][x] = 1
prev_row = dp[0]
for curr_row in dp[1:]:
for x, t in enumerate(curr_row[1:], start=1):
if t == 1:
curr_row[x] = min(prev_row[x-1], prev_row[x], curr_row[x-1]) + 1
if curr_row[x] > max_size:
max_size = curr_row[x]
prev_row = curr_row
return max_size
def find_square4(data):
max_size = 0
dp = [[0]*1024*1024]
# '.'????????????1???
for y, row in enumerate(data):
for x, c in enumerate(row):
if c == '.':
dp[y*1024+x] = 1
# ????±?????????????????????????????????£????????????????????£?????¢????¢??????§??????????????§????????????
for y in range(1, len(dp)):
for x in range(1, len(dp[0])):
if dp[y*1024+x] == 1:
dp[y*1024+x] = min(dp[(y-1)*1024+x-1], dp[(y-1)*1024+x], dp[y*1024+x-1]) + 1
if dp[y*1024+x] > max_size:
max_size = dp[y*1024+x]
return max_size
def main(args):
while True:
n = int(input())
if n == 0:
break
data = [input() for _ in range(n)]
result = find_square4(data)
print(result)
if __name__ == '__main__':
main(sys.argv[1:]) | Traceback (most recent call last):
File "/tmp/tmpckj63xdv/tmpmi28y1gw.py", line 104, in <module>
main(sys.argv[1:])
File "/tmp/tmpckj63xdv/tmpmi28y1gw.py", line 95, in main
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s138758294 | p00092 | u633068244 | 1393862635 | Python | Python | py | Runtime Error | 0 | 0 | 467 | n = int(raw_input())
s = [[] for i in range(n)]
flag = 0
for i in range(n):
s[i] = raw_input()
for i in range(n,1,-1):
for j in range(n-i+1):
for k in range(n-i+1):
out = ""
for l in range(i):
for m in range(i):
out += s[j+l][k+m]
if out = "."*i:
print i
flag = 1
if flag == 1: break
if flag == 1: break
if flag == 1: break | File "/tmp/tmpqwiyf5yi/tmp0t6zlvhw.py", line 13
if out = "."*i:
^^^^^^^^^^^
SyntaxError: invalid syntax. Maybe you meant '==' or ':=' instead of '='?
| |
s092216690 | p00092 | u633068244 | 1393863082 | Python | Python | py | Runtime Error | 0 | 0 | 662 | while True:
n = int(raw_input())
if n == 0:
break
s = [[] for i in range(n)]
flag = 0
for i in range(n):
s[i] = raw_input()
for i in range(n,1,-1):
for j in range(n-i+1):
for k in range(n-i+1):
out = ""
for l in range(i):
for m in range(i):
out += s[j+l][k+m]
if out.count("*") == 0:
print i
flag = 1
if flag == 1: break
if flag == 1: break
if flag == 1: break
if flag == 0:
print 1 | File "/tmp/tmp4duevyrp/tmpij0mez4s.py", line 17
print i
^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s313148355 | p00092 | u633068244 | 1393863566 | Python | Python | py | Runtime Error | 0 | 0 | 656 | while True:
n = int(raw_input())
if n == 0:
break
s = [[] for i in range(n)]
for i in range(n):
s[i] = raw_input()
for i in range(n,0,-1):
for j in range(n-i+1):
for k in range(n-i+1):
flag = 0
for l in range(i):
for m in range(i):
if s[j+l][k+m] = "*":
flag = 1
break
if flag == 0:
print i
else:
break
if flag == 1: break
if flag == 1: break
if flag == 0:
print 0 | File "/tmp/tmp4mxi3ri6/tmpxc93d2yl.py", line 14
if s[j+l][k+m] = "*":
^^^^^^^^^^^
SyntaxError: cannot assign to subscript here. Maybe you meant '==' instead of '='?
| |
s605631808 | p00092 | u633068244 | 1396089665 | Python | Python | py | Runtime Error | 0 | 0 | 383 | l = {".":1,"*":0}
def x(a):
m=0
for c in N:
p=[0]*n
for e in range(c,n):
for r in N:
p[r]+=l[a[r][e]]
m=max(P(p),m)
return m
def P(a):
m = 0
for i in N:
m+=l[a[i]]
return m
while True:
n = input()
if n == 0: break
N = range(n)
print x([map(int, raw_input().split()) for i in N]) | File "/tmp/tmpfqpjsa_f/tmpowdiy19n.py", line 20
print x([map(int, raw_input().split()) for i in N])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s915596331 | p00093 | u912237403 | 1413923869 | Python | Python | py | Runtime Error | 0 | 0 | 221 | f=0
while 1:
a, b = map(int, raw_input().split())
if a==b==0: break
x = [i for i in range(a, b+1) if (i%4 == 0 and (i%100 != 0 or i%400 == 0))]
if x==[]: x=["NA"]
if f: print
for e in x: print e
f=1 | File "/tmp/tmpqy5pcd0w/tmpivffwkdt.py", line 3
a, b = map(int, raw_input().split())
^
SyntaxError: invalid non-printable character U+3000
| |
s788163978 | p00093 | u647766105 | 1429611333 | Python | Python3 | py | Runtime Error | 0 | 0 | 243 | from calendar import isleap
f = lambda x: map(str, x) if x else ["NA"]
ans = []
while True:
a, b = map(int, raw_input().split())
if b == 0:
break
ans += f(filter(isleap, xrange(a, b+1))) + [""]
print("\n".join(ans).strip()) | Traceback (most recent call last):
File "/tmp/tmpntdf9u1q/tmpm6gth0sz.py", line 5, in <module>
a, b = map(int, raw_input().split())
^^^^^^^^^
NameError: name 'raw_input' is not defined
| |
s890180512 | p00093 | u647766105 | 1429611358 | Python | Python3 | py | Runtime Error | 0 | 0 | 238 | from calendar import isleap
f = lambda x: map(str, x) if x else ["NA"]
ans = []
while True:
a, b = map(int, input().split())
if b == 0:
break
ans += f(filter(isleap, range(a, b+1))) + [""]
print("\n".join(ans).strip()) | Traceback (most recent call last):
File "/tmp/tmpwwnsgl6b/tmppzb_vy_t.py", line 5, in <module>
a, b = map(int, input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s970388684 | p00093 | u765849500 | 1466174916 | Python | Python | py | Runtime Error | 0 | 0 | 275 | line = False
while True:
a,b = map(int, raw_input().split())
if line: print ""
line = True
count = 0
for i in range(a, b+1):
if (i % 4 == 0 and i % 100 != 0) or i % 400 == 0:
print i
count += 1
if count == 0: print "NA" | File "/tmp/tmpgqh4r7x2/tmpigtwxxl5.py", line 4
if line: print ""
^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s839167615 | p00093 | u453324819 | 1478079072 | Python | Python3 | py | Runtime Error | 0 | 0 | 353 | <?php
$jikan = 0;
while(true) {
$cnt = 0;
$stdin = trim(fgets(STDIN));
if($stdin === '0 0') {
break;
}
$years = explode(' ', $stdin);
for ($i=$years[0]; $i < $years[1]; $i++) {
if($i%4 === 0 && $i%100 !== 0 || $i%400 === 0) {
print($i . "\n");
$cnt++;
}
}
if ($cnt == 0){
print("NA\n");
}
print("\n");
} | File "/tmp/tmpm3775e72/tmpc5djxofg.py", line 1
<?php
^
SyntaxError: invalid syntax
| |
s904737371 | p00093 | u584779197 | 1495952855 | Python | Python | py | Runtime Error | 0 | 0 | 236 | year = input()
bb = year.split(' ')
a = bb[0]
b = bb[1]
ans = 0
for i in range(a,b+1):
if i%4==0:
ans += 1
if 1%100==0:
ans -= 1
if 1%400==0:
ans += 1
if ans == 0:
print('NA')
else:
print(ans) | Traceback (most recent call last):
File "/tmp/tmpk306yg68/tmp1huyffz4.py", line 1, in <module>
year = input()
^^^^^^^
EOFError: EOF when reading a line
| |
s826333919 | p00093 | u519227872 | 1497528901 | Python | Python3 | py | Runtime Error | 0 | 0 | 329 | f = set(range(0,3000,4))
h = set(range(0,3000,100))
fh = set(range(0,3000,400))
lp = (f -h).union(fh)
while True:
f,l = list(map(int, input().split()))
if f == 0 and l == 0:
break
t = set(range(f,l+1))
it = sorted(list(lp.intersection(t)))
for y in t:
print(y)
if lent(it) == 0:
print('NA')
print (' ') | Traceback (most recent call last):
File "/tmp/tmpfbc66emc/tmp_oidwd2r.py", line 7, in <module>
f,l = list(map(int, input().split()))
^^^^^^^
EOFError: EOF when reading a line
| |
s371606747 | p00093 | u546285759 | 1503641644 | Python | Python3 | py | Runtime Error | 0 | 0 | 155 | from calender import isleap
while True:
a, b = map(int, input().split())
if a == 0:
break
print(sum(isleap(i) for i in range(a, b+1))) | Traceback (most recent call last):
File "/tmp/tmprnyfzc0n/tmpdaf7o_wn.py", line 1, in <module>
from calender import isleap
ModuleNotFoundError: No module named 'calender'
| |
s270545103 | p00093 | u150984829 | 1522356976 | Python | Python3 | py | Runtime Error | 0 | 0 | 165 | b=0
for e in iter(input,'0 0'):
if b:print()
b=u=1
s,t=map(int,e.split())
for y in range(s,t+1)if y%4==0 and y%100!=0 or y%400==0:print(y);u=0
if u:print('NA')
| File "/tmp/tmplimq992z/tmp8jvxuvxo.py", line 6
for y in range(s,t+1)if y%4==0 and y%100!=0 or y%400==0:print(y);u=0
^
SyntaxError: invalid syntax
| |
s124393553 | p00093 | u150984829 | 1522357477 | Python | Python3 | py | Runtime Error | 0 | 0 | 159 | p=print
b=0
for e in iter(input,'0 0'):
if b:p()
b=f=1;s,t=map(int,e.split())
for y in range(s,t+1):
if(y%4==0)*(y%100)or y%400==0:p(y);f=0
if u:p('NA')
| Traceback (most recent call last):
File "/tmp/tmpgde0ocpg/tmpo1e7ikgq.py", line 3, in <module>
for e in iter(input,'0 0'):
EOFError: EOF when reading a line
| |
s185302090 | p00093 | u735362704 | 1355888939 | Python | Python | py | Runtime Error | 0 | 0 | 767 | [year for year in xrange(2000, 2100 + 1) if (year % 4 ==0) and (year % 100 != 0)]
#!/usr/bin/env python
# coding: utf-8
import sys
def is_bis_year(year):
if (year % 4 == 0) and (year % 100 != 0):
return True
elif (year % 400 == 0):
return True
return False
def main():
params = []
while 1:
input_line = sys.stdin.readline().rstrip()
if input_line == "0 0":
break
else:
params.append([int(year) for year in input_line.split(" ")])
for param in params:
min_year, max_year = param
bis_years = [year for year in xrange(min_year, max_year + 1) if is_bis_year(year)]
if len(bis_years) == 0:
print "NA"
else:
print "\n".join(bis_years)
print
if __name__ == "__main__":
main() | File "/tmp/tmpczvko5wo/tmp0roo14wz.py", line 34
print "NA"
^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s162794609 | p00093 | u776234460 | 1367475561 | Python | Python | py | Runtime Error | 0 | 0 | 501 | import sys
a = int(sys.argv[1])
b = int(sys.argv[2])
flag = False
if a < 0 or a > b or a > 3000 or b > 3000:
print "exit"
sys.exit()
for y in range(a, b + 1):
if y % 4 == 0:
if y % 100 == 0 and y % 400 == 0:
print y
flag = True
elif y % 100 != 0:
print y
flag = True
else:
if not bool(flag):
print "NA"
print "" | File "/tmp/tmpfedze_os/tmp1j_71uyc.py", line 8
print "exit"
^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s748798630 | p00093 | u776234460 | 1367475587 | Python | Python | py | Runtime Error | 0 | 0 | 500 | import sys
a = int(sys.argv[1])
b = int(sys.argv[2])
flag = False
if a < 0 or a > b or a > 3000 or b > 3000:
print "exit"
sys.exit()
for y in range(a, b + 1):
if y % 4 == 0:
if y % 100 == 0 and y % 400 == 0:
print y
flag = True
elif y % 100 != 0:
print y
flag = True
else:
if not bool(flag):
print "NA"
print "" | File "/tmp/tmpq9m_4f3g/tmpwmxq7tvx.py", line 8
print "exit"
^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s681841792 | p00093 | u776234460 | 1367475673 | Python | Python | py | Runtime Error | 0 | 0 | 498 | import sys
a = int(sys.argv[1])
b = int(sys.argv[2])
flag = False
if a < 0 or a > b or a > 3000 or b > 3000:
print "exit"
sys.exit()
for y in range(a, b + 1):
if y % 4 == 0:
if y % 100 == 0 and y % 400 == 0:
print y
flag = True
elif y % 100 != 0:
print y
flag = True
else:
if not bool(flag):
print "NA"
print "" | File "/tmp/tmpbfiktty_/tmpo9z3gspw.py", line 7
print "exit"
^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s523183028 | p00094 | u442166898 | 1454569410 | Python | Python | py | Runtime Error | 0 | 0 | 112 |
if __name__=="__main__":
a=int(raw_input())
b=int(raw_input())
a=a*b
print a/3.305785
| File "/tmp/tmpwrfjbksh/tmpk1ate7cx.py", line 6
print a/3.305785
^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s171527852 | p00094 | u376883550 | 1456705629 | Python | Python | py | Runtime Error | 0 | 0 | 47 | print eval(raw_input().replace(' ','*')/3.30578 | File "/tmp/tmpr0stswd1/tmp7kwbe_28.py", line 1
print eval(raw_input().replace(' ','*')/3.30578
^
SyntaxError: '(' was never closed
| |
s239458231 | p00094 | u811773570 | 1459168943 | Python | Python3 | py | Runtime Error | 0 | 0 | 76 | #coding:utf-8
a, b = map(int, raw_input(). split())
print(a * b / 3.305785) | Traceback (most recent call last):
File "/tmp/tmpullob8gb/tmpuac1cmn7.py", line 3, in <module>
a, b = map(int, raw_input(). split())
^^^^^^^^^
NameError: name 'raw_input' is not defined
| |
s273343005 | p00094 | u606989659 | 1490773048 | Python | Python3 | py | Runtime Error | 0 | 0 | 56 | def tsubo(a,b):
return (a * b) / 3.305785
tsubo(a,b) | Traceback (most recent call last):
File "/tmp/tmpxwnf9ios/tmpz7ex43ud.py", line 3, in <module>
tsubo(a,b)
^
NameError: name 'a' is not defined
| |
s657496271 | p00094 | u606989659 | 1490773201 | Python | Python3 | py | Runtime Error | 0 | 0 | 69 | def tsubo(a,b):
return (a * b) / 3.305785
S = tsubo(a,b)
print(S) | Traceback (most recent call last):
File "/tmp/tmp1h5wtfc8/tmp422ytdf1.py", line 3, in <module>
S = tsubo(a,b)
^
NameError: name 'a' is not defined
| |
s969249636 | p00094 | u606989659 | 1490774345 | Python | Python3 | py | Runtime Error | 0 | 0 | 70 | def tsubo(x,y):
return (x * y) / 3.305785
S = tsubo(a,b)
print(S) | Traceback (most recent call last):
File "/tmp/tmps7oe9yv2/tmpihwlbczx.py", line 3, in <module>
S = tsubo(a,b)
^
NameError: name 'a' is not defined
| |
s476433268 | p00094 | u519227872 | 1498837954 | Python | Python3 | py | Runtime Error | 0 | 0 | 65 | a,b = map(float,raw_input().split(' '))
print((a * b) / 3.305785) | Traceback (most recent call last):
File "/tmp/tmp31ip1w1y/tmplldlq80y.py", line 1, in <module>
a,b = map(float,raw_input().split(' '))
^^^^^^^^^
NameError: name 'raw_input' is not defined
| |
s124212761 | p00094 | u230836528 | 1366800934 | Python | Python | py | Runtime Error | 0 | 0 | 80 | #coding: utf-8
A = map(int, input().split())
S = A[0] * A[1]
print S / 3.305785 | File "/tmp/tmpz_d8yrpb/tmp5dyy8f_z.py", line 5
print S / 3.305785
^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s335119421 | p00094 | u230836528 | 1366801140 | Python | Python | py | Runtime Error | 0 | 0 | 102 | sA = raw_input()
idx = sA.index(" ")
a = int(sA[:idx])
b = int(sA[idx+1:]
S = a * b
print S / 3.305785 | File "/tmp/tmp4q11m4bv/tmpgrbf4i__.py", line 4
b = int(sA[idx+1:]
^
SyntaxError: '(' was never closed
| |
s368556064 | p00095 | u912237403 | 1413985677 | Python | Python | py | Runtime Error | 0 | 0 | 132 | n=input()
a0,v0=inf,0
for i in range(n):
a,v=map(int,raw_input().split())
if v>v0: a0,v0=a,v
elif v=v0: a0=min(a0,a)
print a,v | File "/tmp/tmp5wz5wtyh/tmpla0ordqv.py", line 6
elif v=v0: a0=min(a0,a)
^^^^
SyntaxError: invalid syntax. Maybe you meant '==' or ':=' instead of '='?
| |
s563357548 | p00095 | u912237403 | 1413985713 | Python | Python | py | Runtime Error | 0 | 0 | 130 | n=input()
a0,v0=n,0
for i in range(n):
a,v=map(int,raw_input().split())
if v>v0: a0,v0=a,v
elif v=v0: a0=min(a0,a)
print a,v | File "/tmp/tmppshujnrc/tmpdpyk3_q9.py", line 6
elif v=v0: a0=min(a0,a)
^^^^
SyntaxError: invalid syntax. Maybe you meant '==' or ':=' instead of '='?
| |
s468696037 | p00095 | u463990569 | 1452945480 | Python | Python3 | py | Runtime Error | 0 | 0 | 297 | from operator import itemgetter
from collections import OrderedDict
n, q = [int(el) for el in input().split(' ')]
data = OrderedDict({i:0 for i in range(n,0,-1)})
for _ in range(q):
a, v = [int(el) for el in input().split(' ')]
data[a] += v
print(*max(data.items(), key=itemgetter(1))) | Traceback (most recent call last):
File "/tmp/tmpiblld8nt/tmpxxtnrhhq.py", line 3, in <module>
n, q = [int(el) for el in input().split(' ')]
^^^^^^^
EOFError: EOF when reading a line
| |
s632842833 | p00095 | u463990569 | 1452945760 | Python | Python3 | py | Runtime Error | 0 | 0 | 264 | from operator import itemgetter
from collections import OrderedDict
n = int(input())
data = OrderedDict({i:0 for i in range(n,0,-1)})
for _ in range(n):
a, v = [int(el) for el in input().split(' ')]
data[a] += v
print(*max(data.items(), key=itemgetter(1))) | Traceback (most recent call last):
File "/tmp/tmpvixh8kka/tmphy1tkdu5.py", line 3, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s133594988 | p00095 | u463990569 | 1452945992 | Python | Python3 | py | Runtime Error | 0 | 0 | 174 | n = int(input())
data = [0] * n
for _ in range(n):
a, v = [int(el) for el in input().split(' ')]
data[a-1] += v
result = max(data)
print(data.index(result)+1, result) | Traceback (most recent call last):
File "/tmp/tmp07gb9whf/tmpsez7r0yr.py", line 1, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s799083832 | p00095 | u519227872 | 1497452381 | Python | Python3 | py | Runtime Error | 0 | 0 | 213 | from operator import itemgetter
n = int(input())
rs = [list(map(int(),input().split())) for i in range(n)]
rs = sorted(rs,key=itemgetter(0))
print(' '.join(map(str, sorted(rs, key=itemgetter(1),reverse=True)[0]))) | Traceback (most recent call last):
File "/tmp/tmp3b2ecj_2/tmpouyxv030.py", line 2, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s853249821 | p00095 | u150984829 | 1522359154 | Python | Python3 | py | Runtime Error | 0 | 0 | 123 | d={}
for _ in[0]*int(input()):
a,v=map(int,input().split())
d[a]=v
m=max(d.items(),key=lambda x:x[1])
print(min(d[m]),m)
| Traceback (most recent call last):
File "/tmp/tmpk9qdv_xd/tmpxavfr3di.py", line 2, in <module>
for _ in[0]*int(input()):
^^^^^^^
EOFError: EOF when reading a line
| |
s312011410 | p00095 | u150984829 | 1522359184 | Python | Python3 | py | Runtime Error | 0 | 0 | 126 | d={}
for _ in[0]*int(input()):
a,v=map(int,input().split())
d[a]=v
m=max(d.items(),key=lambda x:x[1])[0]
print(m,min(d[m]))
| Traceback (most recent call last):
File "/tmp/tmpum8w866h/tmpamixz2eh.py", line 2, in <module>
for _ in[0]*int(input()):
^^^^^^^
EOFError: EOF when reading a line
| |
s252953182 | p00095 | u230836528 | 1366801766 | Python | Python | py | Runtime Error | 0 | 0 | 310 | # coding: utf-8
n = input()
A = []
for i in xrange(n):
A.append( map(int, raw_input().split()) )
Max = -1
Maxidx = -1
for i in xrange(n):
if Max < A[i][1]:
Max = A[i][1]
Maxidx = i
elif Max = A[i][1] and A[Maxidx][0] > A[i][0]:
Maxidx = i
print A[Maxidx][0], A[Maxidx][1] | File "/tmp/tmps60f86d9/tmp2s1laimr.py", line 14
elif Max = A[i][1] and A[Maxidx][0] > A[i][0]:
^^^^^^^^^^^^^
SyntaxError: invalid syntax. Maybe you meant '==' or ':=' instead of '='?
| |
s536115046 | p00095 | u491763171 | 1396405374 | Python | Python | py | Runtime Error | 0 | 0 | 132 | L = []
for i in range(input()):
L.append(map(int, raw_input().split()))
print "%d %d" % sorted(L, key=lambda a:(-a[1], a[0]))[0] | File "/tmp/tmpnlaown7x/tmpql0df8kx.py", line 4
print "%d %d" % sorted(L, key=lambda a:(-a[1], a[0]))[0]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s320637656 | p00096 | u912237403 | 1414032213 | Python | Python | py | Runtime Error | 20 | 4240 | 148 | import sys
n=1001
a=range(1,n)
a+=[n]+a[::-1]
for n in map(int,sys.stdin):
x=0
for i in range(max(0,n-2000),n+1):
x+=a[i]*a[n-i]
print x | File "/tmp/tmpyff4f4k_/tmpff908qb0.py", line 11
print x
^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s485033425 | p00096 | u912237403 | 1414066101 | Python | Python | py | Runtime Error | 20 | 4244 | 148 | import sys
n=1001
a=range(1,n)
a+=[n]+a[::-1]
for n in map(int,sys.stdin):
x=0
for i in range(max(0,n-2000),n+1):
x+=a[i]*a[n-i]
print x | File "/tmp/tmpqpo97f7k/tmpoah9l0p5.py", line 11
print x
^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s128145265 | p00096 | u912237403 | 1414095451 | Python | Python | py | Runtime Error | 0 | 0 | 145 | n=1001
a=range(1,n)
a+=[n]+a[::-1]
for n in map(int,sys.stdin):
x=0
for i in range(max(0,n-2000),min(n,2000)+1):
x+=a[i]*a[n-i]
print x | File "/tmp/tmpm8elt287/tmpgu54fg26.py", line 8
print x
^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s954669243 | p00096 | u462831976 | 1493491114 | Python | Python3 | py | Runtime Error | 4030 | 7732 | 343 | # -*- coding: utf-8 -*-
import sys
import os
import math
for s in sys.stdin:
n = int(s)
T = [0] * 2001
for a in range(1001):
for b in range(1001):
T[a+b] += 1
sum_n_num = 0
for a_b_sum in range(0, n+1):
c_d_sum = n - a_b_sum
sum_n_num += T[a_b_sum] * T[c_d_sum]
print(sum_n_num) | ||
s039915514 | p00096 | u462831976 | 1493491520 | Python | Python | py | Runtime Error | 0 | 0 | 336 | for s in sys.stdin:
n = int(s)
T = [0] * 2001
for a in range(1001):
for b in range(1001):
T[a+b] += 1
sum_n_num = 0
for a_b_sum in range(0, n+1):
c_d_sum = n - a_b_sum
if a_b_sum <= 2000 and c_d_sum <= 2000:
sum_n_num += T[a_b_sum] * T[c_d_sum]
print(sum_n_num) | Traceback (most recent call last):
File "/tmp/tmp0n7n7g9d/tmpgxfnh9hz.py", line 1, in <module>
for s in sys.stdin:
^^^
NameError: name 'sys' is not defined
| |
s425358622 | p00096 | u352394527 | 1527627028 | Python | Python3 | py | Runtime Error | 20 | 5792 | 243 | two_dict = {}
for i in range(2001):
two_dict[i] = min(i, 2000 - i) + 1
while True:
try:
n = int(input())
ans = 0
for i in range(n + 1):
ans += two_dict[i] * two_dict[n - i]
print(ans)
except EOFError:
break
| ||
s836351514 | p00096 | u136916346 | 1528808757 | Python | Python3 | py | Runtime Error | 20 | 5668 | 129 | import sys,math
f=lambda x:math.factorial(x)
[print(i) for i in [int(f(int(l[:-1])+3)/f(3)/f(int(l[:-1]))) for l in sys.stdin]]
| ||
s196221988 | p00096 | u136916346 | 1528809980 | Python | Python3 | py | Runtime Error | 20 | 5672 | 129 | import sys,math
f=lambda x:math.factorial(x)
[print(i) for i in [int(f(int(l[:-1])+3)/f(3)/f(int(l[:-1]))) for l in sys.stdin]]
| ||
s078627188 | p00096 | u230836528 | 1366802394 | Python | Python | py | Runtime Error | 0 | 0 | 273 | # coding: utf-8
def nCr(n, r):
ret = 1
for i in xrange(r):
ret *= (n-i)
ret /= (i+1)
return ret
A = []
while True:
sA = raw_input()
if not sA:
break
A.append( int(sA) )
for i in xrange( len(A) ):
print nCr( A[i]+3, 3 ) | File "/tmp/tmphkgh3iqe/tmppiahnww6.py", line 18
print nCr( A[i]+3, 3 )
^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s908651306 | p00096 | u230836528 | 1366802540 | Python | Python | py | Runtime Error | 0 | 0 | 282 | # coding: utf-8
def nCr(n, r):
ret = 1
for i in xrange(r):
ret *= (n-i)
ret /= (i+1)
return ret
A = []
for i in xrange(50):
sA = raw_input()
if not sA:
break
A.append( int(sA) )
for i in xrange( len(A) ):
print nCr( A[i]+3, 3 ) | File "/tmp/tmp15d2gau7/tmpymr3quo2.py", line 18
print nCr( A[i]+3, 3 )
^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s596501927 | p00096 | u633068244 | 1393956827 | Python | Python | py | Runtime Error | 0 | 0 | 11 | while True: | File "/tmp/tmpxjaw7e4x/tmpj5plq650.py", line 1
while True:
IndentationError: expected an indented block after 'while' statement on line 1
| |
s285589176 | p00096 | u633068244 | 1394000909 | Python | Python | py | Runtime Error | 0 | 0 | 273 | import sys
def N(n):
return (n+1)*(n+2)*(n+3)/6
for n in sys.stdin:
n = int(raw_input())
if n > 2000:
n = 4000 - n
if n < 1001:
print N(n)
else:
m = n - 1000
print N(n) - (N(2*m) - m - 1)/2 | File "/tmp/tmpb5xl665u/tmpj9scbo5q.py", line 9
print N(n)
^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s538090778 | p00097 | u879226672 | 1425442789 | Python | Python | py | Runtime Error | 0 | 0 | 611 | while True:
try:
n,s = map(int,raw_input().split())
except EOFError:
break
if (n,s) == (0,0):
break
if s == 0 or s == 1 or s == 2:
else:
ls = set([])
for k in range(s):
for l in range(1,s):
if k + l > s:
break
for m in range(2,s):
tmp = k + l + m
if tmp == s and k!=l and l!=m and m!=k:
tmp2 = tuple(sorted((k,l,m)))
ls.add(tmp2)
break
print len(ls)
| File "/tmp/tmplwx59z_m/tmpqk5m2_ja.py", line 10
else:
^
IndentationError: expected an indented block after 'if' statement on line 9
| |
s714805597 | p00097 | u489809100 | 1447774291 | Python | Python | py | Runtime Error | 0 | 0 | 231 | import itertools
while True:
n,s = map(int,raw_input().split())
if n == 0 and s == 0:
break
num = list(itertools.combinations(xrange(101), n))
count = 0
for var in num:
if sum(var) == s:
count += 1
print count | File "/tmp/tmpl89pp8x1/tmpcbsguhk5.py", line 15
print count
^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s153456725 | p00097 | u813384600 | 1383746355 | Python | Python | py | Runtime Error | 0 | 0 | 252 | dp = [[0] * 1001 for i in range(11)]
dp[0][0] = 1
for i in range(101):
for j in range(9, -1, -1):
for k in range(0, 1001 - i):
dp[j + 1][k + i] += dp[j][k]
while True:
n, s = map(int, raw_input().split())
print dp[n][s] | File "/tmp/tmp4ry61it5/tmpa99042bk.py", line 10
print dp[n][s]
^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s322379196 | p00097 | u260980560 | 1397481488 | Python | Python | py | Runtime Error | 0 | 0 | 499 | memo = [[[-1 for i in xrange(101)] for j in xrange(10)] for k in xrange(1001)]
def dfs(rest, now, cnt):
if rest==0 and now==0:
return 1
if now==0 or cnt==-1:
return 0
if memo[rest][now][cnt]!=-1:
return memo[rest][now][cnt]
memo[rest][now][cnt] = 0
for i in xrange(min(cnt, rest), -1, -1):
memo[rest][now][cnt] += dfs(rest-i, now-1, i-1)
return memo[rest][now][cnt]
while True:
n, s = map(int, raw_input().split())
print dfs(s, n, 100) | File "/tmp/tmpjfbwc_le/tmpsf6d615t.py", line 15
print dfs(s, n, 100)
^^^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s203531064 | p00099 | u260980560 | 1443601213 | Python | Python | py | Runtime Error | 0 | 0 | 689 | class SegmentTree:
def __init__(self, n):
n_ = 1
while n_ < n: n_ *= 2
self.n = n_
self.data = [[0, -n_] for i in xrange(2*n_)]
def add(self, k, a):
idx = k + (self.n-1)
data = self.data
data[idx] = [data[idx][0] + a, -k]
print data, idx, data[idx]
while idx:
idx = (idx - 1) / 2
data[idx] = max(data[2*idx+1], data[2*idx+2])
print idx, data[idx]
def get(self):
return self.data[0]
inputs = lambda: map(int, raw_input().split())
n, q = inputs()
st = SegmentTree(n)
for t in xrange(q):
a, v = inputs()
st.add(a, v)
p, q = st.get()
print -q, p | File "/tmp/tmpjtx9m5w7/tmpsu_6_yps.py", line 12
print data, idx, data[idx]
^^^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s476148805 | p00099 | u260980560 | 1443601469 | Python | Python | py | Runtime Error | 0 | 0 | 610 | class SegmentTree:
def __init__(self, n):
n_ = 1
while n_ < n: n_ *= 2
self.n = n_
self.data = [(0, -n_-1)] * (2*n_)
def add(self, k, a):
idx = k + (self.n-1)
data = self.data
data[idx] = (data[idx][0] + a, -k)
while idx:
idx = (idx - 1) / 2
data[idx] = max(data[2*idx+1], data[2*idx+2])
def get(self):
return self.data[0]
inputs = lambda: map(int, raw_input().split())
n, q = inputs()
st = SegmentTree(n)
for t in xrange(q):
a, v = inputs()
st.add(a, v)
p, q = st.get()
print -q, p | Traceback (most recent call last):
File "/tmp/tmpuivt9y19/tmpy38dkcry.py", line 20, in <module>
n, q = inputs()
^^^^^^^^
File "/tmp/tmpuivt9y19/tmpy38dkcry.py", line 19, in <lambda>
inputs = lambda: map(int, raw_input().split())
^^^^^^^^^
NameError: name 'raw_input' is not defined
| |
s249199137 | p00099 | u766477342 | 1444141145 | Python | Python3 | py | Runtime Error | 0 | 0 | 573 | n, q = list(map(int, input().split()))
cnt = [0 for _ in range(n + 1)]
cnt[0] = -1
mx = [0, -1]
for _ in range(q):
a, v = list(map(int, input().split()))
cnt[a] += v
if mx[0] == a and v > 0:
mx[1] += v
elif mx[0] == a and v < 0:
def spam():
max_v = max(cnt)
idx = min([i for i, value in enumerate(cnt) if value == max_v])
return idx, max_v
mx = spam()
if cnt[a] > mx[1]:
print("%d %d" % (a, cnt[a]))
mx[0], mx[1] = a, cnt[a]
else:
print("%d %d" % (mx[0], mx[1])) | Traceback (most recent call last):
File "/tmp/tmpm8gg6jag/tmpbd5bse1v.py", line 1, in <module>
n, q = list(map(int, input().split()))
^^^^^^^
EOFError: EOF when reading a line
| |
s319946515 | p00099 | u766477342 | 1444141453 | Python | Python3 | py | Runtime Error | 0 | 0 | 543 | n, q = list(map(int, input().split()))
cnt = [0 for _ in range(n + 1)]
cnt[0] = -1
mx = [0, -1]
def spam():
max_v = max(cnt)
idx = min([i for i, value in enumerate(cnt) if value == max_v])
return idx, max_v
for _ in range(q):
a, v = list(map(int, input().split()))
cnt[a] += v
if mx[0] == a and v > 0:
mx[1] += v
elif mx[0] == a and v < 0:
mx = spam()
if cnt[a] > mx[1]:
print("%d %d" % (a, cnt[a]))
mx[0], mx[1] = a, cnt[a]
else:
print("%d %d" % (mx[0], mx[1])) | Traceback (most recent call last):
File "/tmp/tmpq95dh8bf/tmpq15b4pp5.py", line 1, in <module>
n, q = list(map(int, input().split()))
^^^^^^^
EOFError: EOF when reading a line
| |
s566254758 | p00099 | u766477342 | 1444141859 | Python | Python3 | py | Runtime Error | 0 | 0 | 561 | n, q = list(map(int, input().split()))
cnt = [0 for _ in range(n + 1)]
cnt[0] = -1
mx = [0, -1]
def spam():
# max_v = max(cnt)
# idx = min([i for i, value in enumerate(cnt) if value == max_v])
# return idx, max_v
return 1,1
for _ in range(q):
a, v = list(map(int, input().split()))
cnt[a] += v
if mx[0] == a and v > 0:
mx[1] += v
elif mx[0] == a and v < 0:
mx = spam()
if cnt[a] > mx[1]:
print("%d %d" % (a, cnt[a]))
mx[0], mx[1] = a, cnt[a]
else:
print("%d %d" % (mx[0], mx[1])) | Traceback (most recent call last):
File "/tmp/tmpqigwothw/tmpalb89jr3.py", line 1, in <module>
n, q = list(map(int, input().split()))
^^^^^^^
EOFError: EOF when reading a line
| |
s218060094 | p00099 | u463990569 | 1452947133 | Python | Python | py | Runtime Error | 0 | 0 | 303 | n, q = [int(el) for el in input().split(' ')]
data = [0] * n
ex_result = 0
for _ in range(q):
a, v = [int(el) for el in input().split(' ')]
data[a-1] += v
if v < 0:
result = ex_result
else:
result = max(data)
print(data.index(result)+1, result)
ex_result = result | Traceback (most recent call last):
File "/tmp/tmp_yea3tk6/tmpiwyze0qq.py", line 1, in <module>
n, q = [int(el) for el in input().split(' ')]
^^^^^^^
EOFError: EOF when reading a line
| |
s601747195 | p00099 | u463990569 | 1452947151 | Python | Python | py | Runtime Error | 0 | 0 | 303 | n, q = [int(el) for el in input().split(' ')]
data = [0] * n
ex_result = 0
for _ in range(q):
a, v = [int(el) for el in input().split(' ')]
data[a-1] += v
if v < 0:
result = ex_result
else:
result = max(data)
print(data.index(result)+1, result)
ex_result = result | Traceback (most recent call last):
File "/tmp/tmperepbuie/tmpqh58xo00.py", line 1, in <module>
n, q = [int(el) for el in input().split(' ')]
^^^^^^^
EOFError: EOF when reading a line
| |
s076078959 | p00099 | u463990569 | 1452947271 | Python | Python | py | Runtime Error | 0 | 0 | 303 | n, q = [int(el) for el in input().split(' ')]
data = [0] * n
ex_result = 0
for _ in range(q):
a, v = [int(el) for el in input().split(' ')]
data[a-1] += v
if v < 0:
result = ex_result
else:
result = max(data)
print(data.index(result)+1, result)
ex_result = result | Traceback (most recent call last):
File "/tmp/tmpkr3_sevy/tmpb3udkg7n.py", line 1, in <module>
n, q = [int(el) for el in input().split(' ')]
^^^^^^^
EOFError: EOF when reading a line
| |
s667386160 | p00099 | u463990569 | 1452947291 | Python | Python | py | Runtime Error | 0 | 0 | 248 | n, q = [int(el) for el in input().split(' ')]
data = [0] * n
ex_result = 0
for _ in range(q):
a, v = [int(el) for el in input().split(' ')]
data[a-1] += v
result = max(data)
print(data.index(result)+1, result)
ex_result = result | Traceback (most recent call last):
File "/tmp/tmpwpfs_3lb/tmpfw80istl.py", line 1, in <module>
n, q = [int(el) for el in input().split(' ')]
^^^^^^^
EOFError: EOF when reading a line
| |
s343338720 | p00099 | u463990569 | 1452947309 | Python | Python3 | py | Runtime Error | 0 | 0 | 303 | n, q = [int(el) for el in input().split(' ')]
data = [0] * n
ex_result = 0
for _ in range(q):
a, v = [int(el) for el in input().split(' ')]
data[a-1] += v
if v < 0:
result = ex_result
else:
result = max(data)
print(data.index(result)+1, result)
ex_result = result | Traceback (most recent call last):
File "/tmp/tmp5lgk0tby/tmpm1unbnga.py", line 1, in <module>
n, q = [int(el) for el in input().split(' ')]
^^^^^^^
EOFError: EOF when reading a line
| |
s282460228 | p00099 | u463990569 | 1452947312 | Python | Python3 | py | Runtime Error | 0 | 0 | 303 | n, q = [int(el) for el in input().split(' ')]
data = [0] * n
ex_result = 0
for _ in range(q):
a, v = [int(el) for el in input().split(' ')]
data[a-1] += v
if v < 0:
result = ex_result
else:
result = max(data)
print(data.index(result)+1, result)
ex_result = result | Traceback (most recent call last):
File "/tmp/tmpqoidczen/tmpeazigall.py", line 1, in <module>
n, q = [int(el) for el in input().split(' ')]
^^^^^^^
EOFError: EOF when reading a line
| |
s258184935 | p00099 | u463990569 | 1452947391 | Python | Python3 | py | Runtime Error | 0 | 0 | 303 | n, q = [int(el) for el in input().split(' ')]
data = [0] * n
ex_result = 0
for _ in range(q):
a, v = [int(el) for el in input().split(' ')]
data[a-1] += v
if v < 0:
result = ex_result
else:
result = max(data)
print(data.index(result)+1, result)
ex_result = result | Traceback (most recent call last):
File "/tmp/tmpza8pzbu4/tmp_k88eeh4.py", line 1, in <module>
n, q = [int(el) for el in input().split(' ')]
^^^^^^^
EOFError: EOF when reading a line
| |
s553904387 | p00099 | u463990569 | 1452949311 | Python | Python3 | py | Runtime Error | 0 | 0 | 537 | n, q = [int(el) for el in input().split(' ')]
data = [0] * n
ex_result, exx_result = 0,0
ex_index = 0
for _ in range(q):
a, v = [int(el) for el in input().split(' ')]
data[a-1] += v
if ex_index != a:
if v < 0: result = ex_result
else: result = max(ex_result, data[a-1])
elif ex_index == a:
if v > 0: result = data[a-1]
else: result = max(data[a-1], exx_result)
index = data.index(result)+1
print(index, result)
exx_result = ex_result
ex_result = result
ex_index = index | Traceback (most recent call last):
File "/tmp/tmpjhg857lg/tmpy4lt5lpq.py", line 1, in <module>
n, q = [int(el) for el in input().split(' ')]
^^^^^^^
EOFError: EOF when reading a line
| |
s490399122 | p00099 | u463990569 | 1452949529 | Python | Python3 | py | Runtime Error | 0 | 0 | 537 | n, q = [int(el) for el in input().split(' ')]
data = [0] * n
ex_result, exx_result = 0,0
ex_index = 0
for _ in range(q):
a, v = [int(el) for el in input().split(' ')]
data[a-1] += v
if ex_index != a:
if v < 0: result = ex_result
else: result = max(ex_result, data[a-1])
elif ex_index == a:
if v > 0: result = data[a-1]
else: result = max(exx_result, data[a-1])
index = data.index(result)+1
print(index, result)
exx_result = ex_result
ex_result = result
ex_index = index | Traceback (most recent call last):
File "/tmp/tmp4g6om6k1/tmpy1efud7b.py", line 1, in <module>
n, q = [int(el) for el in input().split(' ')]
^^^^^^^
EOFError: EOF when reading a line
| |
s026405578 | p00099 | u463990569 | 1452949607 | Python | Python3 | py | Runtime Error | 0 | 0 | 536 | n, q = [int(el) for el in input().split(' ')]
data = [0] * n
ex_result,exx_result = 0,0
ex_index = 0
for _ in range(q):
a, v = [int(el) for el in input().split(' ')]
data[a-1] += v
if ex_index != a:
if v < 0: result = ex_result
else: result = max(ex_result, data[a-1])
elif ex_index == a:
if v > 0: result = data[a-1]
else: result = max(exx_result, data[a-1])
index = data.index(result)+1
print(index, result)
exx_result = ex_result
ex_result = result
ex_index = index | Traceback (most recent call last):
File "/tmp/tmpgfh0frz4/tmpzsjo37za.py", line 1, in <module>
n, q = [int(el) for el in input().split(' ')]
^^^^^^^
EOFError: EOF when reading a line
| |
s625375989 | p00099 | u463990569 | 1452950001 | Python | Python3 | py | Runtime Error | 30 | 7772 | 634 | n, q = [int(el) for el in input().split(' ')]
data = [0] * n
ex_result, exx_result = 0, 0
ex_index, exx_index = 0, 0
for _ in range(q):
a, v = [int(el) for el in input().split(' ')]
data[a-1] += v
if ex_index != a:
if v < 0: result = ex_result
else: result = max(ex_result, data[a-1])
else:
if v > 0: result = data[a-1]
else:
if exx_index == a: result = max(data)
else: result = max(exx_result, data[a-1])
index = data.index(result) + 1
print(index, result)
exx_result = ex_result
ex_result = result
exx_index = ex_index
ex_index = index | Traceback (most recent call last):
File "/tmp/tmpbq4eh2_j/tmpwsisor9i.py", line 1, in <module>
n, q = [int(el) for el in input().split(' ')]
^^^^^^^
EOFError: EOF when reading a line
| |
s110207452 | p00099 | u027872723 | 1476705317 | Python | Python3 | py | Runtime Error | 0 | 0 | 289 | #-*- coding: utf_8 -*-
a = [int(x) for x in input().split()]
n, q = a[0], a[1]
memo = [0] * n
for i in range(q):
debug(memo)
nq = [int(x) for x in input().split()]
a, v = nq[0] - 1, nq[1]
memo[a] += v
mx = max(memo)
print(str(memo.index(mx) + 1) + " " + str(mx)) | Traceback (most recent call last):
File "/tmp/tmp3_bnr62v/tmpt80f28zb.py", line 3, in <module>
a = [int(x) for x in input().split()]
^^^^^^^
EOFError: EOF when reading a line
| |
s848386417 | p00099 | u266872031 | 1482677247 | Python | Python | py | Runtime Error | 10 | 6464 | 419 | import bisect
from math import modf
[n,q]=map(int,raw_input().split())
decp=1./(n+2)
A=[0 for i in range(n+1)]
B=[1-decp*(i+1) for i in range(n)]
for i in range(q):
[a,v]=map(int,raw_input().split())
pp=A[a]+ (1-decp*(a+1))
A[a]+=v
remind=bisect.bisect_left(B,pp)
B.pop(remind)
bisect.insort(B,pp+v)
decimal, integer = modf(B[-1])
print int(round((1-decimal)*(n+2)-1,0)) , int(integer) | File "/tmp/tmpd9dehtoo/tmpdnl8m5m4.py", line 17
print int(round((1-decimal)*(n+2)-1,0)) , int(integer)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s038553195 | p00099 | u266872031 | 1482677689 | Python | Python | py | Runtime Error | 10 | 6468 | 431 | import bisect
from math import modf
[n,q]=map(int,raw_input().split())
decp=1./(n+2)
A=[0 for i in range(n+1)]
B=[1-decp*(i+1) for i in range(1,n+1)]
B.sort()
for i in range(q):
[a,v]=map(int,raw_input().split())
pp=A[a]+ (1-decp*(a+1))
A[a]+=v
remind=bisect.bisect_left(B,pp)
B.pop(remind)
bisect.insort(B,pp+v)
decimal, integer = modf(B[-1])
print int(round((1-decimal)*(n+2)-1,0)) , int(integer) | File "/tmp/tmpnfwd1ikh/tmp9zqucxxi.py", line 17
print int(round((1-decimal)*(n+2)-1,0)) , int(integer)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s896104521 | p00099 | u266872031 | 1482677966 | Python | Python | py | Runtime Error | 10 | 6468 | 431 | import bisect
from math import modf
[n,q]=map(int,raw_input().split())
decp=1./(n+2)
A=[0 for i in range(n+1)]
B=[1-decp*(i+1) for i in range(1,n+1)]
B.sort()
for i in range(q):
[a,v]=map(int,raw_input().split())
pp=A[a]+ (1-decp*(a+1))
A[a]+=v
remind=bisect.bisect_left(B,pp)
B.pop(remind)
bisect.insort(B,pp+v)
decimal, integer = modf(B[-1])
print int(round((1-decimal)*(n+2)-1,0)) , int(integer) | File "/tmp/tmpbxjttz7d/tmp377annnl.py", line 17
print int(round((1-decimal)*(n+2)-1,0)) , int(integer)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s765578406 | p00099 | u546285759 | 1492841702 | Python | Python3 | py | Runtime Error | 0 | 0 | 348 | n, q = map(int, input().split())
n = [0]*(n+1)
maxv = winner = 0
for _ in range(q):
a, v = map(int, input().split())
n[a] += v
if v < 0:
maxv, winner = max(n), n.index(maxv)
else:
if n[a] > maxv:
maxv, winner = n[a], a
elif n[a] == maxv:
winner = n.index(maxv)
print(winner, maxv) | Traceback (most recent call last):
File "/tmp/tmp61v9gaeq/tmpxvldtauz.py", line 1, in <module>
n, q = map(int, input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s131132109 | p00099 | u868716420 | 1496969662 | Python | Python3 | py | Runtime Error | 0 | 0 | 250 | from collections import deque
n, q = [int(_) for _ in input().split()]
book = deque()
for _ in range(n+1) : book.append(0)
for _ in range(q) :
a, v = [int(_2) for _2 in input().split()]
book[a] += v
print(book.index(max(book)), max(book)) | Traceback (most recent call last):
File "/tmp/tmp8chpz44w/tmpzkqyqgw9.py", line 2, in <module>
n, q = [int(_) for _ in input().split()]
^^^^^^^
EOFError: EOF when reading a line
| |
s354738212 | p00099 | u868716420 | 1496969777 | Python | Python3 | py | Runtime Error | 0 | 0 | 250 | from collections import deque
n, q = [int(_) for _ in input().split()]
book = deque()
for _ in range(n+1) : book.append(0)
for _ in range(q) :
a, v = [int(_2) for _2 in input().split()]
book[a] += v
print(book.index(max(book)), max(book)) | Traceback (most recent call last):
File "/tmp/tmpinjg1_8x/tmpow_d7v2f.py", line 2, in <module>
n, q = [int(_) for _ in input().split()]
^^^^^^^
EOFError: EOF when reading a line
| |
s954450917 | p00099 | u868716420 | 1496990162 | Python | Python3 | py | Runtime Error | 30 | 7684 | 223 | from array import array
n, q = [int(_) for _ in input().split()]
book = array('b', [0] * (n+1))
for _ in range(q) :
a, v = [int(_2) for _2 in input().split()]
book[a] += v
print(book.index(max(book)), max(book)) | Traceback (most recent call last):
File "/tmp/tmp0i_67nys/tmpywejq6hs.py", line 2, in <module>
n, q = [int(_) for _ in input().split()]
^^^^^^^
EOFError: EOF when reading a line
| |
s428094323 | p00099 | u868716420 | 1496991490 | Python | Python3 | py | Runtime Error | 20 | 7672 | 453 | from array import array
n, q = [int(_) for _ in input().split()]
book = array('b', [0] * (n+1))
max_per, max_val = n, 0
for _ in range(q) :
a, v = [int(_2) for _2 in input().split()]
book[a] += v
if 0 <= v :
if max_val < book[a] : max_per, max_val = a, book[a]
elif max_val == book[a] and a < max_per : max_per = a
elif v < 0 :
max_val = max(book)
max_per = book.index(max_val)
print(max_per, max_val) | Traceback (most recent call last):
File "/tmp/tmpjuuwyn94/tmpf12dmg42.py", line 2, in <module>
n, q = [int(_) for _ in input().split()]
^^^^^^^
EOFError: EOF when reading a line
| |
s869901623 | p00099 | u868716420 | 1497012887 | Python | Python3 | py | Runtime Error | 20 | 7700 | 648 | from sys import stdin
n = [int(_) for _ in input().split()]
book = [0]*(n[0]+1)
max_per, max_val = [int(_) for _ in input().split()]
book[max_per] += max_val
print(max_per, max_val)
for _ in stdin.read().splitlines() :
a = [int(_2) for _2 in _.split()]
book[a[0]] += a[1]
if a[1] < 0 :
for _2 in [None]*book[a[0]] :
if max_val in book : break
max_val -= 1
max_per = book.index(max_val)
elif book[a[0]] < max_val : pass
elif max_val < book[a[0]] :
max_val = book[a[0]]
if max_per != a : max_per = a[0]
elif a[0] < max_per : max_per = a[0]
print(max_per, max_val) | Traceback (most recent call last):
File "/tmp/tmpfc5k7egk/tmp7ppi0q5j.py", line 2, in <module>
n = [int(_) for _ in input().split()]
^^^^^^^
EOFError: EOF when reading a line
| |
s612191459 | p00099 | u868716420 | 1497013189 | Python | Python3 | py | Runtime Error | 20 | 7696 | 651 | from sys import stdin
n = [int(_) for _ in input().split()]
book = [0]*(n[0]+1)
max_per, max_val = [int(_) for _ in input().split()]
book[max_per] += max_val
print(max_per, max_val)
for _ in stdin.read().splitlines() :
a = [int(_2) for _2 in _.split()]
book[a[0]] += a[1]
if a[1] < 0 :
for _2 in [None]*book[a[0]] :
if max_val in book : break
max_val -= 1
max_per = book.index(max_val)
elif book[a[0]] < max_val : pass
elif max_val < book[a[0]] :
max_val = book[a[0]]
if max_per != a[0] : max_per = a[0]
elif a[0] < max_per : max_per = a[0]
print(max_per, max_val) | Traceback (most recent call last):
File "/tmp/tmp0_s_nzg9/tmpnrhnmlh7.py", line 2, in <module>
n = [int(_) for _ in input().split()]
^^^^^^^
EOFError: EOF when reading a line
| |
s073100777 | p00099 | u868716420 | 1497013696 | Python | Python3 | py | Runtime Error | 30 | 7716 | 645 | from sys import stdin
n = [int(_) for _ in input().split()]
book = [0]*(n[0]+1)
max_per, max_val = [int(_) for _ in input().split()]
book[max_per] += max_val
print(max_per, max_val)
for _ in stdin.read().splitlines() :
a = [int(_2) for _2 in _.split()]
book[a[0]] += a[1]
if a[1] < 0 :
for _2 in [None]*book[a[0]] :
if max_val in book : break
max_val -= 1
max_per = book.index(max_val)
elif max_per == a[0] : max_val += a[1]
elif max_val < book[a[0]] : max_per, max_val = a[0], book[a[0]]
elif book[a[0]] == max_val and a[0] < max_per : max_per = a[0]
print(max_per, max_val) | Traceback (most recent call last):
File "/tmp/tmpxjxg4b94/tmpfl4juuvi.py", line 2, in <module>
n = [int(_) for _ in input().split()]
^^^^^^^
EOFError: EOF when reading a line
| |
s691756483 | p00099 | u150984829 | 1522364687 | Python | Python3 | py | Runtime Error | 0 | 0 | 205 | n,q=map(int,input().split())
s=[0]*-~n
w=m=0
for _ in[0]*q:
a,v=map(int,input().split())
s[a]+=v
if v<0 and a==w:m=max(s),w=s.index(m)
elif s[a]>maxv:w,m=a,s[a]
elif s[a]==maxv:w=min(w,a)
print(w,m)
| File "/tmp/tmpti3qd3le/tmpjy6vj3sw.py", line 7
if v<0 and a==w:m=max(s),w=s.index(m)
^^^^^^^^
SyntaxError: invalid syntax. Maybe you meant '==' or ':=' instead of '='?
| |
s113965153 | p00099 | u150984829 | 1522364711 | Python | Python3 | py | Runtime Error | 0 | 0 | 205 | n,q=map(int,input().split())
s=[0]*-~n
w=m=0
for _ in[0]*q:
a,v=map(int,input().split())
s[a]+=v
if v<0 and a==w:m=max(s);w=s.index(m)
elif s[a]>maxv:w,m=a,s[a]
elif s[a]==maxv:w=min(w,a)
print(w,m)
| Traceback (most recent call last):
File "/tmp/tmpxs0hhz5_/tmptkmem8pt.py", line 1, in <module>
n,q=map(int,input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s814583547 | p00099 | u782850731 | 1382185767 | Python | Python | py | Runtime Error | 20 | 4616 | 651 | #!/usr/bin/env python
from __future__ import division, print_function
from sys import stdin, exit
from collections import Counter
def keyfunc(data):
return (data[1], -data[0])
def main(readline=stdin.readline):
n, q = (int(s) for s in readline().split())
base = tuple([i+1, 0] for i in range(n))
midway = [base[i*100] for i in range(n//100 + 1)]
for i in range(q):
a, v = (int(s) for s in readline().split())
a -= 1
base[a][1] += v
a -= a % 100
midway[a//100] = max(base[a:a+100], key=keyfunc)
print(*max(midway, key=keyfunc))
exit()
if __name__ == '__main__':
main() | Traceback (most recent call last):
File "/tmp/tmp3pmvtd61/tmpqndss1dx.py", line 28, in <module>
main()
File "/tmp/tmp3pmvtd61/tmpqndss1dx.py", line 12, in main
n, q = (int(s) for s in readline().split())
^^^^
ValueError: not enough values to unpack (expected 2, got 0)
| |
s038599327 | p00099 | u782850731 | 1382190360 | Python | Python | py | Runtime Error | 20 | 4300 | 1066 | #!/usr/bin/env python
from __future__ import division, print_function
from sys import stdin, exit, maxsize
def main(readline=stdin.readline):
n, q = (int(s) for s in readline().split())
base = [0] * n
midway = [(1, -maxsize)] * (n//100 + 1)
last = [(1, -maxsize)] * (n//10000 + 1)
for _ in range(q):
a, v = (int(s) for s in readline().split())
a -= 1
base[a] += v
b = a - a % 100
index = value = -maxsize
for i, v in enumerate(base[b:b+100], b+1):
if value < v:
value = v
index = i
midway[b//100] = (index, value)
c = b - b % 100
index = value = -maxsize
for i, v in midway[c:c+100]:
if value < v:
value = v
index = i
last[c//100] = (index, value)
index = value = -maxsize
for i, v in last:
if value < v:
value = v
index = i
print(index, value)
exit()
if __name__ == '__main__':
main() | Traceback (most recent call last):
File "/tmp/tmpdu04veb7/tmpopsclj1i.py", line 44, in <module>
main()
File "/tmp/tmpdu04veb7/tmpopsclj1i.py", line 7, in main
n, q = (int(s) for s in readline().split())
^^^^
ValueError: not enough values to unpack (expected 2, got 0)
| |
s559478438 | p00099 | u782850731 | 1382192249 | Python | Python | py | Runtime Error | 20 | 4264 | 798 | #!/usr/bin/env python
from __future__ import division, print_function
from sys import stdin, exit, maxsize
def main(readline=stdin.readline):
n, q = (int(s) for s in readline().split())
base = [0] * n
midway = [0] * (n//1000 + 1)
for _ in range(q):
a, v = (int(s) for s in readline().split())
a -= 1
base[a] += v
b = a - a % 1000
index = value = -maxsize
for i, v in enumerate(base[b:b+1000]):
if value < v:
index = i
value = v
midway[b] = index
value = index = -maxsize
for i in midway:
if value < base[i]:
value = base[i]
index = i
print(index+1, value)
exit()
if __name__ == '__main__':
main() | Traceback (most recent call last):
File "/tmp/tmppvly1y0b/tmpnqrwsvd8.py", line 37, in <module>
main()
File "/tmp/tmppvly1y0b/tmpnqrwsvd8.py", line 7, in main
n, q = (int(s) for s in readline().split())
^^^^
ValueError: not enough values to unpack (expected 2, got 0)
| |
s483336810 | p00099 | u633068244 | 1395930771 | Python | Python | py | Runtime Error | 0 | 0 | 183 | n, q = map(int, raw_input().split())
s = [0 for i in range(n)]
a = [map(int, raw_input().split()) for i in range(q)]
for r in a:
s[r[0]] += r[1]
mx = max(s)
print s.index(mx)+1, mx | File "/tmp/tmpzuy2jerm/tmp_6ezb3os.py", line 7
print s.index(mx)+1, mx
^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s258278632 | p00100 | u912237403 | 1414916584 | Python | Python | py | Runtime Error | 0 | 0 | 258 | while 1:
n=input()
if n==0: break
D={}
A=[]
for _ in range(n):
a,b,c=map(int, raw_input().split(' '))
if a in D: D[a]+=b*c
else:
D[a]=b*c
A.append(a)
B=[i for i in A: if D[i]>=1e6]
if B=[]: B=["NA"]
for e in B: print e | File "/tmp/tmpur0izffh/tmpu9w1d69a.py", line 12
B=[i for i in A: if D[i]>=1e6]
^
SyntaxError: invalid syntax
| |
s207204737 | p00100 | u672822075 | 1419152103 | Python | Python3 | py | Runtime Error | 0 | 0 | 324 | while True:
n=int(input())
if n:
a=[list(map(int,input().split())) for _ in range(n)]
b={}
for i in range(n):
if a[i][0] in b:
b[a[i][0]]+=a[i][1]*a[i][2]
else:
b[a[i][0]]=a[i][1]*a[i][2]
for k in b.keys():
if b[k]>=1000000:
print(k)
if max(k.values())<1000000:
print("NA")
else:
break | Traceback (most recent call last):
File "/tmp/tmpo53s371c/tmpcprvfhx0.py", line 2, in <module>
n=int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s714337273 | p00100 | u672822075 | 1419283248 | Python | Python3 | py | Runtime Error | 0 | 0 | 273 | while True:
n=int(input())
if n==0: break
l=[]
d={}
for i in range(n):
i,p,q=list(map(int,input().split()))
if a in d:
d[a]+=b*c
else:
d[a]=b*c
l.append(a)
if max(d.values())<1000000:
print("NA")
else:
for k in l:
if d[k]>=1000000:
print(k) | Traceback (most recent call last):
File "/tmp/tmpdnjljln0/tmp7fq97oe2.py", line 2, in <module>
n=int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s160121553 | p00100 | u580607517 | 1427627863 | Python | Python | py | Runtime Error | 0 | 0 | 122 | n = int(raw_input())
for i in range(n):
x, y, z = map(int, raw_input())
if y*z >= 1000000:
print x
else:
print "NA" | File "/tmp/tmp1kd9qa8l/tmpq_hwt0km.py", line 5
print x
^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s722027193 | p00100 | u580607517 | 1427628054 | Python | Python | py | Runtime Error | 0 | 0 | 158 | while 1:
n = int(raw_input())
if n == 0:
break
for i in range(n):
x, y, z = map(int, raw_input())
if y*z >= 1000000:
print x
else:
print "NA" | File "/tmp/tmplmq37pwa/tmp4uwmwvfd.py", line 8
print x
^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s093588090 | p00100 | u580607517 | 1427628153 | Python | Python | py | Runtime Error | 0 | 0 | 55 | 1001 2000 520
1002 1800 450
1003 1600 625
1001 200 1220 | File "/tmp/tmprj1i12dv/tmpzutgm7y1.py", line 1
1001 2000 520
^^^^
SyntaxError: invalid syntax
| |
s189267746 | p00100 | u534550471 | 1434410274 | Python | Python | py | Runtime Error | 0 | 0 | 505 | import sys
import math
while 1:
para = map(int, raw_input())
if (para == 0):
break
ans = 0
l = [0 for i in range(4000)]
num = []
check = 0
for j in range(para):
data = map(int, raw_input().split())
l[data[0]] = l[data[0]]+data[1]*data[2]
if(data[0] not in num):
num.append(data[0])
for j in range(4000):
if(l[num[j]]>=1000000):
print num[j]
check = check + 1
if(check==0):
print "NA" | File "/tmp/tmp80z6dfxa/tmpr6v1pzit.py", line 20
print num[j]
^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s273343191 | p00100 | u873482706 | 1451557117 | Python | Python3 | py | Runtime Error | 0 | 0 | 477 | while True:
N = int(input())
if N == 0:
break
d = {}
for n in range(N):
num, p, q = map(int, input().split())
if num in d:
d[num][1] += (p*q)
else:
d[num] = [n, p*q]
else:
fla = False
for k, v in sorted(d.items(), key=lambda x[1][0]):
if v[1] >= 1000000:
print(k)
fla = True
else:
if not fla:
print('NA') | File "/tmp/tmp07412ft5/tmp2flp8zn7.py", line 14
for k, v in sorted(d.items(), key=lambda x[1][0]):
^
SyntaxError: invalid syntax
| |
s787261798 | p00100 | u609881501 | 1453801047 | Python | Python3 | py | Runtime Error | 0 | 0 | 723 | #!/usr/bin/env python3
import sys
input_lines = sys.stdin.readlines()
cnt = 0
dataset = []
for i in input_lines:
if not(' ' in i):
dataset.append([int(i)])
cnt += 1
else:dataset[cnt-1].append(list(map(int, i.split(' '))))
for d in dataset:
if d == [0]:break
shain = [[x[0], x[1]*x[2]] for x in d[1:]]
#score = [ for x in d[1:]]
slist = []
for s in shain:
if not(s[0] in slist):slist.append(s[0])
newslist = [[x, 0] for x in slist]
score = []
for s in shain:
newslist[slist.index(s[0])][1] += s[1]
flag = False
for n in newslist:
if n[1] >= 1000000:
print(n[0])
flag = True
if not flag:print('NA') | ||
s287750973 | p00100 | u609881501 | 1453801067 | Python | Python3 | py | Runtime Error | 0 | 0 | 723 | #!/usr/bin/env python3
import sys
input_lines = sys.stdin.readlines()
cnt = 0
dataset = []
for i in input_lines:
if not(' ' in i):
dataset.append([int(i)])
cnt += 1
else:dataset[cnt-1].append(list(map(int, i.split(' '))))
for d in dataset:
if d == [0]:break
shain = [[x[0], x[1]*x[2]] for x in d[1:]]
#score = [ for x in d[1:]]
slist = []
for s in shain:
if not(s[0] in slist):slist.append(s[0])
newslist = [[x, 0] for x in slist]
score = []
for s in shain:
newslist[slist.index(s[0])][1] += s[1]
flag = False
for n in newslist:
if n[1] >= 1000000:
print(n[0])
flag = True
if not flag:print('NA') | ||
s162189754 | p00100 | u609881501 | 1453801139 | Python | Python3 | py | Runtime Error | 0 | 0 | 723 | #!/usr/bin/env python3
import sys
input_lines = sys.stdin.readlines()
cnt = 0
dataset = []
for i in input_lines:
if not(' ' in i):
dataset.append([int(i)])
cnt += 1
else:dataset[cnt-1].append(list(map(int, i.split(' '))))
for d in dataset:
if d == [0]:break
shain = [[x[0], x[1]*x[2]] for x in d[1:]]
#score = [ for x in d[1:]]
slist = []
for s in shain:
if not(s[0] in slist):slist.append(s[0])
newslist = [[x, 0] for x in slist]
score = []
for s in shain:
newslist[slist.index(s[0])][1] += s[1]
flag = False
for n in newslist:
if n[1] >= 1000000:
print(n[0])
flag = True
if not flag:print('NA') |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.