Dataset Viewer
Auto-converted to Parquet Duplicate
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
from sys import stdin x = [int(input()) for i in range(10)] x.sort().reverse() for i in range(3): print(i)
from sys import stdin x = [int(input()) for i in range(10)] x.sort(reverse=True) for i in range(3): print(x[i])
s097979335
s854661751
p00001
python
Runtime Error
import re while True: n = int(raw_input()) for i in range(n): print re.sub("Hoshino", "Hoshina", raw_input())
n = int(raw_input()) for i in range(n): print raw_input().replace("Hoshino", "Hoshina")
s215262569
s820431856
p00101
python
Runtime Error
DIR = {">": (0, 1), "<": (0, -1), "^": (-1, 0), "v": (1, 0)} while True: w, h = m(int, raw_input().split()) if w == 0 and h == 0: break m = [] for i in range(w): m.append([c for c in raw_input().strip()]) x = 0 y = 0 while m[x][y] != '.': i = m[x][y] if i =...
DIR = {'>': (0, 1), '<': (0, -1), '^': (-1, 0), 'v': (1, 0)} while True: w, h = map(int, raw_input().split()) if w == 0 and h == 0: break m = [[] for i in range(w)] for i in range(w): m[i] = [c for c in raw_input().strip()] x = 0 y = 0 while m[x][y] !=...
s412001467
s730004033
p00104
python
Runtime Error
DIR = {">": (0, 1), "<": (0, -1), "^": (-1, 0), "v": (1, 0)} while True: w, h = map(int, raw_input().split()) if w == 0 and h == 0: break m = [[] in i for range(w)] for i in range(w): m[i] = [c for c in raw_input().strip()] x = 0 y = 0 while m[x][y] != '.': i = m[x...
DIR = {'>': (0, 1), '<': (0, -1), '^': (-1, 0), 'v': (1, 0)} while True: w, h = map(int, raw_input().split()) if w == 0 and h == 0: break m = [[] for i in range(w)] for i in range(w): m[i] = [c for c in raw_input().strip()] x = 0 y = 0 while m[x][y] !=...
s241495377
s730004033
p00104
python
Runtime Error
from sys import stdout cs = { 1: [None] + list("abcde"), 2: [None] + list("fghij"), 3: [None] + list("klmno"), 4: [None] + list("pqrst"), 5: [None] + list("uvwxy"), 6: [None] + list("z.?! "), } while True: try: it = iter(raw_input().strip()) except ValueError: break ...
from sys import stdout cs = { 1: [None] + list("abcde"), 2: [None] + list("fghij"), 3: [None] + list("klmno"), 4: [None] + list("pqrst"), 5: [None] + list("uvwxy"), 6: [None] + list("z.?! "), } while True: try: it = iter(raw_input().strip()) except EOFError: break ...
s862565694
s256950333
p00127
python
Runtime Error
from sys import stdout cs = { 1: [None] + list("abcde"), 2: [None] + list("fghij"), 3: [None] + list("klmno"), 4: [None] + list("pqrst"), 5: [None] + list("uvwxy"), 6: [None] + list("z.?! "), } while True: try: it = iter(raw_input().strip()) except ValueError: break ...
from sys import stdout cs = { 1: [None] + list("abcde"), 2: [None] + list("fghij"), 3: [None] + list("klmno"), 4: [None] + list("pqrst"), 5: [None] + list("uvwxy"), 6: [None] + list("z.?! "), } while True: try: it = iter(raw_input().strip()) except EOFError: break ...
s722045536
s256950333
p00127
python
Runtime Error
from sys import stdout def upper(n): if n < 5: return list("* ") else: return list(" *") def lower(n): m = n % 5 a = ['*'] * m + [' '] a = a + ['*'] * (5 - len(a)) return a def abacus(n): return upper(n) + ['='] + lower(n) while True: try: ns = map(int, ("...
from sys import stdout def upper(n): if n < 5: return ['*', ' '] else: return [' ', '*'] def lower(n): m = n % 5 return ['*'] * m + [' '] + ['*'] * (4 - m) def abacus(n): return upper(n) + ['='] + lower(n) res = [] while True: try: ns = map(int, ('00000' + raw_inp...
s666255224
s717788542
p00128
python
Runtime Error
from sys import stdout def upper(n): if n < 5: return list("* ") else: return list(" *") def lower(n): m = n % 5 a = ['*'] * m + [' '] a = a + ['*'] * (5 - len(a)) return a def abacus(n): return upper(n) + ['='] + lower(n) while True: try: ns = map(int, ("...
from sys import stdout def upper(n): if n < 5: return ['*', ' '] else: return [' ', '*'] def lower(n): m = n % 5 return ['*'] * m + [' '] + ['*'] * (4 - m) def abacus(n): return upper(n) + ['='] + lower(n) res = [] while True: try: ns = map(int, ('00000' + raw_inp...
s158784048
s717788542
p00128
python
Runtime Error
from sys import stdout def upper(n): if n < 5: return list("* ") else: return list(" *") def lower(n): m = n % 5 a = ['*'] * m + [' '] a = a + ['*'] * (5 - len(a)) return a def abacus(n): return upper(n) + ['='] + lower(n) while True: try: ns = map(int, ('...
from sys import stdout def upper(n): if n < 5: return ['*', ' '] else: return [' ', '*'] def lower(n): m = n % 5 return ['*'] * m + [' '] + ['*'] * (4 - m) def abacus(n): return upper(n) + ['='] + lower(n) res = [] while True: try: ns = map(int, ('00000' + raw_inp...
s869390157
s717788542
p00128
python
Runtime Error
while True: n = raw_input() if not n: break else: n = int(n) print "3C{0:0>2}".format(n % 39)
while True: try: n = int(raw_input()) m = n % 39 print "3C{0:0>2}".format(m if m != 0 else 39) except: break
s743093422
s784689497
p00148
python
Runtime Error
import math def check(a): for i, v in enumerate(a): if v != i + 1: return False else: if i == len(a) - 1: return True while True: n = int(raw_input()) if n == 0: break a = map(int, raw_input().split()) if sum(a) != (lambda s: s * (...
import math def check(a): for i, v in enumerate(a): if v != i + 1: return False else: if i == len(a) - 1: return True while True: n = int(raw_input()) if n == 0: break a = map(int, raw_input().split()) if sum(a) != (lambda s: s * (...
s047570846
s165457032
p00262
python
Runtime Error
print map(int,raw_input().split(' ')).sort().join(' ')
a = sorted(map(int, raw_input().split(' '))) for i in a: print i,
s532894861
s925180251
p02483
python
Runtime Error
def act(t,m,l): t = (t+m) % len(l); del l[t-1] return (t-1) % (len(l)+1) while True: i = raw_input().split() n = int(i[0]) m = int(i[1]) if n == 0 and m == 0: break else: l = range(1,n+1) t = 0 for i in range(n-1): tt = act(t,m,l); ...
def act(t,m,l): t = (t+m) % len(l); del l[t-1] return (t-1) % (len(l)+1) while True: i = raw_input().split() n = int(i[0]) m = int(i[1]) if n == 0 and m == 0: break else: l = range(1,n+1) t = 0 for i in range(n-1): tt = act(t,m,l); ...
s665464244
s165443978
p00085
python
Runtime Error
[n,q] = map(int,input().split()) t = [ 0 for _ in range(n) ] for _ in range(q): [a,v] = map(int,input().split()) t[a-1] += v p = t.index(max(t)) print("{} {}".format(p+1,t[p]))
[n,q] = map(int,input().split()) t = [ 0 for _ in range(n) ] max_idx = 0 max_val = 0 for _ in range(q): [a,v] = map(int,input().split()) t[a-1] += v if max_idx == a-1: if v > 0: max_val = t[a-1] else: max_val = max(t) max_idx = t.index(max_val) eli...
s451661496
s199787507
p00099
python
Time Limit Exceeded
def search(n,d,t): b = 0 e = n r = 0 while True: r += 1 if b > e: return r else: i = (b+e)//2 if t == d[i]: return r elif t < d[i]: e = i - 1 else: b = i + 1 while True: ...
def search(n,d,t): b = 0 e = n-1 r = 0 while True: if b > e: return r else: r += 1 i = (b+e)//2 if t == d[i]: return r elif t < d[i]: e = i - 1 else: b = i + 1 while Tr...
s505513713
s829768290
p00188
python
Runtime Error
def search(n,d,t): b = 0 e = n r = 0 while True: r += 1 if b > e: return r else: i = (b+e)//2 if t == d[i]: return r elif t < d[i]: e = i - 1 else: b = i + 1 while True: ...
def search(n,d,t): b = 0 e = n-1 r = 0 while True: if b > e: return r else: r += 1 i = (b+e)//2 if t == d[i]: return r elif t < d[i]: e = i - 1 else: b = i + 1 while Tr...
s143541845
s829768290
p00188
python
Runtime Error
def mul(v,u): s = 0 for i in range(len(v)): s += v[i]*u[i] return s [n,m] = list(map(int,input().split())) t = [ list( 0 for i in range(m) ) for j in range(n) ] while True: d = list(map(int,input().split())) if d == [0,0,0]: break else: t[d[0]-1][d[1]-1] = d[2] c = in...
def mul(v,u): s = 0 for i in range(len(u)): s += v[u[i][0]] * u[i][1] return s [n,m] = list(map(int,input().split())) t = [ [] for j in range(n) ] while True: d = list(map(int,input().split())) if d == [0,0,0]: break else: t[d[0]-1].append([d[1]-1,d[2]]) c = int(input...
s974060022
s603673186
p00281
python
Time Limit Exceeded
N,M,Q = map(int,input().split()) a = list(map(int,input().split())) q = map(int,input().split()) t = [ 1 for i in range(N) ] i = 0 for m in range(M): if a[m] % 2 == 1: s = -1 else: s = 1 aa = a[m] while aa > 0: i = (i + s) % N if t[i] == 1: aa -= 1 t[i...
N,M,Q = map(int,input().split()) a = map(int,input().split()) q = map(int,input().split()) t = [ i for i in range(N) ] n = N i = 0 for aa in a: if aa % 2 == 1: i = (i - aa) % n else: i = (i + aa) % n del t[i] n -= 1 for i in q: if i in t: print(1) else: pri...
s365898534
s864564286
p00296
python
Time Limit Exceeded
n = int(raw_input()) u = raw_input() q = int(raw_input()) def cmd_set(q,u): x = int(q[0]) y = int(q[1]) z = q[2] h = u[:x-1] t = u[y:] zz= z*(y-x+1) return h+zz+t def cmd_comp(q, u): a = int(q[0]) b = int(q[1]) c = int(q[2]) d = int(q[3]) s = u[a-1:b] t = u[c-1:d...
n = int(raw_input()) u = raw_input() q = int(raw_input()) def cmd_set(q,u): x = int(q[0]) y = int(q[1]) z = q[2] h = u[:x-1] t = u[y:] zz= z*(y-x+1) return h+zz+t def cmd_comp(q, u): a = int(q[0]) b = int(q[1]) c = int(q[2]) d = int(q[3]) s = u[a-1:b] t = u[c-1:d...
s353565584
s910712115
p00350
python
Runtime Error
#include <cstdio> #include <vector> #include <algorithm> #include <cstring> #include <string> #include <cctype> #include <sstream> #include <cmath> #include <climits> #include <set> #include <iostream> #include <map> #include <functional> #include <cstdlib> #include <numeric> #include <queue> #include <complex> #includ...
n = int(input()) for _ in range(n): x1,y1,x2,y2,x3,y3 = map(float, input().split()) gx = (x1+x2+x3)/3 gy = (y1+y2+y3)/3 G=( y2*x1-y1*x2 +y3*x2-y2*x3 +y1*x3-y3*x1 ) Xc= ((x1*x1+y1*y1)*(y2-y3)+(x2*x2+y2*y2)*(y3-y1)+(x3*x3+y3*y3)*(y1-y2))/(2*G) Yc=-((x1*x1+y1*y1)*(x2-x3)+(x2*x2+y2*y2)*(x3-x1)+(x3*x...
s701534005
s685092580
p00010
python
Runtime Error
from itertools import product while(True): H,W = map(int,input().split()) if not H: break ma = 0 for i in range(H): ma |= (int(input().replace(".","0").replace("*","1"),2) << ((H-i-1)*W)) flag = False hw = [[h,w] for h,w in product(range(H,0,-1),range(W,0,-1))] hw = sorted(hw,key=lam...
# ref: http://judge.u-aizu.ac.jp/onlinejudge/review.jsp?rid=924554#1 from itertools import product while(True): H,W = map(int,input().split()) if not H: break ma = [list(map(int,input().replace(".","1").replace("*","0")))+[0] for _ in range(H)] for i,j in product(range(1,H),range(W)): if ma[i][j...
s019774858
s857269474
p00116
python
Time Limit Exceeded
from itertools import product # from line_profiler import LineProfiler def main(): while(True): W, H = map(int,input().split()) if not W: break # ma = [[-1]*(W+2) for _ in range(H+2)] ps = [[] for _ in range(5)] ans = 10**10 for i in range(H): for j,a in e...
from heapq import heappop,heappush # from line_profiler import LineProfiler def main(): while(True): W, H = map(int,input().split()) if not W: break B = float('inf') Bi = -1 consequNodes = [] monsterNodes = [[] for _ in range(5)] idx = 0 for i in range...
s848416563
s160716520
p00215
python
Time Limit Exceeded
from itertools import product # from line_profiler import LineProfiler def main(): while(True): W, H = map(int,input().split()) if not W: break # ma = [[-1]*(W+2) for _ in range(H+2)] ps = [[] for _ in range(5)] ans = 10**10 for i in range(H): for j,a in e...
from heapq import heappop,heappush # from line_profiler import LineProfiler def main(): while(True): W, H = map(int,input().split()) if not W: break B = float('inf') Bi = -1 consequNodes = [] monsterNodes = [[] for _ in range(5)] idx = 0 for i in range...
s209297985
s160716520
p00215
python
Time Limit Exceeded
from itertools import product # from line_profiler import LineProfiler def main(): while(True): W, H = map(int,input().split()) if not W: break # ma = [[-1]*(W+2) for _ in range(H+2)] ps = [[] for _ in range(5)] ans = 10**10 for i in range(H): for j,a in e...
from heapq import heappop,heappush # from line_profiler import LineProfiler def main(): while(True): W, H = map(int,input().split()) if not W: break B = float('inf') Bi = -1 consequNodes = [] monsterNodes = [[] for _ in range(5)] idx = 0 for i in range...
s781981619
s160716520
p00215
python
Time Limit Exceeded
from itertools import product # from line_profiler import LineProfiler def main(): while(True): W, H = map(int,input().split()) if not W: break # ma = [[-1]*(W+2) for _ in range(H+2)] ps = [[] for _ in range(5)] ans = 10**10 for i in range(H): for j,a in e...
from heapq import heappop,heappush # from line_profiler import LineProfiler def main(): while(True): W, H = map(int,input().split()) if not W: break B = float('inf') Bi = -1 consequNodes = [] monsterNodes = [[] for _ in range(5)] idx = 0 for i in range...
s989693413
s160716520
p00215
python
Time Limit Exceeded
from itertools import product # from line_profiler import LineProfiler def main(): while(True): W, H = map(int,input().split()) if not W: break # ma = [[-1]*(W+2) for _ in range(H+2)] ps = [[] for _ in range(5)] ans = 10**10 for i in range(H): for j,a in e...
from heapq import heappop,heappush # from line_profiler import LineProfiler def main(): while(True): W, H = map(int,input().split()) if not W: break B = float('inf') Bi = -1 consequNodes = [] monsterNodes = [[] for _ in range(5)] idx = 0 for i in range...
s281086625
s160716520
p00215
python
Time Limit Exceeded
while(True): m,n = map(int,input().split()) if not m: break a = list(range(1,m+1)) b = [input() for _ in range(n)] t = [str(i+1) for i in range(n)] t[2::3] = ["Fizz"]*len(t[2::3]) t[4::5] = ["Buzz"]*len(t[4::5]) t[14::15] = ["FizzBuzz"]*len(t[14::15]) i=0 for j in range(n): ...
while(True): m,n = map(int,input().split()) if not m: break a = list(range(1,m+1)) b = [input() for _ in range(n)] t = [str(i+1) for i in range(n)] t[2::3] = ["Fizz"]*len(t[2::3]) t[4::5] = ["Buzz"]*len(t[4::5]) t[14::15] = ["FizzBuzz"]*len(t[14::15]) i=0 for j in range(n): ...
s119354333
s922590389
p00221
python
Runtime Error
from math import sqrt, ceil N = 10100000 temp = [True]*(N+1) temp[0] = temp[1] = False for i in range(2, ceil(sqrt(N+1))): if temp[i]: temp[i+i::i] = [False]*(len(temp[i+i::i])) quadruplet = [True, False, True, False, False, False, True, False,True] ans = [0]*N for i in range(8,N): if temp[i] and temp...
from math import sqrt, ceil N = 10100000 temp = [True]*(N+1) temp[0] = temp[1] = False for i in range(2, ceil(sqrt(N+1))): if temp[i]: temp[i+i::i] = [False]*(len(temp[i+i::i])) quadruplet = [True, False, True, False, False, False, True, False,True] ans = [0]*N for i in range(8,N): if temp[i] and temp...
s361686119
s579306631
p00222
python
Time Limit Exceeded
from line_profiler import LineProfiler from collections import deque def main(): while(True): W, H = map(int, input().split()) # print(W,H) if not W: break tx,ty = map(int, input().split()) kx,ky = map(int, input().split()) ma = [[False]*(W+2) for _ in range(H+2)] ...
# from line_profiler import LineProfiler from collections import deque from sys import stdin def main(): while(True): W, H = map(int, stdin.readline().split()) if not W: break tx,ty = map(int, stdin.readline().split()) kx,ky = map(int, stdin.readline().split()) ma = [[False]...
s747637393
s518822140
p00223
python
Runtime Error
# from line_profiler import LineProfiler from collections import deque def main(): while(True): W, H = map(int, input().split()) # print(W,H) if not W: break tx,ty = map(int, input().split()) kx,ky = map(int, input().split()) ma = [[False]*(W+2) for _ in range(H+2)] ...
# from line_profiler import LineProfiler from collections import deque from sys import stdin def main(): while(True): W, H = map(int, stdin.readline().split()) if not W: break tx,ty = map(int, stdin.readline().split()) kx,ky = map(int, stdin.readline().split()) ma = [[False]...
s168857780
s518822140
p00223
python
Time Limit Exceeded
# from line_profiler import LineProfiler from collections import deque from sys import stdin def main(): while(True): W, H = map(int, sys.stdin().split()) if not W: break tx,ty = map(int, sys.stdin().split()) kx,ky = map(int, sys.stdin().split()) ma = [[False]*(W+2) for _ in...
# from line_profiler import LineProfiler from collections import deque from sys import stdin def main(): while(True): W, H = map(int, stdin.readline().split()) if not W: break tx,ty = map(int, stdin.readline().split()) kx,ky = map(int, stdin.readline().split()) ma = [[False]...
s707834581
s518822140
p00223
python
Runtime Error
from line_profiler import LineProfiler from collections import deque from sys import stdin def main(): while(True): W, H = map(int, stdin.readline().split()) if not W: break tx,ty = map(int, stdin.readline().split()) kx,ky = map(int, stdin.readline().split()) ma = [[False]*(...
# from line_profiler import LineProfiler from collections import deque from sys import stdin def main(): while(True): W, H = map(int, stdin.readline().split()) if not W: break tx,ty = map(int, stdin.readline().split()) kx,ky = map(int, stdin.readline().split()) ma = [[False]...
s669080304
s518822140
p00223
python
Runtime Error
from line_profiler import LineProfiler from collections import deque from sys import stdin def main(): while(True): W, H = map(int, stdin.readline().split()) if not W: break tx,ty = map(int, stdin.readline().split()) kx,ky = map(int, stdin.readline().split()) ma = [[False]*(...
# from line_profiler import LineProfiler from collections import deque from sys import stdin def main(): while(True): W, H = map(int, stdin.readline().split()) if not W: break tx,ty = map(int, stdin.readline().split()) kx,ky = map(int, stdin.readline().split()) ma = [[False]...
s604727891
s518822140
p00223
python
Runtime Error
import math def combination(p, q): if q < 0 or p < q: return 0 return math.factorial(p) / math.factorial(q) / math.factorial(p - q) a, b, c = map(int, input().split()) c -= a * b print(int(combination(c + a - 1, c)))
import math def combination(p, q): if q < 0 or p < q: return 0 return math.factorial(p) // math.factorial(q) // math.factorial(p - q) a, b, c = map(int, input().split()) c -= a * b print(combination(c + a - 1, c))
s641882138
s752914568
p00514
python
Runtime Error
#include<stdio.h> char a, b;int main(){for(a=1;a<=9;a++)for(b=1;b<=9;b++)printf("%dx%d=%d\n",a,b,a*b);return 0;}
for i in range(1,10): for j in range(1,10): print str(i) + "x" + str(j) + "=" + str(i * j)
s496090697
s491857484
p00000
python
Runtime Error
#include<stdio.h> char a, b;int main(){for(a=1;a<=9;a++)for(b=1;b<=9;b++)printf("%dx%d=%d\n",a,b,a*b);return 0;}
for i in range(1,10): for j in range(1,10): print str(i) + "x" + str(j) + "=" + str(i * j)
s393993684
s491857484
p00000
python
Runtime Error
a
for i in range(1,10): for j in range(1,10): print str(i) + "x" + str(j) + "=" + str(i * j)
s845379079
s491857484
p00000
python
Runtime Error
a
for i in range(1,10): for j in range(1,10): print str(i) + "x" + str(j) + "=" + str(i * j)
s545132824
s491857484
p00000
python
Runtime Error
for i in range(9): for j in range(9): print "%dx%d=%d", %(i+1, j+1, (i+1)*(j+1)
for i in range(9): for j in range(9): print "%dx%d=%d" %(i+1,j+1, (i+1)*(j+1))
s382589577
s458844379
p00000
python
Runtime Error
import math print math.pow(input(),3)
n = int(input()) print(n ** 3)
s825570374
s066227749
p02388
python
Runtime Error
import math print(math.pow(input(),3))
n = int(input()) print(n ** 3)
s519236151
s066227749
p02388
python
Runtime Error
import math x = parseInt(input()) print(math.pow(x,3))
n = int(input()) print(n ** 3)
s127892703
s066227749
p02388
python
Runtime Error
print(input()**3)
n = int(input()) print(n ** 3)
s298161725
s066227749
p02388
python
Runtime Error
data = list(map(int,input.split())) print data[0] * data[1]
[a, b] = map(int,input().split()) print("{} {}".format(a * b , (a + b) * 2))
s805002254
s875568287
p02389
python
Runtime Error
[a,b,c] = map(int,intput().split()) print({True: 'Yes', False: 'No'}[a < b < c])
def lessthen (a, b): return a < b def range (a, b, c): return lessthen(a, b) and lessthen(b, c) a, b, c = map(int, input().split()) if range(a, b, c): print('Yes') else: print('No')
s693804190
s743841156
p02392
python
Runtime Error
N = int(input()) print(' {}'.format(' '.join([str(c) for c in range(1, N + 1) if c % 3 == 0 or '3' in str(c)])
N = int(input()) print(' {}'.format(' '.join([str(c) for c in range(1, N + 1) if c % 3 == 0 or '3' in str(c)])))
s104692905
s896282108
p02406
python
Runtime Error
n = int(raw_input()) for i in range(0,n); a = int(raw_input()) b = int(raw_input()) ans = str(a+b) if len(ans) > 80; print 'overflow' else: print sum
n = int(raw_input()) for i in range(0,n): a = int(raw_input()) b = int(raw_input()) ans = str(a+b) if len(ans) > 80: print 'overflow' else: print ans
s395937900
s808103138
p00015
python
Runtime Error
n = input() print(n**3)
n = input() print(n**3)
s074337608
s339919500
p02388
python
Runtime Error
a=input() b=input() print(a*b) print(2*(a+b))
x,y = map(int,raw_input().split()) print x*y,2*(x+y)
s755247834
s011325676
p02481
python
Runtime Error
a=input() b=input() print a*b print 2*(a+b)
x,y = map(int,raw_input().split()) print x*y,2*(x+y)
s897464617
s011325676
p02481
python
Runtime Error
a,b=map(int,raw_input().split(' ') print a*b, 2*(a+b)
x,y = map(int,raw_input().split()) print x*y,2*(x+y)
s156851621
s011325676
p02481
python
Runtime Error
a,b = map(int,raw_input().split()) if a > b: print "a > b" elif a < b: print "a < b" else: print "a == b"
a,b = map(int,raw_input().split()) if a>b: print 'a > b' elif a<b: print 'a < b' else: print 'a == b'
s809524278
s363682447
p02482
python
Runtime Error
for i in range(1000): print 'Hello World'
for i in range(1000): print 'Hello World'
s638094512
s096938405
p02484
python
Runtime Error
for i in range(1000) print "Hello World"
for i in range(1000): print 'Hello World'
s173276489
s096938405
p02484
python
Runtime Error
for i in range(1000): print "Hello World"
for i in range(1000): print 'Hello World'
s815457802
s096938405
p02484
python
Runtime Error
for i in range(1000): print "Hello World"
for i in range(1000): print 'Hello World'
s951972015
s096938405
p02484
python
Runtime Error
import math N = int(input()) for i in range(N): a = int(input()) b = int(input()) if math.log10(a) > 79 or math.log10(b) > 79 or math.log10(a + b) > 79: print("overflow") else: print(a + b)
import math N = int(input()) for i in range(N): a = int(input()) b = int(input()) if a >= 10 ** 80 or b >= 10 ** 80 or a + b >= 10 ** 80: print("overflow") else: print(a + b)
s590343632
s185890313
p00015
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 + 1): area += cross(points[i], points[(i+1)%n]) return area / 2 import sys p = [] for line in sys.stdin: p.append(list(map(float, line.split(',')))) print(are...
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(complex(x,...
s611122214
s554582586
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: p.append(list(map(float, line.split(',')))) print(area_po...
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(complex(x,...
s827702449
s554582586
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: p.append(list(map(float, line.split(',')))) print("{0:06f...
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(complex(x,...
s640727921
s554582586
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: if line == "": break p.append(list(map(float, ...
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(complex(x,...
s566244561
s554582586
p00079
python
Runtime Error
#???????????\?????¨??????????????????????????°??? a = [1, 2, 4] MAX_N = 30 for i in xrange(3, MAX_N+1): a.append(a[i-3] + a[i-2] + a[i-1]) while True: n = input() if n == 0: break else: print a[n-1] / 3650 + 1
a = [1, 2, 4] MAX_N = 30 for i in xrange(3, MAX_N+1): a.append(a[i-3] + a[i-2] + a[i-1]) while True: n = input() if n == 0: break else: print a[n-1] / 3650 + 1
s767178206
s514841418
p00168
python
Runtime Error
N = int(input()) a = [] for i in range(N): a.append(int(input())) mx = -10**12 for j in range(1, N): for i in range(j): mx = max(mx, a[j] - a[i]) print(mx)
N = int(input()) #R[0] minv = int(input()) maxv = -10**12 #R[1..N-1] for j in range(1, N): r = int(input()) maxv = max(maxv, r - minv) minv = min(minv, r) print(maxv)
s819391313
s526467142
p02258
python
Time Limit Exceeded
print(input().reverse())
print(input()[::-1])
s865028366
s422576013
p00006
python
Runtime Error
import math def IsPrimer(num): if num == 1: isprimer = False else: isprimer = True for divisor in range(2, int(math.sqrt(num)) + 1): if num % divisor == 0: isprimer = False break return isprimer while True: try: num = eval(input()) count = 0 for i in range(2, num + 1): if IsPrimer(i): ...
# sieve of Eratosthenes N = 1000000 isprimer = [True for i in range(N)] isprimer[0], isprimer[1] = False, False for i in range(2, N): if not isprimer[i]: continue for j in range(i * 2, N, i): isprimer[j] = False while True: try: num = eval(input()) count = 0 for i in range(2, num + 1): if isprimer[i]: ...
s893658935
s427481011
p00009
python
Time Limit Exceeded
N = (eval(input())) for _ in range(N): x1, y1, x2, y2, x3, y3, x4, y4 = [eval(item) for item in input().split()] if (x1 - x2)/(y1 - y2) == (x3 - x4)/(y3 - y4): print('YES') else: print('NO')
N = eval(input()) for _ in range(N): x1, y1, x2, y2, x3, y3, x4, y4 = [eval(item) for item in input().split()] if abs(x1 - x2) < 1e-10 or abs(x3 - x4) < 1e-10: print('YES' if abs(x1 - x2) < 1e-10 and abs(x3 - x4) < 1e-10 else 'NO') elif abs((y1 - y2)/(x1 - x2) - (y3 - y4)/(x3 - x4)) < 1e-10: print('YES') else: ...
s968213507
s468267081
p00021
python
Runtime Error
N = (eval(input())) for _ in range(N): x1, y1, x2, y2, x3, y3, x4, y4 = [eval(item) for item in input().split()] if (x1 - x2)/(y1 - y2) == (x3 - x4)/(y3 - y4): print('YES') else: print('NO')
N = eval(input()) for _ in range(N): x1, y1, x2, y2, x3, y3, x4, y4 = [eval(item) for item in input().split()] if abs(x1 - x2) < 1e-10 or abs(x3 - x4) < 1e-10: print('YES' if abs(x1 - x2) < 1e-10 and abs(x3 - x4) < 1e-10 else 'NO') elif abs((y1 - y2)/(x1 - x2) - (y3 - y4)/(x3 - x4)) < 1e-10: print('YES') else: ...
s853618302
s468267081
p00021
python
Runtime Error
N = (eval(input())) for _ in range(N): x1, y1, x2, y2, x3, y3, x4, y4 = [eval(item) for item in input().split()] if (x1 == x2 and x3 == x4) or (y1 == y2 and y3 == y4): print('YES') elif (x1 - x2)/(y1 - y2) == (x3 - x4)/(y3 - y4): print('YES') else: print('NO')
N = eval(input()) for _ in range(N): x1, y1, x2, y2, x3, y3, x4, y4 = [eval(item) for item in input().split()] if abs(x1 - x2) < 1e-10 or abs(x3 - x4) < 1e-10: print('YES' if abs(x1 - x2) < 1e-10 and abs(x3 - x4) < 1e-10 else 'NO') elif abs((y1 - y2)/(x1 - x2) - (y3 - y4)/(x3 - x4)) < 1e-10: print('YES') else: ...
s540000425
s468267081
p00021
python
Runtime Error
N = eval(input()) for _ in range(N): x1, y1, x2, y2, x3, y3, x4, y4 = [eval(item) for item in input().split()] if (x1 == x2 and x3 == x4) or (y1 == y2 and y3 == y4): print('YES') elif (x1 - x2)/(y1 - y2) == (x3 - x4)/(y3 - y4): print('YES') else: print('NO')
N = eval(input()) for _ in range(N): x1, y1, x2, y2, x3, y3, x4, y4 = [eval(item) for item in input().split()] if abs(x1 - x2) < 1e-10 or abs(x3 - x4) < 1e-10: print('YES' if abs(x1 - x2) < 1e-10 and abs(x3 - x4) < 1e-10 else 'NO') elif abs((y1 - y2)/(x1 - x2) - (y3 - y4)/(x3 - x4)) < 1e-10: print('YES') else: ...
s624833265
s468267081
p00021
python
Runtime Error
while True: try: print(sum([eval(x) for x in input().split()])) except EOFError: brea
while True: try: print(sum([eval(x) for x in input().split()])) except EOFError: break
s390550891
s828619802
p00586
python
Runtime Error
import math def is_prime(num): prime = True for i in range(2,int(math.sqrt(num))+1): if num%i == 0: prime = False break return prime num_set = set() try: while True: num_set.add(eval(input())) except EOFError: count = 0 for x in num_set: count = count + (1 if is_prime(x) else 0) print(count)
import math def is_prime(num): prime = True for i in range(2,int(math.sqrt(num))+1): if num%i == 0: prime = False break return prime num_set = set() try: while True: num_set.add(eval(input())) except EOFError: count = 0 for x in num_set: count = count + (1 if is_prime(x) else 0) print(count)
s270787534
s562515673
p02257
python
Runtime Error
try: s = '' while True: s = s + input().lower() except EOFError: [print(chr(o)+' : '+str(s.count(chr(o)))) for o in range(ord('a'),ord('z')+1)]
try: s = '' while True: s = s + input().lower() except EOFError: [print(chr(o)+' : '+str(s.count(chr(o)))) for o in range(ord('a'),ord('z')+1)]
s020169973
s038881001
p02417
python
Runtime Error
# 0028 import collections array = [0]*100 i = 0 while True: a = input() if a == '': break array[i] = int(a) i += 1 array = filter(lambda a: a != 0, array) counter = collections.Counter(array).most_common() for a, count in counter: if count < counter[0][1]: break print(a)
# 0028 array = [] while True: try: a = input() array.append(int(a)) except EOFError: break s = set(array) mx = max(sorted(s, reverse=True), key = array.count) for a in sorted(s, key = array.count, reverse=True): print(a) if a == mx: break
s432767459
s751782055
p00028
python
Runtime Error
# 0028 import collections array = [0]*100 i = 0 while True: try: array[i] = int(input()) i += 1 except EOFError: break array = filter(lambda a: a != 0, array) max = max(array.count()) print(filter(lambda a: array.count(a) == max, array), sep = '\n')
# 0028 array = [] while True: try: a = input() array.append(int(a)) except EOFError: break s = set(array) mx = max(sorted(s, reverse=True), key = array.count) for a in sorted(s, key = array.count, reverse=True): print(a) if a == mx: break
s181423045
s751782055
p00028
python
Runtime Error
# 0028 import collections array = [] i = 0 while True: try: array.append(int(input())) i += 1 except ValueError: break count = list(map(lambda a: array.count(a), array)) modes = list(set(filter(lambda a: array.count(a) == max(count), array))) print(*modes, sep = '\n')
# 0028 array = [] while True: try: a = input() array.append(int(a)) except EOFError: break s = set(array) mx = max(sorted(s, reverse=True), key = array.count) for a in sorted(s, key = array.count, reverse=True): print(a) if a == mx: break
s691692808
s751782055
p00028
python
Runtime Error
# 0028 array = [] while True: try: a = input() array.append(int(a)) except EOFError: break s = set(array) mx = max(list(map(lambda a: array.count(a), s))) modes = list(filter(lambda a: array.count(a) == mx), sorted(s)) print(*modes, sep = '\n')
# 0028 array = [] while True: try: a = input() array.append(int(a)) except EOFError: break s = set(array) mx = max(sorted(s, reverse=True), key = array.count) for a in sorted(s, key = array.count, reverse=True): print(a) if a == mx: break
s322323376
s751782055
p00028
python
Runtime Error
# 0028 array = [] while True: try: a = input() if a == '': break array.append(int(a)) except EOFError: break s = set(array) mx = max(list(map(lambda a: array.count(a), s))) modes = list(filter(lambda a: array.count(a) == mx), sorted(s)) print(*modes, sep = '\n')
# 0028 array = [] while True: try: a = input() array.append(int(a)) except EOFError: break s = set(array) mx = max(sorted(s, reverse=True), key = array.count) for a in sorted(s, key = array.count, reverse=True): print(a) if a == mx: break
s284192584
s751782055
p00028
python
Runtime Error
# 0028 array = []*100 i = 0 while True: try: a = input() array[i] = int(a) i += 1 except EOFError: break s = set(array) mx = max(list(map(lambda a: array.count(a), s))) modes = list(filter(lambda a: array.count(a) == mx, sorted(s))) print(*modes, sep = '\n')
# 0028 array = [] while True: try: a = input() array.append(int(a)) except EOFError: break s = set(array) mx = max(sorted(s, reverse=True), key = array.count) for a in sorted(s, key = array.count, reverse=True): print(a) if a == mx: break
s244156714
s751782055
p00028
python
Runtime Error
n1 = n2 = 0 while True: try: a, b, c = map(int, line.split(',')) if a**2 + b**2 == c**2: n1 += 1 elif a == b: n2 += 1 except EOFError: break print(n1) print(n2)
# 0032 n1 = n2 = 0 while True: try: a, b, c = map(int, input().split(',')) if a**2 + b**2 == c**2: n1 += 1 elif a == b: n2 += 1 except EOFError: break print(n1) print(n2)
s627474424
s130779294
p00032
python
Runtime Error
# 0032 import sys n1 = n2 = 0 for _ in sys.stdin: a, b, c = map(int, line.split(',')) if a**2 + b**2 == c**2: n1 += 1 elif a == b: n2 += 1 print(n1) print(n2)
# 0032 n1 = n2 = 0 while True: try: a, b, c = map(int, input().split(',')) if a**2 + b**2 == c**2: n1 += 1 elif a == b: n2 += 1 except EOFError: break print(n1) print(n2)
s046222211
s130779294
p00032
python
Runtime Error
n = int(input()) for i in range(n): arr = map(int, input().split()) b,c = 0,0 for i in range(len(arr)): if b < arr[i]: b = arr[i] continue if c < arr[i]: c = arr[i] continue print("NO") break else: print("YES")
def ball(nums): b, c = 0, 0 for i in range(len(nums)): if b < nums[i]: b = nums[i] continue if c < nums[i]: c = nums[i] continue return "NO" return "YES" N = int(input()) for _ in range(N): a = list(map(int, input().split())) ...
s067087895
s659675862
p00033
python
Runtime Error
n = int(input()) for i in range(n): arr = map(int, input().split()) b,c = 0,0 flag = True for i in range(len(arr)): if b < arr[i]: b = arr[i] continue if c < arr[i]: c = arr[i] continue print("NO") flag = False break...
def ball(nums): b, c = 0, 0 for i in range(len(nums)): if b < nums[i]: b = nums[i] continue if c < nums[i]: c = nums[i] continue return "NO" return "YES" N = int(input()) for _ in range(N): a = list(map(int, input().split())) ...
s328716154
s659675862
p00033
python
Runtime Error
def ball(nums): ????????b,c = 0,0 for i in range(len(a)): if b < a[i]: b = a[i] continue if c < a[i]: c = a[i] continue return "NO" return "YES" ?? N = int(input()) ?? for _ in range(N): ????????a = list(map(int, input().split())) ????????p...
def ball(nums): b, c = 0, 0 for i in range(len(nums)): if b < nums[i]: b = nums[i] continue if c < nums[i]: c = nums[i] continue return "NO" return "YES" N = int(input()) for _ in range(N): a = list(map(int, input().split())) ...
s849389816
s659675862
p00033
python
Runtime Error
n = int(input()) p = list(range(n+1)) for i in range(n): p[i], p[n] = map(int, input().split()) # table[i][j] : M_i??????M_j??????????????????????°?????????° table = [[0] * n for i in range(n)] # ??£????????£???2???????????????????????? for i in range(n-1): table[i][i+1] = p[i]*p[i+1]*p[i+2] for k in range...
n = int(input()) p = list(range(n+2)) for i in range(1,n+1): p[i], p[n+1] = map(int, input().split()) # table[i][j] : M_i??????M_j??????????????????????°?????????° table = [[0] * (n+1) for i in range(n+1)] # ??£????????£???2???????????????????????? for i in range(1,n): # 1<=i,i+1<=n table[i][i+1] = p[i]*p[i...
s892419756
s451103333
p02234
python
Runtime Error
n = int(input()) p = list(range(n+2)) for i in range(1,n+1): p[i], p[n+1] = map(int, input().split()) # table[i][j] : M_i??????M_j??????????????????????°?????????° table = [[0] * (n+1) for i in range(n+1)] # ??£????????£???2???????????????????????? for i in range(1,n): # 1<=i,i+1<=n table[i][i+1] = p[i]*p[i...
n = int(input()) p = list(range(n+2)) for i in range(1,n+1): p[i], p[n+1] = map(int, input().split()) # table[i][j] : M_i??????M_j??????????????????????°?????????° table = [[0] * (n+1) for i in range(n+1)] # ??£????????£???2???????????????????????? for i in range(1,n): # 1<=i,i+1<=n table[i][i+1] = p[i]*p[i...
s464008871
s451103333
p02234
python
Runtime Error
n = int(input()) p = list(range(n+2)) for i in range(1,n+1): p[i], p[n+1] = map(int, input().split()) # table[i][j] : M_i??????M_j??????????????????????°?????????° table = [[0] * (n+1) for i in range(n+1)] # ??£????????£???2???????????????????????? for i in range(1,n): # 1<=i,i+1<=n table[i][i+1] = p[i]*p[i...
n = int(input()) p = list(range(n+2)) for i in range(1,n+1): p[i], p[n+1] = map(int, input().split()) # table[i][j] : M_i??????M_j??????????????????????°?????????° table = [[0] * (n+1) for i in range(n+1)] # ??£????????£???2???????????????????????? for i in range(1,n): # 1<=i,i+1<=n table[i][i+1] = p[i]*p[i...
s395905580
s451103333
p02234
python
Runtime Error
n = int(input()) for k in range(n): a = input() b = input() len_a, len_b = len(a), len(b) table = [[0] * (len_b +1) for i in range(len_a + 1)] for i in range(1,len_a+1): for j in range(1,len_b+1): if a[i-1] == b[j-1]: table[i][j] = table[i-1][j-1] + 1 ...
def Ics(X, Y): m = len(X) n = len(Y) c1 = [0] * (n + 1) for i in range(m): d = X[i] c2 = c1[:] for j in range(n): if (d == Y[j]): c1[j + 1] = c2[j] + 1 elif (c1[j + 1] < c1[j]): c1[j + 1] = c1[j] return (c1[-1]) q = in...
s462065406
s398831978
p02235
python
Time Limit Exceeded
n = int(input()) for k in range(n): a = input() b = input() len_a, len_b = len(a), len(b) table = [[0] * (len_b +1) for i in range(len_a + 1)] for i in range(1,len_a+1): for j in range(1,len_b+1): if a[i-1] == b[j-1]: table[i][j] = table[i-1][j-1] + 1 ...
def Ics(X, Y): m = len(X) n = len(Y) c1 = [0] * (n + 1) for i in range(m): d = X[i] c2 = c1[:] for j in range(n): if (d == Y[j]): c1[j + 1] = c2[j] + 1 elif (c1[j + 1] < c1[j]): c1[j + 1] = c1[j] return (c1[-1]) q = in...
s994657888
s398831978
p02235
python
Time Limit Exceeded
n = int(input()) for k in range(n): a = input() b = input() len_a, len_b = len(a), len(b) table = [[0] * (len_b +1) for i in range(len_a + 1)] for i in range(len_a): for j in range(len_b): if a[i] == b[j]: table[i+1][j+1] = table[i][j] + 1 else: ...
def Ics(X, Y): m = len(X) n = len(Y) c1 = [0] * (n + 1) for i in range(m): d = X[i] c2 = c1[:] for j in range(n): if (d == Y[j]): c1[j + 1] = c2[j] + 1 elif (c1[j + 1] < c1[j]): c1[j + 1] = c1[j] return (c1[-1]) q = in...
s562976644
s398831978
p02235
python
Time Limit Exceeded
n = int(input()) for k in range(n): a = input() b = input() len_a, len_b = len(a), len(b) table = [[0] * (len_b +1) for i in range(len_a + 1)] for i in range(len_a): a_i = a[i] for j in range(len_b): if a_i == b[j]: table[i+1][j+1] = table[i][j] + 1 ...
def Ics(X, Y): m = len(X) n = len(Y) c1 = [0] * (n + 1) for i in range(m): d = X[i] c2 = c1[:] for j in range(n): if (d == Y[j]): c1[j + 1] = c2[j] + 1 elif (c1[j + 1] < c1[j]): c1[j + 1] = c1[j] return (c1[-1]) q = in...
s641975945
s398831978
p02235
python
Time Limit Exceeded
n = int(input()) for k in range(n): a = input() b = input() len_a, len_b = len(a), len(b) table = [[0] * (len_b +1) for i in range(len_a + 1)] for i in range(len_a): a_i = a[i] table_i = table[i] for j in range(len_b): if a_i == b[j]: table[i...
def Ics(X, Y): m = len(X) n = len(Y) c1 = [0] * (n + 1) for i in range(m): d = X[i] c2 = c1[:] for j in range(n): if (d == Y[j]): c1[j + 1] = c2[j] + 1 elif (c1[j + 1] < c1[j]): c1[j + 1] = c1[j] return (c1[-1]) q = in...
s300444234
s398831978
p02235
python
Time Limit Exceeded
q = int(input()) t = [] for i in range(q): X = input() Y = input() m = len(X) n = len(Y) c1 = [0] * (n + 1) for i in range(m): d = X[i] c2 = c1[:] for j in range(n): if (d == Y[j]): c1[j + 1] = c2[j] + 1 elif (c1[j + 1] < c1[j]): ...
def Ics(X, Y): m = len(X) n = len(Y) c1 = [0] * (n + 1) for i in range(m): d = X[i] c2 = c1[:] for j in range(n): if (d == Y[j]): c1[j + 1] = c2[j] + 1 elif (c1[j + 1] < c1[j]): c1[j + 1] = c1[j] return (c1[-1]) q = in...
s161077569
s398831978
p02235
python
Runtime Error
q = int(input()) t = [] for i in range(q): X = input() Y = input() m = len(X) n = len(Y) c1 = [0] * (n + 1) for i in range(m): d = X[i] c2 = c1[:] for j in range(n): if (d == Y[j]): c1[j + 1] = c2[j] + 1 elif (c1[j + 1] < c1[j]): ...
def Ics(X, Y): m = len(X) n = len(Y) c1 = [0] * (n + 1) for i in range(m): d = X[i] c2 = c1[:] for j in range(n): if (d == Y[j]): c1[j + 1] = c2[j] + 1 elif (c1[j + 1] < c1[j]): c1[j + 1] = c1[j] return (c1[-1]) q = in...
s441522585
s398831978
p02235
python
Time Limit Exceeded
n = int(input()) a = [[0]*n for i in range(n)] for i in range(n): v = list(map(int, input().split())) for j in range(v[1]): a[u - 1][v[2 + j] - 1] = 1 for i in range(n): print(*a[i])
n = int(input()) a = [[0]*n for i in range(n)] for i in range(n): v = list(map(int, input().split())) u = v[0] - 1 for j in v[2:]: a[u][j - 1] = 1 print(*a[i])
s263009834
s035329247
p02237
python
Runtime Error
n = int(input()) a = [[0]*n for i in range(n)] for i in range(n): v = list(map(int, input().split())) u = v[0] k = v[1] for j in range(k): a[u - 1][v[2 + j] - 1] = 1 d = [0] * n ## time:discover f = [0] * n ## time:finish isDiscovered = [False] * n time_stamp = 0 def dfs(u): globa...
n = int(input()) a = [[] for i in range(n)] for i in range(n): v = list(map(int, input().split())) u = v[0] - 1 for j in v[2:]: a[u].append(j-1) d = [0] * n f = [0] * n isDiscovered = [False] * n time_stamp = 0 def dfs(x): global time_stamp isDiscovered [x] = True time_stamp += 1 ...
s538732389
s755767518
p02238
python
Runtime Error
n = int(input()) a = [[0]*n for i in range(n)] for i in range(n): v = list(map(int, input().split())) u = v[0] k = v[1] for j in range(k): a[u - 1][v[2 + j] - 1] = 1 d = [0] * n ## time:discover f = [0] * n ## time:finish isDiscovered = [False] * n time_stamp = 0 def dfs(x): globa...
n = int(input()) a = [[] for i in range(n)] for i in range(n): v = list(map(int, input().split())) u = v[0] - 1 for j in v[2:]: a[u].append(j-1) d = [0] * n f = [0] * n isDiscovered = [False] * n time_stamp = 0 def dfs(x): global time_stamp isDiscovered [x] = True time_stamp += 1 ...
s571699553
s755767518
p02238
python
Runtime Error
n = int(input()) a = [[0]*n for i in range(n)] for i in range(n): v = list(map(int, input().split())) u = v[0] k = v[1] for j in range(k): a[u - 1][v[2 + j] - 1] = 1 d = [0] * n f = [0] * n isDiscovered = [False] * n time_stamp = 0 def dfs(x): global time_stamp isDiscovered [x] = Tr...
n = int(input()) a = [[] for i in range(n)] for i in range(n): v = list(map(int, input().split())) u = v[0] - 1 for j in v[2:]: a[u].append(j-1) d = [0] * n f = [0] * n isDiscovered = [False] * n time_stamp = 0 def dfs(x): global time_stamp isDiscovered [x] = True time_stamp += 1 ...
s911026437
s755767518
p02238
python
Runtime Error
n = int(input()) a = [[0]*n for i in range(n)] for i in range(n): v = list(map(int, input().split())) u = v[0] k = v[1] for j in range(k): a[u - 1][v[2 + j] - 1] = 1 d = [0] * n f = [0] * n isDiscovered = [False] * n time_stamp = 0 def dfs(x): global time_stamp isDiscovered [x] = Tr...
n = int(input()) a = [[] for i in range(n)] for i in range(n): v = list(map(int, input().split())) u = v[0] - 1 for j in v[2:]: a[u].append(j-1) d = [0] * n f = [0] * n isDiscovered = [False] * n time_stamp = 0 def dfs(x): global time_stamp isDiscovered [x] = True time_stamp += 1 ...
s814116266
s755767518
p02238
python
Runtime Error
n = int(input()) a = [[False]*n for i in range(n)] for i in range(n): v = list(map(int, input().split())) u = v[0] k = v[1] for j in range(k): a[u - 1][v[2 + j] - 1] = True d = [0] * n f = [0] * n isDiscovered = [False] * n time_stamp = 0 def dfs(x): global time_stamp isDiscovered [...
n = int(input()) a = [[] for i in range(n)] for i in range(n): v = list(map(int, input().split())) u = v[0] - 1 for j in v[2:]: a[u].append(j-1) d = [0] * n f = [0] * n isDiscovered = [False] * n time_stamp = 0 def dfs(x): global time_stamp isDiscovered [x] = True time_stamp += 1 ...
s056795454
s755767518
p02238
python
Runtime Error
n = int(input()) a = [[] for i in range(n)] for i in range(n): v = list(map(int, input().split())) u = v[0] - 1 for j in v[2:]: a[u].append(j-1) d = [0] * n isDiscovered = [False] * n def bfs(x): global time_stamp isDiscovered [x] = True time_stamp += 1 for i in a[x]: if n...
n = int(input()) a = [[] for i in range(n)] for i in range(n): v = list(map(int, input().split())) u = v[0] - 1 for j in v[2:]: a[u].append(j-1) d = [-1] * n isDiscovered = [False] * n def bfs(x): for i in a[x]: if not isDiscovered[i]: isDiscovered [i] = True d...
s589354271
s965393676
p02239
python
Runtime Error
End of preview. Expand in Data Studio
README.md exists but content is empty.
Downloads last month
9