buggy
stringlengths
1
618k
fixed
stringlengths
16
618k
buggy_submission_id
stringlengths
10
10
fixed_submission_id
stringlengths
10
10
problem_id
stringlengths
6
6
lang
stringclasses
1 value
buggy_verdict
stringclasses
2 values
import sys try: while 1: temp = input() if (temp==0): break N = temp a = [] for i in range(N): a.append(map(int, raw_input().split())+[0]) a.append([0 for i in range(0,temp+1)]) for i in range(0,temp):#????????¢?????? for j in range(0,temp):#????????¢?????? a[i][temp] += a[i][j] for k in...
import sys try: while 1: temp = input() if (temp==0): break N = temp a = [] for i in range(N): a.append(map(int, raw_input().split())+[0]) a.append([0 for i in range(0,temp+1)]) for i in range(0,temp): for j in range(0,temp): a[i][temp] += a[i][j] for k in range(0,temp+1): for l in rang...
s528537474
s420115077
p00102
python
Runtime Error
while 1: nums = int(input()) if nums != 0: stars = list(map(int,input().split())) cnt = [0 for i in range((2*31)-1)] for x in stars: cnt[x] += 1 m = max(cnt) if m > nums/2: res = cnt.index(m) print(res) else: print("...
while 1: nums = int(input()) if nums != 0: d = {} stars = list(map(int,input().split())) for x in stars: if x not in d: d[x] = 1 else: d[x] += 1 key = list(d.keys()) val = list(d.values()) m = int(max(val)) ...
s168107122
s512735350
p00594
python
Runtime Error
n = int(input()) num = [0 for i in range(n)] for i in range(n): num[i] = int(input()) m = -float('inf') res = m for i in range(n): for j in range(i+1,n): if m < num[j] - num[i]: m = num[j] - num[i] res = max(m,res) print(res)
import sys input() mx = -float('inf') res = mx mn = int(input()) for i in map(int,sys.stdin.readlines()): if mx < i - mn: mx = i - mn if 0 > i - mn: mn = i res = max(mx,res) print(res)
s632961659
s808340622
p02258
python
Time Limit Exceeded
while True: a, b = map(int, input().split()) print(len(str(a + b)))
while True: try: a, b = map(int, input().split()) print(len(str(a + b))) except EOFError: break
s067057341
s914764018
p00002
python
Runtime Error
while True: a, b = map(int, input().split()) if a < b: print(a, b) elif b <= a: print(b, a) elif a == 0 and b ==0: break;
while True: a, b = map(int, input().split()) if a == 0 and b ==0: break; elif a <= b: print(a, b) elif b < a: print(b, a)
s380583080
s846487492
p02397
python
Runtime Error
while True: a, b = map(int, input().split()) if a < b: print(a, b) elif b <= a: print(b, a) elif a == 0 and b ==0: print(a, b) break;
while True: a, b = map(int, input().split()) if a == 0 and b ==0: break; elif a <= b: print(a, b) elif b < a: print(b, a)
s360279282
s846487492
p02397
python
Runtime Error
import math r = int(input()) print('%f %f' %(r ** 2 * math.pi, r * 2 * math.pi))
import math r = float(input()) print('%f %f' %(r ** 2 * math.pi, r * 2 * math.pi))
s864092543
s637535244
p02400
python
Runtime Error
from numpy.random import mtrand mt = [] for i in range(10): mt.append(input()) print(mt.pop(mt.index(max(mt)))) print(mt.pop(mt.index(max(mt)))) print(mt.pop(mt.index(max(mt))))
mt = [] for i in range(10): mt.append(int(input())) mt.sort() print( mt[9] ) print( mt[8] ) print( mt[7] )
s983483540
s022989280
p00001
python
Runtime Error
# - coding:utf-8 -*- from numpy.random import mtrand mt = [] for i in range(10): mt.append(input()) print(str(mt.pop(mt.index(max(mt))))) print(str(mt.pop(mt.index(max(mt))))) print(str(mt.pop(mt.index(max(mt)))))
mt = [] for i in range(10): mt.append(int(input())) mt.sort() print( mt[9] ) print( mt[8] ) print( mt[7] )
s649284478
s022989280
p00001
python
Runtime Error
mt = [] for i in range(10): mt.append(int(input().strip())) mt.sort().reverse() print( mt[0] ) print( mt[1] ) print( mt[2] )
mt = [] for i in range(10): mt.append(int(input())) mt.sort() print( mt[9] ) print( mt[8] ) print( mt[7] )
s965266229
s022989280
p00001
python
Runtime Error
while True: inNums = input().strip().split() a = int(inNums[0]) b = int(inNums[1]) temp = a+b x = 0 digitNum = 0 while temp // 10**x > 0: digitNum = x print(x) if inNums == None: break break
import sys for s in sys.stdin: a,b = map(int,s.split()) print(len(str(a+b)))
s335048862
s366925236
p00002
python
Time Limit Exceeded
flag = True inNums = [] while flag: inNums.append(raw_input().strip().split()) if inNums[-1] == []: flag = False for i in range(len(inNums)-1): a = int(inNums[i][0]) b = int(inNums[i][1]) temp = a+b x = 0 digitNum = 0 while temp // (10**x) > 0: digitNum = x ...
import sys for s in sys.stdin: a,b = map(int,s.split()) print(len(str(a+b)))
s141722435
s366925236
p00002
python
Runtime Error
flag = True i = 0 inNums = [] while flag: inNums.append(raw_input().strip().split()) if inNums[-1] == []: flag = False for i in range(len(inNums)-1): a = int(inNums[i][0]) b = int(inNums[i][1]) temp = a+b x = 0 while temp // (10**x) > 0: x += 1 print(x)
import sys for s in sys.stdin: a,b = map(int,s.split()) print(len(str(a+b)))
s668365582
s366925236
p00002
python
Runtime Error
flag = True i = 0 inNums = [] while flag: input = raw_input().strip().split() inNums.append(input) if input == []: flag = False for i in range(len(inNums)-1): a = int(inNums[i][0]) b = int(inNums[i][1]) temp = a+b x = 0 while temp // (10**x) > 0: x += 1 print(x)
import sys for s in sys.stdin: a,b = map(int,s.split()) print(len(str(a+b)))
s834238625
s366925236
p00002
python
Runtime Error
for i in input(): i.sprit() a = int(i[i][0]) b = int(i[i][1]) temp = a+b x = 0 while temp // (10**x) > 0: x += 1 print(x)
import sys for s in sys.stdin: a,b = map(int,s.split()) print(len(str(a+b)))
s359362388
s366925236
p00002
python
Runtime Error
for i in input(): i.split() a = int(i[i][0]) b = int(i[i][1]) temp = a+b x = 0 while temp // (10**x) > 0: x += 1 print(x)
import sys for s in sys.stdin: a,b = map(int,s.split()) print(len(str(a+b)))
s540832202
s366925236
p00002
python
Runtime Error
import sys for s in sys.stdin: a,b = map(int,s.split()) print len(str(a+b))
import sys for s in sys.stdin: a,b = map(int,s.split()) print(len(str(a+b)))
s949821745
s366925236
p00002
python
Runtime Error
for i in range(int(input())): a = sorted(map(int,input().split()),reversed = True) if a[0]**2 == a[1]**2 + a[2]**2: print("YES") else: print("NO")
for i in range(int(input())): a = sorted(map(int,input().split()),reverse = True) if a[0]**2 == a[1]**2 + a[2]**2: print("YES") else: print("NO")
s544385172
s227222385
p00003
python
Runtime Error
while 1: i = input().split() if i ==0: break else: a, b, c, d, e, f = map(float, i) x = (e*c - b*f)/(e*a - b*d) y = (c*d - f*a)/(d*b - e *a) print(x,y)
while(True): try: a,b,c,d,e,f=map(float,input().split(" ")) z=a*e-b*d if(z!=0): x=(c*e-b*f)/z y=(a*f-c*d)/z print("{:.3f} {:.3f}".format(x+0,y+0)) except: break
s891142132
s206277125
p00004
python
Runtime Error
while 1: i = input().split() if i == []: break else: a, b, c, d, e, f = map(float, i) x = (e*c - b*f)/(e*a - b*d) y = (c*d - f*a)/(d*b - e *a) print(x,y)
while(True): try: a,b,c,d,e,f=map(float,input().split(" ")) z=a*e-b*d if(z!=0): x=(c*e-b*f)/z y=(a*f-c*d)/z print("{:.3f} {:.3f}".format(x+0,y+0)) except: break
s814833628
s206277125
p00004
python
Runtime Error
while 1: i = input().split() if i == None: break else: a, b, c, d, e, f = map(float, i) x = (e*c - b*f)/(e*a - b*d) y = (c*d - f*a)/(d*b - e *a) print(x,y)
while(True): try: a,b,c,d,e,f=map(float,input().split(" ")) z=a*e-b*d if(z!=0): x=(c*e-b*f)/z y=(a*f-c*d)/z print("{:.3f} {:.3f}".format(x+0,y+0)) except: break
s099941653
s206277125
p00004
python
Runtime Error
while 1: i = input() if i == None: break else: a, b, c, d, e, f = map(float, i.split()) x = (e*c - b*f)/(e*a - b*d) y = (c*d - f*a)/(d*b - e *a) print(x,y)
while(True): try: a,b,c,d,e,f=map(float,input().split(" ")) z=a*e-b*d if(z!=0): x=(c*e-b*f)/z y=(a*f-c*d)/z print("{:.3f} {:.3f}".format(x+0,y+0)) except: break
s516591246
s206277125
p00004
python
Runtime Error
while 1: a, b, c, d, e, f = map(float, i) x = (e*c - b*f)/(e*a - b*d) y = (c*d - f*a)/(d*b - e *a) print(x,y)
while(True): try: a,b,c,d,e,f=map(float,input().split(" ")) z=a*e-b*d if(z!=0): x=(c*e-b*f)/z y=(a*f-c*d)/z print("{:.3f} {:.3f}".format(x+0,y+0)) except: break
s263008115
s206277125
p00004
python
Runtime Error
while True: try: a, b, c, d, e, f = map(float, input().split()) det = e*a - b*d x = (e*c - b*f)/det y = (f*a - c*d)/det if x == 0:x=0 if y==0:y=0 print("{0:.3f} {1:.3f)".format(x,y)) except EOFError: break
while(True): try: a,b,c,d,e,f=map(float,input().split(" ")) z=a*e-b*d if(z!=0): x=(c*e-b*f)/z y=(a*f-c*d)/z print("{:.3f} {:.3f}".format(x+0,y+0)) except: break
s057544212
s206277125
p00004
python
Runtime Error
while True: try: a, b, c, d, e, f = map(float, input().split(" ")) det = e*a - b*d x = (e*c - b*f)/det y = (f*a - c*d)/det if x == 0:x=0 if y==0:y=0 print("{0:.3f} {1:.3f)".format(x,y)) except EOFError: break
while(True): try: a,b,c,d,e,f=map(float,input().split(" ")) z=a*e-b*d if(z!=0): x=(c*e-b*f)/z y=(a*f-c*d)/z print("{:.3f} {:.3f}".format(x+0,y+0)) except: break
s730274160
s206277125
p00004
python
Runtime Error
while(True): try: a, b, c, d, e, f = map(float, input().split(" ")) det = e*a - b*d if det !=0: x = (e*c - b*f)/det y = (f*a - c*d)/det print("{:.3f} {:.3f)".format(x,y)) except EOFError: break
while(True): try: a,b,c,d,e,f=map(float,input().split(" ")) z=a*e-b*d if(z!=0): x=(c*e-b*f)/z y=(a*f-c*d)/z print("{:.3f} {:.3f}".format(x+0,y+0)) except: break
s012988838
s206277125
p00004
python
Runtime Error
while(True): try: a, b, c, d, e, f = map(float, input().split(" ")) det = e*a - b*d if det !=0: x = (e*c - b*f)/det y = (f*a - c*d)/det print("{:.3f} {:.3f)".format(x+0,y+0)) except EOFError: break
while(True): try: a,b,c,d,e,f=map(float,input().split(" ")) z=a*e-b*d if(z!=0): x=(c*e-b*f)/z y=(a*f-c*d)/z print("{:.3f} {:.3f}".format(x+0,y+0)) except: break
s975903548
s206277125
p00004
python
Runtime Error
while True: try: a, b, c, d, e, f = map(float, input().split()) det = e*a - b*d if det !=0: x = (e*c - b*f)/det y = (f*a - c*d)/det print("{:.3f} {:.3f)".format(x+0,y+0)) except EOFError: break
while(True): try: a,b,c,d,e,f=map(float,input().split(" ")) z=a*e-b*d if(z!=0): x=(c*e-b*f)/z y=(a*f-c*d)/z print("{:.3f} {:.3f}".format(x+0,y+0)) except: break
s512628616
s206277125
p00004
python
Runtime Error
import sys for line in sys.stdin: a,b,c,d,e,f= map(int,line .split()) z=a*e-b*d if(z!=0): x=(c*e-b*f)/z y=(a*f-c*d)/z print("{0:.3f} {1:.3f)".format(x+0,y+0))
while(True): try: a,b,c,d,e,f=map(float,input().split(" ")) z=a*e-b*d if(z!=0): x=(c*e-b*f)/z y=(a*f-c*d)/z print("{:.3f} {:.3f}".format(x+0,y+0)) except: break
s242601939
s206277125
p00004
python
Runtime Error
import sys for line in sys.stdin: a,b,c,d,e,f= map(int,line.split()) z=a*e-b*d if(z!=0): x=(c*e-b*f)/z y=(a*f-c*d)/z print("{0:.3f} {1:.3f)".format(x+0,y+0))
while(True): try: a,b,c,d,e,f=map(float,input().split(" ")) z=a*e-b*d if(z!=0): x=(c*e-b*f)/z y=(a*f-c*d)/z print("{:.3f} {:.3f}".format(x+0,y+0)) except: break
s880992382
s206277125
p00004
python
Runtime Error
import sys for line in sys.stdin: a,b,c,d,e,f= map(int,line.split(" ")) z=a*e-b*d if(z!=0): x=(c*e-b*f)/z y=(a*f-c*d)/z print("{0:.3f} {1:.3f)".format(x+0,y+0))
while(True): try: a,b,c,d,e,f=map(float,input().split(" ")) z=a*e-b*d if(z!=0): x=(c*e-b*f)/z y=(a*f-c*d)/z print("{:.3f} {:.3f}".format(x+0,y+0)) except: break
s521275428
s206277125
p00004
python
Runtime Error
import sys for line in sys.stdin: a,b,c,d,e,f= map(int,line.split()) z=a*e-b*d if(z!=0): x=(c*e-b*f)/z y=(a*f-c*d)/z print("{0:.3f} {1:.3f)".format(x+0, y+0))
while(True): try: a,b,c,d,e,f=map(float,input().split(" ")) z=a*e-b*d if(z!=0): x=(c*e-b*f)/z y=(a*f-c*d)/z print("{:.3f} {:.3f}".format(x+0,y+0)) except: break
s084241538
s206277125
p00004
python
Runtime Error
import sys for line in sys.stdin: a,b,c,d,e,f= map(int,line.split()) z=a*e-b*d if(z!=0): x=(c*e-b*f)/z y=(a*f-c*d)/z print("{0:.3f} {1:.3f)".format(x+0, y+0))
while(True): try: a,b,c,d,e,f=map(float,input().split(" ")) z=a*e-b*d if(z!=0): x=(c*e-b*f)/z y=(a*f-c*d)/z print("{:.3f} {:.3f}".format(x+0,y+0)) except: break
s694455848
s206277125
p00004
python
Runtime Error
import sys for line sys.stdin: a,b,c,d,e,f = map(int, line.split()) z = a * e - b * c if z != 0 x=(c*e-b*f)/z y=(a*f-c*d)/z print("{0:.3f} {1:.3f}".format(x+0,y+0)
while(True): try: a,b,c,d,e,f=map(float,input().split(" ")) z=a*e-b*d if(z!=0): x=(c*e-b*f)/z y=(a*f-c*d)/z print("{:.3f} {:.3f}".format(x+0,y+0)) except: break
s270111010
s206277125
p00004
python
Runtime Error
import sys for line in sys.stdin: a,b,c,d,e,f= map(int,line.split()) det=a*e-b*d if(det!=0): x=(c*e-b*f)/det y=(a*f-c*d)/det print("{0:.3f} {1:.3f)".format(x+0, y+0))
while(True): try: a,b,c,d,e,f=map(float,input().split(" ")) z=a*e-b*d if(z!=0): x=(c*e-b*f)/z y=(a*f-c*d)/z print("{:.3f} {:.3f}".format(x+0,y+0)) except: break
s707244346
s206277125
p00004
python
Runtime Error
import sys for line in sys.stdin: a,b,c,d,e,f= map(int,line.split()) det=a*e-b*d if(det!=0): x=(c*e-b*f)/det y=(a*f-c*d)/det print("{0:.3f} {1:.3f)".format(x+0, y+0))
while(True): try: a,b,c,d,e,f=map(float,input().split(" ")) z=a*e-b*d if(z!=0): x=(c*e-b*f)/z y=(a*f-c*d)/z print("{:.3f} {:.3f}".format(x+0,y+0)) except: break
s312025243
s206277125
p00004
python
Runtime Error
input = int(input().strip()) hour = input // 3600 min = (input - 3600*hour) // 60 sec = input - 3600 * hour - 60 * min print (":"join(hour, min, sec))
input = int(input().strip()) hour = input // 3600 min = (input - 3600*hour) // 60 sec = input - 3600 * hour - 60 * min print (":".join([str(hour), str(min), str(sec)]))
s676090373
s188351879
p02390
python
Runtime Error
input = int(input().strip()) hour = input // 3600 min = (input - 3600*hour) // 60 sec = input - 3600 * hour - 60 * min print (":".join(hour, min, sec))
input = int(input().strip()) hour = input // 3600 min = (input - 3600*hour) // 60 sec = input - 3600 * hour - 60 * min print (":".join([str(hour), str(min), str(sec)]))
s921808695
s188351879
p02390
python
Runtime Error
input = int(input().strip()) hour = input // 3600 min = (input - 3600*hour) // 60 sec = input - 3600 * hour - 60 * min print (":"join([hour, min, sec]))
input = int(input().strip()) hour = input // 3600 min = (input - 3600*hour) // 60 sec = input - 3600 * hour - 60 * min print (":".join([str(hour), str(min), str(sec)]))
s100301271
s188351879
p02390
python
Runtime Error
input = int(input().strip()) hour = input // 3600 min = (input - 3600*hour) // 60 sec = input - 3600 * hour - 60 * min print (":".join([hour, min, sec]))
input = int(input().strip()) hour = input // 3600 min = (input - 3600*hour) // 60 sec = input - 3600 * hour - 60 * min print (":".join([str(hour), str(min), str(sec)]))
s552827129
s188351879
p02390
python
Runtime Error
# -*- coding: utf-8 -*- input = input().strip().split() a = int(input[0]) b = int(input[1]) def comp(a, b): if a>b: return "a > b" elif a<b: return "a < b" else: return "a == b" print(demp(a,b))
input = input().strip().split() a = int(input[0]) b = int(input[1]) def comp(a, b): if a>b: return "a > b" elif a<b: return "a < b" else: return "a == b" print(comp(a,b))
s366106973
s627074571
p02391
python
Runtime Error
input = input).strip().split() a = int(input[0]) b = int(input[1]) c = int(input[2]) if a>b>c: print("Yes") else: print("No")
input = input().strip().split() a = int(input[0]) b = int(input[1]) c = int(input[2]) if a<b<c: print("Yes") else: print("No")
s440134938
s195292909
p02392
python
Runtime Error
_fib = [1, 1] def fib(n): if len(_fib) > n: return _fib[n] else: _fib[n] = fib[n-1] + fib[n-2] return _fib[n] _n = int(raw_input()) print(fib(_n))
_fib = [None] * 45 _fib[0] = 1 _fib[1] = 1 def fib(n): if _fib[n] is None: _fib[n] = fib(n-1) + fib(n-2) return _fib[n] _n = int(raw_input()) print(fib(_n))
s678126739
s862467078
p02233
python
Runtime Error
_fib = [1, 1] def fib(n): if len(_fib) > n: return _fib[n] else: _fib[n] = fib(n-1) + fib(n-2) return _fib[n] _n = int(raw_input()) print(fib(_n))
_fib = [None] * 45 _fib[0] = 1 _fib[1] = 1 def fib(n): if _fib[n] is None: _fib[n] = fib(n-1) + fib(n-2) return _fib[n] _n = int(raw_input()) print(fib(_n))
s983311811
s862467078
p02233
python
Runtime Error
_fib = [None] * 44 _fib[0] = 1 _fib[1] = 1 def fib(n): if _fib[n] is None: _fib[n] = fib(n-1) + fib(n-2) return _fib[n] _n = int(raw_input()) print(fib(_n))
_fib = [None] * 45 _fib[0] = 1 _fib[1] = 1 def fib(n): if _fib[n] is None: _fib[n] = fib(n-1) + fib(n-2) return _fib[n] _n = int(raw_input()) print(fib(_n))
s982374337
s862467078
p02233
python
Runtime Error
_n = raw_input() _a = [int(x) in x for raw_input.split()] _flg = 1 while _flg: _flg = 0 for i in reversed(range(1, _n)): if _a[i] < _a[i-1]: _a[i], _a[i-1] = _a[i-1], _a[i] _flg = 1 print(" ".join(_a))
_n = int(raw_input()) _a = [int(x) for x in raw_input().split()] _flg = 1 cnt = 0 while _flg: _flg = 0 for i in reversed(range(1, _n)): if _a[i] < _a[i-1]: _a[i], _a[i-1] = _a[i-1], _a[i] cnt += 1 _flg = 1 print(" ".join([str(x) for x in _a])) print(cnt)
s253873819
s372962369
p02259
python
Runtime Error
_n = int(raw_input()) _a = [int(x) in x for raw_input.split()] _flg = 1 cnt = 0 while _flg: _flg = 0 for i in reversed(range(1, _n)): if _a[i] < _a[i-1]: _a[i], _a[i-1] = _a[i-1], _a[i] cnt += 1 _flg = 1 print(" ".join(_a)) print(cnt)
_n = int(raw_input()) _a = [int(x) for x in raw_input().split()] _flg = 1 cnt = 0 while _flg: _flg = 0 for i in reversed(range(1, _n)): if _a[i] < _a[i-1]: _a[i], _a[i-1] = _a[i-1], _a[i] cnt += 1 _flg = 1 print(" ".join([str(x) for x in _a])) print(cnt)
s405368105
s372962369
p02259
python
Runtime Error
_n = int(raw_input()) _a = [int(x) in x for raw_input().split()] _flg = 1 cnt = 0 while _flg: _flg = 0 for i in reversed(range(1, _n)): if _a[i] < _a[i-1]: _a[i], _a[i-1] = _a[i-1], _a[i] cnt += 1 _flg = 1 print(" ".join(_a)) print(cnt)
_n = int(raw_input()) _a = [int(x) for x in raw_input().split()] _flg = 1 cnt = 0 while _flg: _flg = 0 for i in reversed(range(1, _n)): if _a[i] < _a[i-1]: _a[i], _a[i-1] = _a[i-1], _a[i] cnt += 1 _flg = 1 print(" ".join([str(x) for x in _a])) print(cnt)
s915313142
s372962369
p02259
python
Runtime Error
n = input() #a = [39, 98, 44, 13, 88, 53, 10] a = [input() for i in range(n)] b = [0, 0, 0] for i in a: j = 0 while j < 3: if i > b[j]: b.insert(j, i) break j += 1 for i in b[:3]: print i
import sys a = [] for line in sys.stdin: a.append(int(line)) b = [0, 0, 0] for i in a: j = 0 while j < 3: if i > b[j]: b.insert(j, i) break j += 1 for i in b[:3]: print i
s600519487
s112185685
p00001
python
Runtime Error
N = input() a = [input() for i in range(N)] b = [0, 0, 0] for i in a: j = 0 while j < 3: if i > b[j]: b.insert(j, i) break j += 1 for i in b[:3]: print i
import sys a = [] for line in sys.stdin: a.append(int(line)) b = [0, 0, 0] for i in a: j = 0 while j < 3: if i > b[j]: b.insert(j, i) break j += 1 for i in b[:3]: print i
s438124955
s112185685
p00001
python
Runtime Error
N = input() a = [input() for i in range(N)] b = [0, 0, 0] for i in a: j = 0 while j < 3: if i > b[j]: b.insert(j, i) break j += 1 for i in b[:3]: print i
import sys a = [] for line in sys.stdin: a.append(int(line)) b = [0, 0, 0] for i in a: j = 0 while j < 3: if i > b[j]: b.insert(j, i) break j += 1 for i in b[:3]: print i
s577565988
s112185685
p00001
python
Runtime Error
10 = input() a = [input() for i in range(10)] b = [0, 0, 0] for i in a: j = 0 while j < 3: if i > b[j]: b.insert(j, i) break j += 1 for i in b[:3]: print i
import sys a = [] for line in sys.stdin: a.append(int(line)) b = [0, 0, 0] for i in a: j = 0 while j < 3: if i > b[j]: b.insert(j, i) break j += 1 for i in b[:3]: print i
s477602087
s112185685
p00001
python
Runtime Error
n = input() a = [input() for i in range(10)] b = [0, 0, 0] for i in a: j = 0 while j < 3: if i > b[j]: b.insert(j, i) break j += 1 for i in b[:3]: print i
import sys a = [] for line in sys.stdin: a.append(int(line)) b = [0, 0, 0] for i in a: j = 0 while j < 3: if i > b[j]: b.insert(j, i) break j += 1 for i in b[:3]: print i
s462167801
s112185685
p00001
python
Runtime Error
N = input() a = [] for i in range(N): a.append(input()) b = [0, 0, 0] for i in a: j = 0 while j < 3: if i > b[j]: b.insert(j, i) break j += 1 for i in b[:3]: print i
import sys a = [] for line in sys.stdin: a.append(int(line)) b = [0, 0, 0] for i in a: j = 0 while j < 3: if i > b[j]: b.insert(j, i) break j += 1 for i in b[:3]: print i
s942377811
s112185685
p00001
python
Runtime Error
N = input() a = [] for i in range(N): a.append(input()) b = [0] for i in a: j = 0 while j < 3: if i > b[j]: b.insert(j, i) break j += 1 for i in b[:3]: print i
import sys a = [] for line in sys.stdin: a.append(int(line)) b = [0, 0, 0] for i in a: j = 0 while j < 3: if i > b[j]: b.insert(j, i) break j += 1 for i in b[:3]: print i
s083692626
s112185685
p00001
python
Runtime Error
n = int(input()) for i in range(n): x = input() y = input() ans = int(x) + int(y) if len(x) > 80 or len(y) > 80 or len(str(ans)) > 80: print("overflow") else: print(ans)
n = int(input()) for i in range(n): x = input() y = input() ans = int(x) + int(y) if len(x) > 80 or len(y) > 80 or len(str(ans)) > 80: print("overflow") else: print(ans)
s727146507
s893732444
p00015
python
Runtime Error
def solve(n,s,lst): if n == 0 and s == 0: return(1) elif s < lst[0] or len(lst)==0: return(0) else: return(solve(n-1,s-lst[0],lst[1:]) + solve(n,s,lst[1:])) if __name__ == "__main__": while True: n, s = map(int, input().split()) if n==0 and s==0: brea...
def solve(n,s,lst): if n == 0 and s == 0: #print("Complete!") return(1) elif n==0 or len(lst)==0 or s < lst[0]: return(0) else: return(solve(n-1,s-lst[0],lst[1:]) + solve(n,s,lst[1:])) if __name__ == "__main__": while True: n, s = map(int, input().split()) ...
s677492783
s838759582
p00030
python
Runtime Error
hist = {} while True: try: i,b = input().strip().split(',') if b in hist: hist[b] += 1 else: hist[b] = 1 except EOFError: break print("%d\n%d\n%d\n%d" % (hist['A'],hist['B'],hist['AB'],hist['O']))
hist = {'A':0,'B':0,'AB':0,'O':0} while True: try: i,b = input().strip().split(',') hist[b] += 1 except EOFError: break print("%d\n%d\n%d\n%d" % (hist['A'],hist['B'],hist['AB'],hist['O']))
s322153908
s385108669
p00049
python
Runtime Error
def drawone(f): v = list(range(1,11)) for i in f: v.remove(i) win = 0 lose= 0 for i in v: if i + sum(f[:2]) <= 20: win += 1 else: lose += 1 return(True if win>=lose else False) while True: f = list(map(int,input().strip().split())) if draw...
def drawone(f): v = list(range(1,11)) for i in f: v.remove(i) win = 0 lose= 0 for i in v: if i + sum(f[:2]) <= 20: win += 1 else: lose += 1 return(True if win>=lose else False) while True: try: f = list(map(int,input().strip().split())...
s589807530
s025951493
p00060
python
Runtime Error
import Control.Applicative import Data.Char main = do v <- map (map (\x->ord(x) - ord('0'))) . lines <$> getContents mapM_ (putStrLn . show . solve) v solve::[Int] -> Int solve v = head $ aux v where aux ::[Int] -> [Int] aux f = if length f == 1 then f else aux (z...
def shorten(f): #print(f) if len(f) == 1: return(f[0]) else: g = [] v = f[0] for i in f[1:]: g.append((v + i)%10) v = i return(shorten(g)) while True: try: f = list(map(int, list(input().strip()))) print(shorten(f)) except ...
s782400520
s210638567
p00062
python
Runtime Error
def cross(x, y): return (x.conjugate() * y).imag def area_polygon(points): area = 0 n = len(points) for i in range(n): area += cross(points[i], points[(i+1)%n]) return area / 2 import sys p = [] for line in sys.stdin: x, y = map(float, line.split(',')) p.append(x+y*1j...
def op(u,v): return (complex.conjugate(u)*v).imag f = [] while True: try: st = input().strip().split(',') x,y = list(map(float,st )) f.append(x + y*1j) except EOFError: break s = 0.0 fo = f[0] for j in range(2,len(f)): i = j - 1 s += op(f[i]-fo,f[j]-fo)/2.0 print("%...
s380072150
s886513006
p00079
python
Runtime Error
def cross(x, y): return (x.conjugate() * y).imag def area_polygon(points): area = 0 n = len(points) for i in range(n): area += cross(points[i], points[(i+1)%n]) return area / 2 import sys p = [] for line in sys.stdin: x, y = map(float, line.split(',')) p.append(x+y*j)...
def op(u,v): return (complex.conjugate(u)*v).imag f = [] while True: try: st = input().strip().split(',') x,y = list(map(float,st )) f.append(x + y*1j) except EOFError: break s = 0.0 fo = f[0] for j in range(2,len(f)): i = j - 1 s += op(f[i]-fo,f[j]-fo)/2.0 print("%...
s474925575
s886513006
p00079
python
Runtime Error
import math def op(u,v): return (conjugate(u)*v).imag f = [] while True: try: st = input().strip().split(',') x,y = list(map(float,st )) f.append(x + y*1j) except EOFError: break s = 0.0 fo = f[0] for j in range(2,len(f)): i = j - 1 s += op(i-fo,j-fo)/2.0 print("%.6...
def op(u,v): return (complex.conjugate(u)*v).imag f = [] while True: try: st = input().strip().split(',') x,y = list(map(float,st )) f.append(x + y*1j) except EOFError: break s = 0.0 fo = f[0] for j in range(2,len(f)): i = j - 1 s += op(f[i]-fo,f[j]-fo)/2.0 print("%...
s919946638
s886513006
p00079
python
Runtime Error
from datetime import datetime def era(f): meiji_st = datetime(1868, 9, 8) taisho_st = datetime(1912, 7,30) showa_st = datetime(1926,12,25) heisei_st = datetime(1989, 1, 8) y,m,d = f dt = datetime(y,m,d) if dt > heisei_st: ret = "heisei %d %d %d" % (dt.year - heisei_st.year+1,dt.mo...
from datetime import datetime def era(f): meiji_st = datetime(1868, 9, 8) taisho_st = datetime(1912, 7,30) showa_st = datetime(1926,12,25) heisei_st = datetime(1989, 1, 8) y,m,d = f dt = datetime(y,m,d) if dt >= heisei_st: ret = "heisei %d %d %d" % (dt.year - heisei_st.year+1,dt.m...
s251324339
s333124462
p00083
python
Runtime Error
from decimal import * import re def solve2(m, n): maxreplen = 80 PREC=200 getcontext().prec = PREC x = Decimal(m) / Decimal(n) s = x.to_eng_string() if len(s) < PREC: return(s[2:],'') rep = 1 while True: #r = r'(.{%d})\1{%d,}' % (rep, int(maxreplen/rep)-1) r = r'(...
from decimal import * import re def solve2(m, n): maxlen = 80 PREC=180 getcontext().prec = PREC x = Decimal(m) / Decimal(n) s = x.to_eng_string() if len(s) < PREC: return(s[2:],'') rep = 1 while True: r = r'(.{%d})\1{%d,}' % (rep, int(maxlen/rep)) #ex. '(.{6})\\1{13,}' ...
s730229990
s813056527
p00113
python
Runtime Error
from decimal import * import re def solve2(m, n): maxlen = 80 # PREC=160 PREC=200 getcontext().prec = PREC x = Decimal(m) / Decimal(n) s = x.to_eng_string() if len(s) < PREC: return(s[2:],'') rep = 1 while True: r = r'(.{%d})\1{%d,}' % (rep, int(PREC/rep)-1) ...
from decimal import * import re def solve2(m, n): maxlen = 80 PREC=180 getcontext().prec = PREC x = Decimal(m) / Decimal(n) s = x.to_eng_string() if len(s) < PREC: return(s[2:],'') rep = 1 while True: r = r'(.{%d})\1{%d,}' % (rep, int(maxlen/rep)) #ex. '(.{6})\\1{13,}' ...
s428849944
s813056527
p00113
python
Runtime Error
from decimal import * import re def solve2(m, n): maxlen = 85 #maxlen = 160 PREC=200 #PREC=300 getcontext().prec = PREC x = Decimal(m) / Decimal(n) s = x.to_eng_string() if len(s) < PREC: return(s[2:],'') rep = 1 while True: clip = min(int(PREC/rep),20) #r...
from decimal import * import re def solve2(m, n): maxlen = 80 PREC=180 getcontext().prec = PREC x = Decimal(m) / Decimal(n) s = x.to_eng_string() if len(s) < PREC: return(s[2:],'') rep = 1 while True: r = r'(.{%d})\1{%d,}' % (rep, int(maxlen/rep)) #ex. '(.{6})\\1{13,}' ...
s421904941
s813056527
p00113
python
Runtime Error
from decimal import * import re def solve2(m, n): maxlen = 80 PREC=200 getcontext().prec = PREC x = Decimal(m) / Decimal(n) s = x.to_eng_string() if len(s) < PREC: return(s[2:],'') rep = 1 while True: r = r'(.{%d})\1{%d,}' % (rep, int((PREC-40)/rep)) #ex. '(.{6})\\1{12,}...
from decimal import * import re def solve2(m, n): maxlen = 80 PREC=180 getcontext().prec = PREC x = Decimal(m) / Decimal(n) s = x.to_eng_string() if len(s) < PREC: return(s[2:],'') rep = 1 while True: r = r'(.{%d})\1{%d,}' % (rep, int(maxlen/rep)) #ex. '(.{6})\\1{13,}' ...
s094393129
s813056527
p00113
python
Runtime Error
from decimal import * import re def solve2(m, n): maxlen = 80 PREC=200 getcontext().prec = PREC x = Decimal(m) / Decimal(n) s = x.to_eng_string() if len(s) < PREC: return(s[2:],'') rep = 1 while True: r = r'(.{%d})\1{%d,}' % (rep, int((PREC-20)/rep)) #ex. '(.{6})\\1{12,}...
from decimal import * import re def solve2(m, n): maxlen = 80 PREC=180 getcontext().prec = PREC x = Decimal(m) / Decimal(n) s = x.to_eng_string() if len(s) < PREC: return(s[2:],'') rep = 1 while True: r = r'(.{%d})\1{%d,}' % (rep, int(maxlen/rep)) #ex. '(.{6})\\1{13,}' ...
s448925916
s813056527
p00113
python
Runtime Error
from decimal import * import re def solve2(m, n): maxlen = 80 PREC=300 getcontext().prec = PREC x = Decimal(m) / Decimal(n) s = x.to_eng_string() if len(s) < PREC: return(s[2:],'') rep = 1 while True: clip = max(int((PREC-20)/rep),1) r = r'(.{%d})\1{%d,}' % (rep, ...
from decimal import * import re def solve2(m, n): maxlen = 80 PREC=180 getcontext().prec = PREC x = Decimal(m) / Decimal(n) s = x.to_eng_string() if len(s) < PREC: return(s[2:],'') rep = 1 while True: r = r'(.{%d})\1{%d,}' % (rep, int(maxlen/rep)) #ex. '(.{6})\\1{13,}' ...
s994216625
s813056527
p00113
python
Runtime Error
import numpy as np def crossP(a, b, c, d): e = b - a f = c - d g = c - a A = np.matrix([[e.real,f.real],[e.imag, f.imag]]) B = np.matrix([[g.real],[g.imag]]) try: C = np.linalg.solve(A, B) except: return(-9999+(-9999)*1j) return(C[0,0]+C[1,0]*1j) def rangeP(st): retu...
EPS=1e-10 def crossP(aa,bb,cc,dd): a = (bb-aa).real b = (cc-dd).real c = (bb-aa).imag d = (cc-dd).imag e = (cc-aa).real f = (cc-aa).imag det = a*d - b*c if abs(det) <EPS: return(-9999+(-9999)*1j) x = (d*e-b*f)/det y = (-c*e+a*f)/det return(x+y*1j) def rangeP(st): ...
s842392122
s864901996
p00143
python
Runtime Error
# -*- coding: utf-8 -* import sys #if False: if True: fh=open('ALDS1_1_D6.txt','r') else: fh=sys.stdin input=fh.readline def main(): n = int(input()) a=[] for _ in range(n): a.append(int(input())) pmax=a[1]-a[0] for k in range(0, n-1): p=max(a[k+1:])-a[k] if p > pm...
# -*- coding: utf-8 -* import sys if False: #if True: fh=open('ALDS1_1_D1.txt','r') else: fh=sys.stdin input=fh.readline def main(): n = int(input()) a=[] for _ in range(n): a.append(int(input())) pmax=a[1]-a[0] pmin=a[0] for j in range(1, n): pmax = max(a[j]-pmin,pmax)...
s068113817
s686388828
p02258
python
Runtime Error
# -*- coding: utf-8 -* import sys if False: #if True: fh=open('ALDS1_1_D1.txt','r') else: fh=sys.stdin input=fh.readline def main(): n = int(input()) a=[] for _ in range(n): a.append(int(input())) #print('a=',a) pmax=a[1]-a[0] for k in range(0, n-1): p=max(a[k+1:])-a[k] ...
# -*- coding: utf-8 -* import sys if False: #if True: fh=open('ALDS1_1_D1.txt','r') else: fh=sys.stdin input=fh.readline def main(): n = int(input()) a=[] for _ in range(n): a.append(int(input())) pmax=a[1]-a[0] pmin=a[0] for j in range(1, n): pmax = max(a[j]-pmin,pmax)...
s599218150
s686388828
p02258
python
Time Limit Exceeded
import sys w = input().lower() lines = sys.stdin.read() line=lines[0:lines.find('END_OF_TEXT')].lower().split() print(line.count(w))
import sys w = input().lower() lines = sys.stdin.read() line=lines[0:lines.find('END_OF_TEXT')].lower().split() print(line.count(w))
s866008389
s106620244
p02419
python
Runtime Error
intMax = -100000000 inputData = int(input()) inputList = list() count = 0 while count < inputData: inputList.append(int(input())) count = count + 1 inputDataMax = intMax inputDataMin = inputList[0] count2 = 1 while count2 < inputData: inputDataMax = max(inputDataMax, inputList[count2] - inputDataMin) ...
intMax = -10000000000 inputData = int(input()) inputList = list() for i in range(inputData): inputList.append(int(input())) inputDataMax = intMax inputDataMin = inputList[0] for i in range(inputData - 1): inputDataMax = max(inputDataMax, inputList[i + 1] - inputDataMin) inputDataMin = min(inputDataMin, in...
s633898954
s919104740
p02258
python
Time Limit Exceeded
intMax = -100000000 inputData = int(input()) inputList = list() count = 0 while count < inputData: inputList.append(int(input())) count = count + 1 inputDataMax = intMax inputDataMin = inputList[0] count2 = 1 while count2 < inputData: inputDataMax = max(inputDataMax, inputList[count2] - inputDataMin) ...
intMax = -10000000000 inputData = int(input()) inputList = list() for i in range(inputData): inputList.append(int(input())) inputDataMax = intMax inputDataMin = inputList[0] for i in range(inputData - 1): inputDataMax = max(inputDataMax, inputList[i + 1] - inputDataMin) inputDataMin = min(inputDataMin, in...
s141009690
s919104740
p02258
python
Time Limit Exceeded
intMax = -100000000 inputData = int(input()) inputList = list() count = 0 while count < inputData: inputList.append(int(input())) count = count + 1 inputDataMax = intMax inputDataMin = inputList[0] count2 = 1 while count2 < inputData: inputDataMax = max(inputDataMax, inputList[count2] - inputDataMin) ...
intMax = -10000000000 inputData = int(input()) inputList = list() for i in range(inputData): inputList.append(int(input())) inputDataMax = intMax inputDataMin = inputList[0] for i in range(inputData - 1): inputDataMax = max(inputDataMax, inputList[i + 1] - inputDataMin) inputDataMin = min(inputDataMin, in...
s642681030
s919104740
p02258
python
Time Limit Exceeded
mountain=[] for i in range(10): mountain[i]=int(input()) mountain.sort() fori in range(3): print(mountain[i])
mountain=[] for i in range(10): mountain.append(int(input())) mountain.sort() mountain.reverse() for i in range(3): print(mountain[i])
s514010004
s599470351
p00001
python
Runtime Error
mountain=[] for i in range(10): mountain[i]=int(input()) mountain.sort() for i in range(3): print(mountain[i])
mountain=[] for i in range(10): mountain.append(int(input())) mountain.sort() mountain.reverse() for i in range(3): print(mountain[i])
s006707679
s599470351
p00001
python
Runtime Error
mountain=[] for i in range(10): mountain[i]=int(input()) mountain.sort(::-1) for i in range(3): print(mountain[i])
mountain=[] for i in range(10): mountain.append(int(input())) mountain.sort() mountain.reverse() for i in range(3): print(mountain[i])
s424824405
s599470351
p00001
python
Runtime Error
mountain=[] for i in range(10): mountain[i]=int(input()) mountain.sort() mountain.reverse() for i in range(3): print(mountain[i])
mountain=[] for i in range(10): mountain.append(int(input())) mountain.sort() mountain.reverse() for i in range(3): print(mountain[i])
s797917815
s599470351
p00001
python
Runtime Error
import math deta=[float(i) for i in input().split()] h1=math.sqrt((deta[2]-deta[0])**2+(deta[3]-deta[1])**2) h2=math.sqrt((deta[4]-deta[2])**2+(deta[5]-deta[3])**2) h3=math.sqrt((deta[0]-deta[4])**2+(deta[1]-deta[5])**2) sub=(h1+h2+h3)/2 s=math.sqrt(sub*(sub-h1)*(sub-h2)*(sub-h3)) sum=((h1*h2*h3)/s)/4 a=2*deta[2]-2*de...
import math n=int(input()) for i in range(n): deta=[float(i) for i in input().split()] h1=math.sqrt((deta[2]-deta[0])**2+(deta[3]-deta[1])**2) h2=math.sqrt((deta[4]-deta[2])**2+(deta[5]-deta[3])**2) h3=math.sqrt((deta[0]-deta[4])**2+(deta[1]-deta[5])**2) sub=(h1+h2+h3)/2 s=math.sqrt(sub*(sub-h1...
s110186981
s398805927
p00010
python
Runtime Error
import sys s=[input()] while(True): n=input() if n=="0": print(s.pop()) elif n=="": sys.exit() else: s.append(n)
import sys s=[] while True: try: n=int(input()) except: sys.exit() if n==0: print(s.pop()) else: s.append(n)
s116051221
s566558465
p00013
python
Runtime Error
import sys s=[int(input())] while(True): n=input() if n=="0": print(s.pop()) elif n=="": sys.exit() else: s.append(int(n))
import sys s=[] while True: try: n=int(input()) except: sys.exit() if n==0: print(s.pop()) else: s.append(n)
s382675037
s566558465
p00013
python
Runtime Error
class Dice: def __init__(self): self.omote=1 self.sita=2 self.migi=3 self.ue=4 self.hidari=5 self.ura=6 def North(self): self.omote,self.ue,self.ura,self.sita=self.sita,self.omote,self.ue,self.ura def East(self): self.omote,self.hidari,self.u...
class Dice: def __init__(self): self.omote=1 self.sita=2 self.migi=3 self.ue=5 self.hidari=4 self.ura=6 def North(self): self.omote,self.ue,self.ura,self.sita=self.sita,self.omote,self.ue,self.ura def East(self): self.omote,self.hidari,self.u...
s686521996
s430522597
p00425
python
Runtime Error
class Dice: def __init__(self): self.omote=1 self.sita=2 self.migi=3 self.ue=5 self.hidari=4 self.ura=6 def North(self): self.omote,self.ue,self.ura,self.sita=self.sita,self.omote,self.ue,self.ura def East(self): self.omote,self.hidari,self.u...
class Dice: def __init__(self): self.omote=1 self.sita=2 self.migi=3 self.ue=5 self.hidari=4 self.ura=6 def North(self): self.omote,self.ue,self.ura,self.sita=self.sita,self.omote,self.ue,self.ura def East(self): self.omote,self.hidari,self.u...
s586912671
s430522597
p00425
python
Runtime Error
import sys class Dice: def __init__(self): self.omote=1 self.sita=2 self.migi=3 self.ue=5 self.hidari=4 self.ura=6 def North(self): self.omote,self.ue,self.ura,self.sita=self.sita,self.omote,self.ue,self.ura def East(self): self.omote,self.hi...
class Dice: def __init__(self): self.omote=1 self.sita=2 self.migi=3 self.ue=5 self.hidari=4 self.ura=6 def North(self): self.omote,self.ue,self.ura,self.sita=self.sita,self.omote,self.ue,self.ura def East(self): self.omote,self.hidari,self.u...
s772886870
s430522597
p00425
python
Runtime Error
class Dice: def __init__(self): self.omote=1 self.sita=2 self.migi=3 self.ue=5 self.hidari=4 self.ura=6 def North(self): self.omote,self.ue,self.ura,self.sita=self.sita,self.omote,self.ue,self.ura def East(self): self.omote,self.hidari,self.u...
class Dice: def __init__(self): self.omote=1 self.sita=2 self.migi=3 self.ue=5 self.hidari=4 self.ura=6 def North(self): self.omote,self.ue,self.ura,self.sita=self.sita,self.omote,self.ue,self.ura def East(self): self.omote,self.hidari,self.u...
s932157776
s430522597
p00425
python
Runtime Error
def dfs(index,n,m,c,dp): if dp[index][m] != 30: return dp[index][m] if index==n: return n+1 if m==c[index]: return 1 if m<c[index]: return dfs(index+1,n,m,c,dp) ret=min(dfs(index+1,n,m,c,dp), dfs(index+1,n,m-c[index],c,dp)+1, dfs(index,n,m-...
m,n=[int(i) for i in input().split()] c=[int(i) for i in input().split()] dp=[[int(1e4) for i in range(m+1)] for j in range(n+1)] i=n-1 while i>=0: for j in range(m+1): if j==c[i]: dp[i][j]=1 elif j<c[i]: dp[i][j]=dp[i+1][j] else: dp[i][j]=min(dp[i+1][j],d...
s631788682
s920088063
p02314
python
Runtime Error
class Vector2: """ A simple 2D vector class. @Author:whitestone0811(Vir_MeL0) """ def __init__(self,x,y): self.x=x self.y=y def __add__(self,other): return Vector2(self.x+other.x,self.y+other.y) def __sub__(self,other): return Vector2(self.x-other.x,self.y-oth...
class Vector2: """ A simple 2D vector class. @Author:whitestone0811(Vir_MeL0) """ def __init__(self,x,y): self.x=x self.y=y def __add__(self,other): return Vector2(self.x+other.x,self.y+other.y) def __sub__(self,other): return Vector2(self.x-other.x,self.y-oth...
s032364753
s253172561
p00035
python
Runtime Error
def Solve(c,s): if s: for i in range(9): if c[i]>4:return False elif c[i]>=2: cc=c[:] cc[i]-=2 if Solve(cc,False):return True else: if c.count(0)+c.count(3)==9:return True else: for i in range(9): ...
def Solve(c,s): if s: if max(c)>4:return False for i in range(9): if c[i]>=2: cc=c[:] cc[i]-=2 if Solve(cc,False):return True else: check=0 for i in range(4):check+=c.count(3*i) if check==9:return True el...
s144121063
s613447063
p00043
python
Time Limit Exceeded
def Solve(c,s): if s: if max(c)>4:return False for i in range(9): if c[i]>=2: cc=c[:] cc[i]-=2 if Solve(cc,False):return True else: check=0 for i in range(4):check+=c.count(3*i) if check==9:return True el...
def Solve(c,s): if s: if max(c)>4:return False for i in range(9): if c[i]>=2: cc=c[:] cc[i]-=2 if Solve(cc,False):return True else: check=0 for i in range(4):check+=c.count(3*i) if check==9:return True el...
s202184149
s613447063
p00043
python
Time Limit Exceeded
def Solve(c,s): if s: if max(c)>4:return False for i in range(9): if c[i]>=2: cc=c[:] cc[i]-=2 if Solve(cc,False):return True else: check=0 for i in range(4):check+=c.count(3*i) if check==9:return True el...
def Solve(c,s): if s: if max(c)>4:return False for i in range(9): if c[i]>=2: cc=c[:] cc[i]-=2 if Solve(cc,False):return True else: check=0 for i in range(4):check+=c.count(3*i) if check==9:return True el...
s295447871
s613447063
p00043
python
Time Limit Exceeded
while True: n=int(input()) if n==0:break res={} li=[] for i in range(n): d=[int(num) for num in input().split(' ')] res[d[0]-1]+=d[1]*d[2] if d[0]-1 not in li:li.append(d[0]-1) flag=False for i in li: if res[i]>=1000000: print(i+1) flag...
while True: n=int(input()) if n==0:break res={} li=[] for i in range(n): d=[int(num) for num in input().split(' ')] if d[0]-1 in res: res[d[0]-1]+=d[1]*d[2] else: res[d[0]-1]=d[1]*d[2] li.append(d[0]-1) flag=False for i in li: ...
s663192246
s018964962
p00100
python
Runtime Error
while True: a=[int(num)for num in input().split(' ')] if a[0]==0:break s=[] cnt=0 def rep(r,c,nest): global cnt f=s[r][c] if f=='.':return s[r][c]='.' if r>0: if s[r-1][c]==f:rep(r-1,c,False) if r<a[0]-1: if s[r+1][c]==f:rep(r+1...
''' DFS(TLE) while True: a=[int(num)for num in input().split(' ')] if a[0]==0:break s=[] cnt=0 def rep(r,c,nest): global cnt f=s[r][c] if f=='.':return s[r][c]='.' if r>0: if s[r-1][c]==f:rep(r-1,c,False) if r<a[0]-1: if s[r+1][...
s649631175
s096149245
p00118
python
Runtime Error
import sys sys.setrecursionlimit(9000) while True: a=[int(num)for num in input().split(' ')] if a[0]==0:break s=[] cnt=0 def rep(r,c,nest): global cnt f=s[r][c] if f=='.':return s[r][c]='.' if r>0: if s[r-1][c]==f:rep(r-1,c,False) if r<a[0]...
''' DFS(TLE) while True: a=[int(num)for num in input().split(' ')] if a[0]==0:break s=[] cnt=0 def rep(r,c,nest): global cnt f=s[r][c] if f=='.':return s[r][c]='.' if r>0: if s[r-1][c]==f:rep(r-1,c,False) if r<a[0]-1: if s[r+1][...
s791906152
s096149245
p00118
python
Runtime Error
while True: n=int(input()) if n==0:break b=[[int(p)for p in input().split(" ")],[int(p)for p in input().split(" ")]] mem=[[1145141919 for i in range(n)]for j in range(2)] mem[1][0]=True que=[[0,0,0],[1,0,0]] count=1145141919 while len(que)!=0: d=que.pop(0) state=b[d[0]][d...
def bfs(b): mem=[[False for i in range(n)]for j in range(2)] st=[0,0] for i in range(2): if b[i][0]!=1:continue while st[i]<n-1 and b[i][st[i]+1]==1: st[i]+=1 if st[i]==n-1:return 0 mem[0][st[0]]=True mem[1][st[1]]=True que=[[0,st[0],0],[1,st[1],0]] while ...
s226129414
s686497935
p00230
python
Runtime Error
while True: n=int(input()) if n==0:break b=[[int(p)for p in input().split(" ")],[int(p)for p in input().split(" ")]] mem=[[1145141919 for i in range(n)]for j in range(2)] que=[[0,0,0],[1,0,0]] count=1145141919 while len(que)!=0: d=que.pop(0) state=b[d[0]][d[1]] if sta...
def bfs(b): mem=[[False for i in range(n)]for j in range(2)] st=[0,0] for i in range(2): if b[i][0]!=1:continue while st[i]<n-1 and b[i][st[i]+1]==1: st[i]+=1 if st[i]==n-1:return 0 mem[0][st[0]]=True mem[1][st[1]]=True que=[[0,st[0],0],[1,st[1],0]] while ...
s584280564
s686497935
p00230
python
Runtime Error
while True: #for t in range(1): n=int(input()) #n=8 if n==0:break b=[[int(p)for p in input().split(" ")],[int(p)for p in input().split(" ")]] #b=[[0,0,0,2,2,2,0,0],[1,1,1,1,0,0,0,0]] mem=[[False for i in range(n)]for j in range(2)] mem[0][0]=True mem[1][0]=True que=[[0,0,0],[1,0,0]] ...
def bfs(b): mem=[[False for i in range(n)]for j in range(2)] st=[0,0] for i in range(2): if b[i][0]!=1:continue while st[i]<n-1 and b[i][st[i]+1]==1: st[i]+=1 if st[i]==n-1:return 0 mem[0][st[0]]=True mem[1][st[1]]=True que=[[0,st[0],0],[1,st[1],0]] while ...
s338039484
s686497935
p00230
python
Runtime Error
def bfs(b): mem=[[False for i in range(n)]for j in range(2)] st=[0,0] for i in range(2): while b[i][st[i]+1]==1: st[i]+=1 mem[0][st[0]]=True mem[1][st[1]]=True que=[[0,0,0],[1,0,0]] while len(que)!=0: d=que.pop(0) des=(d[0]+1)%2 cst=d[2]+1 ...
def bfs(b): mem=[[False for i in range(n)]for j in range(2)] st=[0,0] for i in range(2): if b[i][0]!=1:continue while st[i]<n-1 and b[i][st[i]+1]==1: st[i]+=1 if st[i]==n-1:return 0 mem[0][st[0]]=True mem[1][st[1]]=True que=[[0,st[0],0],[1,st[1],0]] while ...
s513866629
s686497935
p00230
python
Runtime Error