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 |
|---|---|---|---|---|---|---|
while 1:
try:
s1 = raw_input()
s2 = raw_input()
l = len(s1)
f = False
for i in range(l,0,-1):
for j in range(0,l-i+1):
if j+i > l: break
x = s2.find(s1[j:j+i])
if x != -1:
f = True
... | while 1:
try:
s1 = raw_input()
s2 = raw_input()
if len(s1) < len(s2): s1,s2 = s2,s1
l = sum(min(s1.count(i), s2.count(i)) for i in set(list(s1)) & set(list(s2)))
if l == 0: print 0; continue
ans = 0
for i in range(len(s2)):
if len(s2) - i <= ans: b... | s396728146 | s211597978 | p00451 | python | Time Limit Exceeded |
while 1:
try:
s1 = raw_input()
s2 = raw_input()
if len(s1) < len(s2): s1,s2 = s2,s1
l = sum(min(s1.count(i), s2.count(i)) for i in set(list(s1)) & set(list(s2)))
f = False
for i in range(l,0,-1):
for j in range(0,l-i+1):
x = s2.find(s1[j:j+... | while 1:
try:
s1 = raw_input()
s2 = raw_input()
if len(s1) < len(s2): s1,s2 = s2,s1
l = sum(min(s1.count(i), s2.count(i)) for i in set(list(s1)) & set(list(s2)))
if l == 0: print 0; continue
ans = 0
for i in range(len(s2)):
if len(s2) - i <= ans: b... | s801174223 | s211597978 | p00451 | python | Time Limit Exceeded |
while 1:
try:
s1 = raw_input()
s2 = raw_input()
if len(s1) < len(s2): s1,s2 = s2,s1
l = sum(min(s1.count(i), s2.count(i)) for i in set(list(s1)) & set(list(s2)))
if l == 0: print 0; continue
f = False
for i in range(l,0,-1):
for j in range(len(s2)-... | while 1:
try:
s1 = raw_input()
s2 = raw_input()
if len(s1) < len(s2): s1,s2 = s2,s1
l = sum(min(s1.count(i), s2.count(i)) for i in set(list(s1)) & set(list(s2)))
if l == 0: print 0; continue
ans = 0
for i in range(len(s2)):
if len(s2) - i <= ans: b... | s116953806 | s211597978 | p00451 | python | Time Limit Exceeded |
from bisect import *
while 1:
n, lmt = map(int, raw_input().split())
if n == 0: break
p = [input() for i in range(n)]
p = sorted(set(i + j for i in p for j in p))
s = bisect(p, lmt)
ans = 0
for i in p[:s]:
t = bisect(p[:s], lmt - i)
ans = max(ans, i + p[t-1])
print ans | from bisect import *
while 1:
n, lmt = map(int, raw_input().split())
if n == 0: break
p = [input() for i in range(n)] + [0]
p = sorted(set(i + j for i in p for j in p))
s = bisect(p, lmt)
print max(i + p[bisect(p, lmt - i) - 1] for i in p[:s]) | s713395427 | s894834227 | p00452 | python | Time Limit Exceeded |
from bisect import *
while 1:
n, lmt = map(int, raw_input().split())
if n == 0: break
p = [input() for i in range(n)] + [0]
p = sorted(set(i + j for i in p for j in p))
s = bisect(p, lmt)
ans = 0
for i in p[:s]:
t = bisect(p[:s], lmt - i)
ans = max(ans, i + p[t-1])
print ... | from bisect import *
while 1:
n, lmt = map(int, raw_input().split())
if n == 0: break
p = [input() for i in range(n)] + [0]
p = sorted(set(i + j for i in p for j in p))
s = bisect(p, lmt)
print max(i + p[bisect(p, lmt - i) - 1] for i in p[:s]) | s988412258 | s894834227 | p00452 | python | Time Limit Exceeded |
from bisect import *
while 1:
n, lmt = map(int, raw_input().split())
if n == 0: break
p = [input() for i in range(n)] + [0]
p = sorted(set(i + j for i in p for j in p))
s = bisect(p, lmt)
print max(i + p[bisect(p[:s], lmt - i) - 1] for i in p[:s]) | from bisect import *
while 1:
n, lmt = map(int, raw_input().split())
if n == 0: break
p = [input() for i in range(n)] + [0]
p = sorted(set(i + j for i in p for j in p))
s = bisect(p, lmt)
print max(i + p[bisect(p, lmt - i) - 1] for i in p[:s]) | s314697756 | s894834227 | p00452 | python | Time Limit Exceeded |
from collections import deque
while 1:
c = input()
r = input()
if c == 0: break
l = [map(int, raw_input().split()) for i in range(r)]
ans = 0
d = [(-1,0),(0,-1),(1,0),(0,1)]
for i in range(c):
for j in range(r):
q = deque()
a = [[0]*c for x in range(r)]
... | while 1:
c = input()
r = input()
if c == 0: break
l = [map(int, raw_input().split()) for i in range(r)]
ans = 0
d = [(-1,0),(0,-1),(1,0),(0,1)]
def dfs(j, i, cnt):
global ans
ans = max(ans, cnt)
for x, y in d:
dx = x + i; dy = y + j
if ... | s004325913 | s927487006 | p00458 | python | Time Limit Exceeded |
from string import find
while 1:
n = input()
if n == 0: break
m = input()
s = raw_input()
t = "IOI"
for i in range(n-1):
t += "OI"
i = ans = 0
while 1:
tmp = find(s[i:-1], t)
if tmp < 0: break
i += tmp + 1
ans += 1
print ans | while 1:
n = input()
if n == 0: break
m = input()
s = raw_input()
t = "IOI" + "OI"*(n-1)
t_len = 3 + 2 *(n-1)
ans = 0
for i in range(m - t_len + 1):
if s[i:i+t_len] == t: ans += 1
print ans | s165424233 | s212127069 | p00461 | python | Time Limit Exceeded |
DIV = 100000
n, m = map(int, raw_input().split())
l = [input() for _ in range(n-1)]
ans = [0]*(n-1)
pos = 0
for _ in range(m):
k = input()
if k > 0:
for i in range(k): ans[pos+i] += 1
else:
for i in range(-1, k-1, -1):
ans[pos+i] += 1
pos += k
print sum((ans[i] * l[i])... | DIV = 100000
n, m = map(int, raw_input().split())
l = [0]*n
for i in range(n-1):
k = input()
l[i+1] = l[i] + k
ans = pos = 0
for _ in xrange(m):
k = input()
ans = (ans + abs(l[pos + k] - l[pos])) % DIV
pos += k
print ans | s093633991 | s189312520 | p00472 | python | Runtime Error |
DIV = 100000
n, m = map(int, raw_input().split())
l = [input() for _ in range(n-1)]
ans = [0]*(n-1)
pos = 0
for _ in xrange(m):
k = input()
if k > 0:
for i in xrange(k): ans[pos+i] += 1
else:
for i in xrange(-1, k-1, -1):
ans[pos+i] += 1
pos += k
print sum((ans[i] * l[... | DIV = 100000
n, m = map(int, raw_input().split())
l = [0]*n
for i in range(n-1):
k = input()
l[i+1] = l[i] + k
ans = pos = 0
for _ in xrange(m):
k = input()
ans = (ans + abs(l[pos + k] - l[pos])) % DIV
pos += k
print ans | s242030032 | s189312520 | p00472 | python | Runtime Error |
n = input()
l = [input() for i in range(n-1)]
dp = [[n*n]*2 for i in range(n+1)]
dp[1][0] = 0
for i in range(1,n):
for j in range(i+1,0,-1):
dp[j][1] = min(dp[j][1], dp[j][0]+l[i-1])
dp[j][0] = min(dp[j-1][0], dp[j-1][1]+l[i-1])
print min(dp[n/2]) | INF = 1<<31
n = input()
dp = [[[INF]*2 for _ in xrange(n/2+2)] for _ in range(2)]
dp[1][1][0] = dp[1][0][1] = 0
for i in range(2,n+1):
x = i % 2
s = input()
t = min(i,n/2)
for j in range(1,t+1):
dp[x][j][0] = min(dp[1-x][j-1][0], dp[1-x][j-1][1] + s)
dp[x][j][1] = min(dp[1-x][j][0] + s, ... | s048464451 | s824642113 | p00473 | python | Runtime Error |
INF = 1<<31
n = input()
l = [input() for i in range(n-1)]
dp = [[INF]*2 for i in range(n+1)]
dp[1][0] = 0
for i in range(1,n):
for j in range(i+1,0,-1):
dp[j][1] = min(dp[j][1], dp[j][0]+l[i-1])
dp[j][0] = min(dp[j-1][0], dp[j-1][1]+l[i-1])
print min(dp[n/2]) | INF = 1<<31
n = input()
dp = [[[INF]*2 for _ in xrange(n/2+2)] for _ in range(2)]
dp[1][1][0] = dp[1][0][1] = 0
for i in range(2,n+1):
x = i % 2
s = input()
t = min(i,n/2)
for j in range(1,t+1):
dp[x][j][0] = min(dp[1-x][j-1][0], dp[1-x][j-1][1] + s)
dp[x][j][1] = min(dp[1-x][j][0] + s, ... | s786028238 | s824642113 | p00473 | python | Runtime Error |
INF = 1<<31
n = input()
l = [input() for i in xrange(n-1)]
dp = [[INF]*2 for i in xrange(n+1)]
dp[1][0] = 0
for i in xrange(1,n):
for j in xrange(i+1,0,-1):
dp[j][1] = min(dp[j][1], dp[j][0]+l[i-1])
dp[j][0] = min(dp[j-1][0], dp[j-1][1]+l[i-1])
print min(dp[n/2]) | INF = 1<<31
n = input()
dp = [[[INF]*2 for _ in xrange(n/2+2)] for _ in range(2)]
dp[1][1][0] = dp[1][0][1] = 0
for i in range(2,n+1):
x = i % 2
s = input()
t = min(i,n/2)
for j in range(1,t+1):
dp[x][j][0] = min(dp[1-x][j-1][0], dp[1-x][j-1][1] + s)
dp[x][j][1] = min(dp[1-x][j][0] + s, ... | s268814968 | s824642113 | p00473 | python | Runtime Error |
INF = 1<<31
n = input()
l = [0]*(n+1)
for i in xrange(1,n):
l[i] = input()
dp = [[INF]*2 for i in xrange(n+1)]
dp[1][0] = 0
for i in xrange(1,n):
for j in xrange(i+1,0,-1):
dp[j][1] = min(dp[j][1], dp[j][0]+l[i])
dp[j][0] = min(dp[j-1][0], dp[j-1][1]+l[i])
print min(dp[n/2]) | INF = 1<<31
n = input()
dp = [[[INF]*2 for _ in xrange(n/2+2)] for _ in range(2)]
dp[1][1][0] = dp[1][0][1] = 0
for i in range(2,n+1):
x = i % 2
s = input()
t = min(i,n/2)
for j in range(1,t+1):
dp[x][j][0] = min(dp[1-x][j-1][0], dp[1-x][j-1][1] + s)
dp[x][j][1] = min(dp[1-x][j][0] + s, ... | s379004160 | s824642113 | p00473 | python | Runtime Error |
n, k = map(int, raw_input().split())
d = {}
for i in range(k):
a, b = map(int, raw_input().split())
d[a] = b
dp =[[[[0]*(n+1) for i in range(4)] for j in range(4)] for k in range(4)]
def solve(a, b, c, i):
if a == b == c: return 0
if i in d and d[i] != c: return 0
if i == n: return 1
dp[a][b][c]... | n, k = map(int, raw_input().split())
d = {}
for i in range(k):
a, b = map(int, raw_input().split())
d[a] = b
dp =[[[[0]*(n+1) for i in range(4)] for j in range(4)] for k in range(4)]
def solve(a, b, c, i):
if dp[a][b][c][i]: return dp[a][b][c][i]
if a == b == c: return 0
if i in d and d[i] != c: ret... | s566400070 | s381968910 | p00491 | python | Runtime Error |
a, b = map(int, raw_input().split())
p = map(int, raw_input().split())
q = map(int, raw_input().split())
ans = 0
for i in range(a):
if b - i <= ans: break
j = 0; k = i
cnt = 0
while 1:
if p[j] == q[k]:
cnt += 1; j += 1; k += 1
else: j += 1
if j == a: break
ans = m... | l = map(int, raw_input().split())
if len(l) == 2:
a = l[0]; b = l[1]
else:
a = l[0]; b = input()
p = map(int, raw_input().split())
q = map(int, raw_input().split())
ans = 0
for i in range(a):
if b - i <= ans or a - i <= ans: break
j = 0; k = i
cnt = 0
while 1:
if p[j] == q[k]:
... | s396466644 | s293192731 | p00495 | python | Runtime Error |
l = map(int, raw_input().split())
if len(l) == 2:
a = l[0]; b = l[1]
else:
a = l[0]; b = input()
p = map(int, raw_input().split())
q = map(int, raw_input().split())
ans = 0
#?°??????????
for i in range(a):
if b - i <= ans or a - i <= ans: break
j = 0; k = i
cnt = 0
while 1:
if p[j] == q[... | l = map(int, raw_input().split())
if len(l) == 2:
a = l[0]; b = l[1]
else:
a = l[0]; b = input()
p = map(int, raw_input().split())
q = map(int, raw_input().split())
ans = 0
for i in range(a):
if b - i <= ans or a - i <= ans: break
j = 0; k = i
cnt = 0
while 1:
if p[j] == q[k]:
... | s583093234 | s293192731 | p00495 | python | Runtime Error |
n, m = map(int, raw_input().split())
l = map(int, raw_input().split())
dp = [False for i in range(n + 1)]
for i in range(m):
if l[i] <= n: dp[l[i]] = True
cnt = 1
while 1:
if dp[n]: break
ndp = [False for i in range(n + 1)]
for i in range(n+1):
if dp[i]:
ndp[i] = True
for... | n, m = map(int, raw_input().split())
l = map(int, raw_input().split())
INF = 1<<31
dp = [INF]*(n+1)
dp[0] = 0
for c in l:
for i in range(n-c+1):
if dp[i] != INF:
dp[i + c] = min(dp[i] + 1, dp[i + c])
print dp[n] | s236732774 | s104434044 | p02314 | python | Time Limit Exceeded |
n = input()
l = []
l += [str(n) + ":"]
while 1:
if n == 1:break
for i in count(2):
if n % i == 0:
n /= i
l += [i]
break
print " ".join(map(str,l)) | n = input()
l = []
l += [str(n)+":"]
i = 2
while i * i <= n:
while n % i == 0:
l += [i]
n /= i
i += 1
if n > 1: l += [n]
print " ".join(map(str,l)) | s917925411 | s423211533 | p02467 | python | Runtime Error |
from itertools import count
n = input()
l = []
l += [str(n) + ":"]
while 1:
if n == 1:break
for i in count(2):
if n % i == 0:
n /= i
l += [i]
break
print " ".join(map(str,l)) | n = input()
l = []
l += [str(n)+":"]
i = 2
while i * i <= n:
while n % i == 0:
l += [i]
n /= i
i += 1
if n > 1: l += [n]
print " ".join(map(str,l)) | s940875055 | s423211533 | p02467 | python | Time Limit Exceeded |
n = input()
l = []
l += [str(n) + ":"]
while 1:
if n == 1:break
for i in xrange(2,n+1):
if n % i == 0:
n /= i
l += [i]
break
print " ".join(map(str,l)) | n = input()
l = []
l += [str(n)+":"]
i = 2
while i * i <= n:
while n % i == 0:
l += [i]
n /= i
i += 1
if n > 1: l += [n]
print " ".join(map(str,l)) | s554586063 | s423211533 | p02467 | python | Time Limit Exceeded |
def composite(d,n,s):
for a in (2,3,5,7):
maybe_prime = False
if pow(a,d,n) == 1:
maybe_prime = True
continue
for i in range(s):
if pow(a, 2**i * d, n) == n-1:
maybe_prime = True
break
return not probably_prime
r... | def composite(d,n,s):
for a in (2,3,5,7):
p = False
if pow(a,d,n) == 1:
continue
for i in range(s):
if pow(a, 2**i * d, n) == n-1:
p = True
break
if not p:
return True
return False
def is_prime(n):
if n in... | s749072160 | s847388113 | p02257 | python | Runtime Error |
import sys
n = int(input())
r0 = int(input())
r1 = int(input())
mx = r1-r0
mn = min(r1,r0)
for i in map(int,sys.stdin.readlines()):
if 0 < mx < i - mn:
mx = i - mn
elif 0 > i-mn > max:
mx = i - mn
mn = i
elif mn > i:
mn = i
print(mx) | import sys
n = int(input())
r0 = int(input())
r1 = int(input())
mx = r1-r0
mn = min(r1,r0)
for i in map(int,sys.stdin.readlines()):
if mx < i - mn:
mx = i - mn
if 0 > i-mn:
mn = i
elif mn > i:
mn = i
print(mx) | s548426181 | s175264377 | p02258 | python | Runtime Error |
import os
import math
def main():
lst = [0,0,0,0,0,0]
for i in range(0, int(input())):
temp = float(input())
if temp < 165:
lst[0] += 1
elif temp < 170:
lst[1] += 1
elif temp < 175:
lst[2] += 1
elif temp < 180:
lst[3] += 1
... | import os
import math
def main():
lst = [0,0,0,0,0,0]
for i in range(0, int(input())):
temp = float(input())
if temp < 165:
lst[0] += 1
elif temp < 170:
lst[1] += 1
elif temp < 175:
lst[2] += 1
elif temp < 180:
lst[3] += 1
... | s587910292 | s526906067 | p00136 | python | Runtime Error |
object Main {
def main(args: Array[String]): Unit = {
println("Hello World")
}
} | a = [x for x in range(9)]
for i in a:
for j in a:
print("{}x{}={}".format(i + 1, j + 1, (i + 1) * (j + 1))) | s436072969 | s955017857 | p00000 | python | Runtime Error |
from collections import defaultdict, Counter
from itertools import product, groupby, count, permutations, combinations
from math import pi, sqrt
from collections import deque
from bisect import bisect, bisect_left, bisect_right
from string import ascii_lowercase
from functools import lru_cache
import sys
sys.setrecursi... | from collections import defaultdict, Counter
from itertools import product, groupby, count, permutations, combinations
from math import pi, sqrt
from collections import deque
from bisect import bisect, bisect_left, bisect_right
from string import ascii_lowercase
from functools import lru_cache
import sys
sys.setrecursi... | s107147045 | s017435763 | p00282 | python | Runtime Error |
from collections import defaultdict
def longest_common_subsequence(s, t):
dp = [[0] * (len(t) + 1) for _ in range(len(s) + 1)]
for i in range(len(s)):
for j in range(len(t)):
if s[i] == t[j]:
dp[i + 1][j + 1] = dp[i][j] + 1
else:
dp[i + 1][j + 1]... | from collections import defaultdict
def longest_common_subsequence(s, t):
dp = [[0] * (len(t) + 1) for _ in range(len(s) + 1)]
for i in range(len(s)):
for j in range(len(t)):
if s[i] == t[j]:
dp[i + 1][j + 1] = dp[i][j] + 1
else:
dp[i + 1][j + 1]... | s203092115 | s961958718 | p02235 | python | Time Limit Exceeded |
from collections import defaultdict
def longest_common_subsequence(s, t):
dp = [[0] * (len(t) + 1) for _ in range(len(s) + 1)]
for i in range(len(s)):
for j in range(len(t)):
if s[i] == t[j]:
dp[i + 1][j + 1] = dp[i][j] + 1
else:
dp[i + 1][j + 1]... | from collections import defaultdict
def longest_common_subsequence(s, t):
dp = [[0] * (len(t) + 1) for _ in range(len(s) + 1)]
for i in range(len(s)):
for j in range(len(t)):
if s[i] == t[j]:
dp[i + 1][j + 1] = dp[i][j] + 1
else:
dp[i + 1][j + 1]... | s183342224 | s961958718 | p02235 | python | Time Limit Exceeded |
from collections import defaultdict
def longest_common_subsequence(s, t):
dp = [[0] * (len(t) + 1) for _ in range(len(s) + 1)]
for i in range(len(s)):
for j in range(len(t)):
if s[i] == t[j]:
dp[i + 1][j + 1] = dp[i][j] + 1
else:
dp[i + 1][j + 1]... | from collections import defaultdict
def longest_common_subsequence(s, t):
dp = [[0] * (len(t) + 1) for _ in range(len(s) + 1)]
for i in range(len(s)):
for j in range(len(t)):
if s[i] == t[j]:
dp[i + 1][j + 1] = dp[i][j] + 1
else:
dp[i + 1][j + 1]... | s016836672 | s961958718 | p02235 | python | Time Limit Exceeded |
from collections import defaultdict
def longest_common_subsequence(s, t):
dp = [[0] * (len(t) + 1) for _ in range(len(s) + 1)]
for i in range(len(s)):
for j in range(len(t)):
if s[i] == t[j]:
dp[i + 1][j + 1] = dp[i][j] + 1
else:
dp[i + 1][j + 1]... | from collections import defaultdict
def longest_common_subsequence(s, t):
dp = [[0] * (len(t) + 1) for _ in range(len(s) + 1)]
for i in range(len(s)):
for j in range(len(t)):
if s[i] == t[j]:
dp[i + 1][j + 1] = dp[i][j] + 1
else:
dp[i + 1][j + 1]... | s138068583 | s961958718 | p02235 | python | Time Limit Exceeded |
print(int(input())*int(input())*int(input()))
| n = int(input())
print(n*n*n)
| s565886440 | s401964620 | p02388 | python | Runtime Error |
h, w = map(int, input().split())
print(h*w)
print(2*h + 2*w)
| h, w = map(int, input().split())
print(h*w, 2*h+2*w)
| s390944787 | s781148375 | p02389 | python | Runtime Error |
h, w = map(int, src.input().split())
print(h*w, 2*h+2*w)
| h, w = map(int, input().split())
print(h*w, 2*h+2*w)
| s735372093 | s781148375 | p02389 | python | Runtime Error |
h, w = map(int, input().split())
print(h*w, 2*h+2*w)
| h, w = map(int, input().split())
print(h*w, 2*h+2*w)
| s172113888 | s781148375 | p02389 | python | Runtime Error |
a, b = [int(n) for n in src.readline().split()]
print('%s %s %.5f' % (a//b, a%b, a/b))
| a, b = [int(n) for n in input().split()]
print('%s %s %.5f' % (a//b, a%b, a/b))
| s957203969 | s707462457 | p02399 | python | Runtime Error |
from math import pi
r = int(input())
print('%.6f %.6f' % (r*r*pi, 2*r*pi))
| from math import pi
r = float(input())
print('%.6f %.6f' % (r*r*pi, 2*r*pi))
| s672366819 | s488725531 | p02400 | python | Runtime Error |
import math
r = int(input())
area = math.pi * r ** 2
circumference = 2 * math.pi * r
print("%.6f %.6f" % (area, circumference)) | import math
r = float(input())
area = math.pi * r ** 2
circumference = 2 * math.pi * r
print("%.6f %.6f" % (area, circumference)) | s168864726 | s807492600 | p02479 | python | Runtime Error |
import math
r = int(input())
area = math.pi * r ** 2
circumference = 2 * math.pi * r
print("%.6f %.6f" % (area, circumference)) | import math
r = float(input())
area = math.pi * r ** 2
circumference = 2 * math.pi * r
print("%.6f %.6f" % (area, circumference)) | s117434456 | s807492600 | p02479 | python | Runtime Error |
import sys
operators = {
"+": lambda a, b: a + b,
"-": lambda a, b: a - b,
"*": lambda a, b: a * b,
"/": lambda a, b: a // b,
}
for line in sys.stdin:
raw_a, op, raw_b = line.rstrip().split()
if op == "?":
break
a, b = map(int, [raw_a, raw_b])
result = operators[op](a, b)
... | import math
r = float(input())
area = math.pi * r ** 2
circumference = 2 * math.pi * r
print("%.6f %.6f" % (area, circumference)) | s691388763 | s807492600 | p02479 | python | Runtime Error |
import math
r = int(input())
area = math.pi * r ** 2
circumference = 2 * math.pi * r
print("%.6f %.6f" % (area, circumference)) | import math
r = float(input())
area = math.pi * r ** 2
circumference = 2 * math.pi * r
print("%.6f %.6f" % (area, circumference)) | s995108775 | s807492600 | p02479 | python | Runtime Error |
input() # skip
nums = input().split()
reversed_nums = reversed(nums)
print(' '.join(reversed_nums)) | import math
r = float(input())
area = math.pi * r ** 2
circumference = 2 * math.pi * r
print("%.6f %.6f" % (area, circumference)) | s165665511 | s807492600 | p02479 | python | Runtime Error |
nums = map(int, input().split())
sorted_nums = sorted(nums)
print(' '.join(sorted_nums)) | nums = map(int, input().split())
sorted_nums = sorted(nums)
print(' '.join(map(str, sorted_nums))) | s213182500 | s288635738 | p02483 | python | Runtime Error |
import sys
for line in sys.stdin:
if line === '0 0\n':
break
nums = map(int, line.split())
sorted_nums = sorted(nums)
print(' '.join(map(str, sorted_nums))) | import sys
i = 0
for line in sys.stdin:
i = i + 1
n = int(line.rstrip())
if n == 0:
break
print("Case %d: %s" % (i, n)) | s932103726 | s298183660 | p02489 | python | Runtime Error |
while True
card = input().rstrip()
if card == '-':
break
no_shuffle = int(input())
for _ in range(no_shuffle):
h = int(input())
card = card[:h] + card[h:]
print(card) | while True:
card = input().strip()
if card == '-':
break
no_shuffles = int(input())
for _ in range(no_shuffles):
h = int(input())
card = card[h:] + card[:h]
print(card) | s515885461 | s141442553 | p02510 | python | Runtime Error |
import numpy as np
r = int(input())
print ('{0:.6f} {1:.6f}'.format(r*r*np.pi, 2*r*np.pi))
| # coding : utf-8
import math as m
r = float(input())
print ('{0:.6f} {1:.6f}'.format(r*r*m.pi, 2*r*m.pi))
| s445984255 | s321654275 | p02400 | python | Runtime Error |
import numpy as np
r = float(input())
print ('{0:.6f} {1:.6f}'.format(r*r*np.pi, 2*r*np.pi))
| # coding : utf-8
import math as m
r = float(input())
print ('{0:.6f} {1:.6f}'.format(r*r*m.pi, 2*r*m.pi))
| s319974289 | s321654275 | p02400 | python | Runtime Error |
# coding : utf-8
n = int(input())
lst = map(int, input().split())
for i in range(n-1, -1, -1):
print ('%d ' % lst[i], end = '')
print ('')
| n = int(input())
lst = list(map(int, input().split()))
counter = 0
for i in (reversed(lst)):
counter += 1
print (i, end="")
if counter != n:
print ("", end=" ")
print ("")
| s416558695 | s669908956 | p02407 | python | Runtime Error |
import sys
slist = [i for i in range(1, 14)]
hlist = [i for i in range(1, 14)]
clist = [i for i in range(1, 14)]
dlist = [i for i in range(1, 14)]
for line in sys.stdin:
suit, rank = line.split()
rankn = int(rank)
if suit = 'S':
if rankn in slist:
slist.pop(rankn - 1)
elif suit = 'H'... | lst = [True for i in range(52)]
n = int(input())
for i in range (n):
suit, rank = input().split()
rankn = int(rank)
if suit == 'S':
lst[rankn-1] = False
elif suit == 'H':
lst[rankn+12] = False
elif suit == 'C':
lst[rankn+25] = False
else:
lst[rankn+38] = False
for... | s709249245 | s458470565 | p02408 | python | Runtime Error |
for i in range(1,10):
for j in range(1,10);
print('{}x{}={}', i, j, i*j)
| for i in range(1,10):
for j in range(1,10):
print("{0}x{1}={2}".format(i,j,i*j))
| s912318994 | s702147251 | p00000 | python | Runtime Error |
while True:
str = input()
if str == "EOF" :
break
d = 1
a , b = str.split(' ')
s = int(a) + int(b)
while s > 9:
s = s / 10
d = d + 1
print(d) | while True:
try:
a, b = map(int, input().split())
print(len(str(a+b)))
except EOFError:
break
| s591895386 | s197287615 | p00002 | python | Runtime Error |
n=int(input())
for i in range(n):
s=input.split()
for j in range(len(s)):
s[j]=int(s[j])
s.sort()
print("YES" if(pow(s[0],2)+pow(s[1],2)==pow(s[2],2)) else "NO")
| t = int(input())
i = 0
def Right_Tri(m,n,o):
a = (n**2+o**2)**(0.5)
if m == a:
return True
while(i<t):
m,n,o = map(int, input().split())
if (Right_Tri(m,n,o) or Right_Tri(n,o,m) or Right_Tri(o,m,n) == True):
print("YES")
else:
print("NO")
i += 1
| s832758004 | s057480431 | p00003 | python | Runtime Error |
import sys
import math
for line in sys.stdin:
a, b = map(int, line.split(' '))
gcd = math.gcd(a, b)
print(gcd, a * b // gcd) | # Aizu - 0005
def De(a):
res = []
tmp = 2
while a != 1:
while not (a % tmp):
a = round(a / tmp)
res.append(tmp)
tmp += 1
return res
while True:
try:
tmp = input()
a = [int(i) for i in tmp.split(' ')]
except:
break
b = De(a[1])
... | s451321793 | s200202868 | p00005 | python | Runtime Error |
from math import sqrt
n=input()
for i in range(n):
x1,y1,x2,y2,x3,y3=map(float,raw_input().split())
A1=2*(x2-x1)
B1=2*(y2-y1)
C1=x2**2+y2**2-x1**2-y1**2
x=((C1*B2)-(C2*B1))/((A1*B2)-(A2*B1))
y=((A1*C2)-(A2*C1))/((A1*B2)-(A2*B1))
a=sqrt((x2-x1)**2+(y2-y1)**2)
b=sqrt((x3-x1)**2+(y3-y1)**2)
c=sqrt((x3-x2)**2+(y3-... | from math import sqrt
n=input()
for i in range(n):
x1,y1,x2,y2,x3,y3=map(float,raw_input().split())
A1=2*(x2-x1)
B1=2*(y2-y1)
C1=x2**2+y2**2-x1**2-y1**2
A2=2*(x3-x2)
B2=2*(y3-y2)
C2=x3**2+y3**2-x2**2-y2**2
x=(C1*B2-C2*B1)/(A1*B2-A2*B1)
y=(A1*C2-A2*C1)/(A1*B2-A2*B1)
R=sqrt((x1-x)**2+(y1-y)**2)
print"%.3f %.3f... | s024682548 | s666559415 | p00010 | python | Runtime Error |
from math import sqrt
n=input()
for i in range(n):
x1,y1,x2,y2,x3,y3=map(float,raw_input().split())
A1=2*(x2-x1)
B1=2*(y2-y1)
C1=x2**2+y2**2-x1**2-y1**2
x=((C1*B2)-(C2*B1))/((A1*B2)-(A2*B1))
y=((A1*C2)-(A2*C1))/((A1*B2)-(A2*B1)) | from math import sqrt
n=input()
for i in range(n):
x1,y1,x2,y2,x3,y3=map(float,raw_input().split())
A1=2*(x2-x1)
B1=2*(y2-y1)
C1=x2**2+y2**2-x1**2-y1**2
A2=2*(x3-x2)
B2=2*(y3-y2)
C2=x3**2+y3**2-x2**2-y2**2
x=(C1*B2-C2*B1)/(A1*B2-A2*B1)
y=(A1*C2-A2*C1)/(A1*B2-A2*B1)
R=sqrt((x1-x)**2+(y1-y)**2)
print"%.3f %.3f... | s742648167 | s666559415 | p00010 | python | Runtime Error |
from math import sqrt
n=input()
for i in range(n):
x1,y1,x2,y2,x3,y3=map(float,raw_input().split())
A1=2*(x2-x1)
B1=2*(y2-y1)
C1=x2**2+y2**2-x1**2-y1**2
A2=2*(x3-x2)
B2=2*(y3-y2)
C2=x3**2+y3**2-x2**2-y2**2 | from math import sqrt
n=input()
for i in range(n):
x1,y1,x2,y2,x3,y3=map(float,raw_input().split())
A1=2*(x2-x1)
B1=2*(y2-y1)
C1=x2**2+y2**2-x1**2-y1**2
A2=2*(x3-x2)
B2=2*(y3-y2)
C2=x3**2+y3**2-x2**2-y2**2
x=(C1*B2-C2*B1)/(A1*B2-A2*B1)
y=(A1*C2-A2*C1)/(A1*B2-A2*B1)
R=sqrt((x1-x)**2+(y1-y)**2)
print"%.3f %.3f... | s424874268 | s666559415 | p00010 | python | Runtime Error |
import sys
import numpy as np
def main():
input_line = []
# test_line = ['9 1 8 2', '4 1 5 9', '4 6 8 2', '4 6 3 2']
# for line in test_line:
# input_line.append(line.split())
for line in sys.stdin:
input_line.append(line.split())
#print(input_line)
f... | while True:
try:
s1 = raw_input()
s2 = raw_input()
a = map(int, s1.split())
b = map(int, s2.split())
hashMap = {}
hit = 0
blow = 0
for i in range(len(a)):
hashMap[a[i]] = i
for i in range(len(b)):
if b[i] in hashMap:
if hashMap[b[i]] == i:
hit += 1
else:
blow += 1
print '%s ... | s115013488 | s312297352 | p00025 | python | Runtime Error |
import sys
def main():
input_line = []
test_line = 'Thank you for your mail and your lectures'
# for line in test_line.split():
# input_line.append(line)
for line in sys.stdin:
input_line.append(line.split())
#print(input_line.count('your'))
number_len =... | from collections import Counter
def main():
inp = input().strip().split(' ')
k = Counter()
maxlen = 0
maxlenword = ''
for z in inp:
k[z] += 1
if len(z) > maxlen:
maxlenword = z
maxlen = len(z)
maxi = k.most_common(1)[0][0]
print(maxi, maxlenword... | s015064809 | s141318959 | p00029 | python | Runtime Error |
import sys
def main():
input_line = []
# with open('test_data') as f:
# for line in f.readline().split():
# input_line.append(line)
for line in sys.stdin.readline().split():
input_line.append(line)
#print(input_line)
number_len = {}
number_fre ... | from collections import Counter
def main():
inp = input().strip().split(' ')
k = Counter()
maxlen = 0
maxlenword = ''
for z in inp:
k[z] += 1
if len(z) > maxlen:
maxlenword = z
maxlen = len(z)
maxi = k.most_common(1)[0][0]
print(maxi, maxlenword... | s919582965 | s141318959 | p00029 | python | Runtime Error |
# -*- coding: utf-8 -*-
# !/usr/bin/env python
# vim: set fileencoding=utf-8 :
"""
#
# Author: Noname
# URL: https://github.com/pettan0818
# License: MIT License
# Created: 木 11/ 9 19:01:14 2017
# Usage
#
"""
from itertools import accumulate
def data_req():
n_yado, m_ryotei = [int(i) for i in input().spl... | # -*- coding: utf-8 -*-
# !/usr/bin/env python
# vim: set fileencoding=utf-8 :
"""
#
# Author: Noname
# URL: https://github.com/pettan0818
# License: MIT License
# Created: 木 11/ 9 19:01:14 2017
# Usage
#
"""
from itertools import accumulate
def data_req():
n_yado, m_ryotei = [int(i) for i in input().spl... | s049881904 | s800584462 | p00472 | python | Runtime Error |
from queue import Queue
from collections import defaultdict
try:
d = [[1, 0], [-1, 0], [0, 1], [0, -1]]
H, W, N = map(int, input().split())
G = []
sx = sy = 0
for i in range(H):
G.append(input())
for j, c in enumerate(G[i]):
if c == 'S':
sx,... | from collections import deque, defaultdict
d = [[1, 0], [-1, 0], [0, 1], [0, -1]]
H, W, N = map(int, input().split())
G = []
sx = sy = 0
for i in range(H):
G.append(input())
for j, c in enumerate(G[i]):
if c == 'S':
sx, sy = i, j
Q = deque()
Q.append((sx, sy, 0))
visited = defaultdict(... | s737171396 | s580699179 | p00481 | python | Runtime Error |
from queue import Queue
from collections import defaultdict
try:
d = [[1, 0], [-1, 0], [0, 1], [0, -1]]
H, W, N = map(int, input().split())
G = []
sx = sy = 0
for i in range(H):
G.append(input())
for j, c in enumerate(G[i]):
if c == 'S':
sx, sy = i, j
... | from collections import deque, defaultdict
d = [[1, 0], [-1, 0], [0, 1], [0, -1]]
H, W, N = map(int, input().split())
G = []
sx = sy = 0
for i in range(H):
G.append(input())
for j, c in enumerate(G[i]):
if c == 'S':
sx, sy = i, j
Q = deque()
Q.append((sx, sy, 0))
visited = defaultdict(... | s727593766 | s580699179 | p00481 | python | Runtime Error |
#include<iostream>
int main(){
int a,b;
while(std::cin>>a>>b){
std::cout<<a+b<<"\n";
}
return 0;
} | import sys
for line in sys.stdin:
if line == None or line == '/n':
break
a,b = line.split(" ")
print( int(a) + int(b) )
| s858010560 | s057870168 | p00586 | python | Runtime Error |
while (1):
print(int(input())+int(input()))
## | import sys
for line in sys.stdin:
if line == None or line == '/n':
break
a,b = line.split(" ")
print( int(a) + int(b) )
| s800469221 | s057870168 | p00586 | python | Runtime Error |
while True:
pair_num = input("A pair of numbers")
if pair_num == '':
break
a, b = pair_num.split(" ")
print(int(a) + int(b))
| import sys
for line in sys.stdin:
if line == None or line == '/n':
break
a,b = line.split(" ")
print( int(a) + int(b) )
| s778348406 | s057870168 | p00586 | python | Runtime Error |
def get_input():
p = input().split()
return int(p[0]),int(p[1])
while 1:
a, b = get_input()
print(a+b)
if a == "":
break
| import sys
for line in sys.stdin:
if line == None or line == '/n':
break
a,b = line.split(" ")
print( int(a) + int(b) )
| s625549103 | s057870168 | p00586 | python | Runtime Error |
x = input()
while x:
a, b = x.split(" ")
print(int(a) + int(b))
| import sys
for line in sys.stdin:
if line == None or line == '/n':
break
a,b = line.split(" ")
print( int(a) + int(b) )
| s421241185 | s057870168 | p00586 | python | Time Limit Exceeded |
a=int(input())
b=int(input())
print(a+b)
# aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
| import sys
for line in sys.stdin:
if line == None or line == '/n':
break
a,b = line.split(" ")
print( int(a) + int(b) )
| s525005656 | s057870168 | p00586 | python | Runtime Error |
def get_group(str):
return str.split(':')[0];
def get_member(str):
return str.split(':')[1].split('.')[0].split(',');
def get_num(group, map, ans):
for person in map[group]:
if person in map:
get_num(person, map, ans);
else:
ans[person] = True;
def main():
wh... | def get_num(u, map, vis):
if u in vis:
return 0;
else:
vis[u] = True;
ans = 0;
if u in map:
for v in map[u]:
ans += get_num(v, map, vis);
else:
ans += 1;
return ans;
def main():
while True:
n = int(input());
if n == 0:
... | s381647444 | s308609245 | p00884 | python | Runtime Error |
def get_group(str):
return str.split(':')[0];
def get_member(str):
return str.split(':')[1].split('.')[0].split(',');
def get_num(group, map, ans):
for person in map[group]:
if person in map:
get_num(person, map, ans);
else:
ans[person] = True;
def main():
while T... | def get_num(u, map, vis):
if u in vis:
return 0;
else:
vis[u] = True;
ans = 0;
if u in map:
for v in map[u]:
ans += get_num(v, map, vis);
else:
ans += 1;
return ans;
def main():
while True:
n = int(input());
if n == 0:
... | s944033769 | s308609245 | p00884 | python | Runtime Error |
K = '.,!? '
A = 'abc'
D = 'def'
G = 'ghi'
J = 'jkl'
M = 'mno'
P = 'pqrs'
T = 'tuv'
W = 'wxyz'
L = ['', K, A, D, G, J, M, P, T, W]
while 1:
S = []
n = input()
if not '0' in n:
print('')
else:
n = n.split('0')
for ns in n:
if ns == '':
continue
i = len(ns) % len(L[int(ns[0])])
S += [[L[int(ns[0])... | import sys
K = '.,!? '
A = 'abc'
D = 'def'
G = 'ghi'
J = 'jkl'
M = 'mno'
P = 'pqrs'
T = 'tuv'
W = 'wxyz'
L = ['', K, A, D, G, J, M, P, T, W]
count = int(input())
while count:
count -= 1
S = []
n = input()
if not '0' in n:
print('')
continue
else:
n = n.split('0')
for ns in n:
if ns == '':
continue
... | s502701673 | s316048795 | p01131 | python | Runtime Error |
K = int(input())
Is = [input() for i in range(K)]
Ns = [input() for i in range(K)]
atk_I = 0
atk_N = 0
#"mamoru", "tameru", "kougekida"
#"Isono-kun", "Nakajima-kun", "Hikiwake-kun"
for i, n in zip(Is, Ns):
i_n = [i, n]
if (i_n.count("mamoru") == 2):
pass
elif (i_n.count("mamoru") == 1):
if (i_n.count("tameru") =... | K = int(input())
Is = [input() for i in range(K)]
Ns = [input() for i in range(K)]
atk_I = 0
atk_N = 0
#"mamoru", "tameru", "kougekida"
#"Isono-kun", "Nakajima-kun", "Hikiwake-kun"
for i, n in zip(Is, Ns):
i_n = [i, n]
if (i_n.count("mamoru") == 2):
pass
elif (i_n.count("mamoru") == 1):
if (i_n.count("tameru") =... | s843470045 | s835661099 | p01858 | python | Runtime Error |
N = int(input())
Ss = input().replace(" ", '')
part = ""
for n, i in enumerate(Ss):
if n != 0:
if i == part[0]:
Ss_cp = Ss[::1]
Ss_cp = Ss_cp.replace(part, '')
if Ss_cp == '':
print(N//len(part))
exit()
part += Ss[n]
else:
print(1)
| N = int(input())
Ss = input().split()
res = 1
for t in range(1, N+1):
if (N%t != 0): continue
f = False
for i in range(N-t):
if (Ss[i] == Ss[i + t]): continue
f = True
break
if (f): continue
res = N // t
break
print(res)
| s973289363 | s643684636 | p01873 | python | Time Limit Exceeded |
n=int(input())
A=[int(x) for x in input().split()]
q=int(input())
M=[int(x) for x in input().split()]
def solve(m,AA):
if len(AA)==0:
return False
if m in AA:
return True
else:
for i in range(len(AA)):
if solve(m-AA[i],AA[:i]+AA[i+1:]):
return True
... | input()
X = [int(x) for x in input().split()]
input()
Y = [int(x) for x in input().split()]
flag = [False]*2000
for j in range(1 << len(X)):
n = 0
for i in range(len(X)):
if 1 & (j >> i) == 1:
n += X[i]
flag[n] = True
for m in Y:
print("yes" if flag[m] else "no")
| s645133288 | s321485036 | p02271 | python | Runtime Error |
import sys
sys.setrecursionlimit(100000) # set the maximum depth as 10000
n=int(input())
A=[int(x) for x in input().split()]
q=int(input())
M=[int(x) for x in input().split()]
def solve(i,m):
global n
global A
if m==0:
return True
if i>=n:
return False
return solve(i+1... | input()
X = [int(x) for x in input().split()]
input()
Y = [int(x) for x in input().split()]
flag = [False]*2000
for j in range(1 << len(X)):
n = 0
for i in range(len(X)):
if 1 & (j >> i) == 1:
n += X[i]
flag[n] = True
for m in Y:
print("yes" if flag[m] else "no")
| s285677990 | s321485036 | p02271 | python | Runtime Error |
# -*- coding: utf-8 -*-
# 文字列の入力
import math
n,k = map(int ,input().split())
def comb1(n, r):
if n == 0 or r == 0: return 1
return (comb1(n, r-1) * (n-r+1) / r )%1000000007
ans = (comb(k, n))%1000000007
print(ans)
|
# -*- coding: utf-8 -*-
# 文字列の入力
import math
n,k = map(int ,input().split())
def comb(n,k,p):
"""power_funcを用いて(nCk) mod p を求める"""
from math import factorial
if n<0 or k<0 or n<k: return 0
if n==0 or k==0: return 1
a=factorial(n) %p
b=factorial(k) %p
c=factorial(n-k) %p
return (a*power_func(b,p-2,p)*... | s717379257 | s442347174 | p02335 | python | Runtime Error |
N,S = map(int, input().split())
As = list(map(int, input().split()))
i = 0
j = 0
sum = 0
m_l = float('inf')
"""
while True:
while j < N and sum < S:
sum += As[j]
j += 1
if sum < S:
break
m_l = min(j-i, m_l)
sum -= As[i]
i += 1
"""
while j < N:
sum += As[j]
j += 1
if sum < s:
continue
while i <= j a... | n,s = map(int, input().split())
a = list(map(int, input().split()))
ans = float("inf")
ma = 0
mi = 0
v = 0
for i in range(n):
v += a[i]
if v >= s:
ma = i
while v >= s:
v -= a[mi]
mi += 1
ans = min(ans, ma-mi+2)
ans = ans if ans != float("inf") else 0
print(ans)
| s555550112 | s440699722 | p02354 | python | Runtime Error |
a=input()
b=input()
print a*b,2*(a+b)
#jdjdjdjdjdksksowksakslslakslaks | a ,b = input().split(" ")
a = int(a)
b = int(b)
area = a*b
perimitar = 2 * (a + b)
print("{} {}".format(area, perimitar))
| s789936515 | s927416801 | p02389 | python | Runtime Error |
a,b=input().split()
aa=int(a)
bb=int(b)
print aa*bb,2*(aa+bb) | a ,b = input().split(" ")
a = int(a)
b = int(b)
area = a*b
perimitar = 2 * (a + b)
print("{} {}".format(area, perimitar))
| s794668498 | s927416801 | p02389 | python | Runtime Error |
def sum(l):
s=0
for i in l:
s+=i
return s
r,c=map(int,raw_input().split())
su=[0]*c
for i in range(r):
l=map(int,raw_input().split())
for j in l:print j,
print sum(l)
for j in range(c):su[j]+=l[j]
for j in su:print j,
print sum(su) | r, c = map(int, input().split())
a = []
for i in range(r):
a.append(list(map(int, input().split())))
a[i].append(sum(a[i]))
for i in range(r):
print(" ".join(list(map(str, a[i]))))
col_sum = []
for j in range(c+1):
su = 0
for i in range(r):
su += a[i][j]
col_sum.append(su)
print(" ".... | s528753370 | s129621823 | p02413 | python | Runtime Error |
a=raw_input().lower()
c=0
while 1:
b=raw_input().lower()
if b.strip()=='end_of_text':break
pos=0
while b.find(a,pos)!=-1:
pos=b.find(a)+1
c+=1
print c |
import sys
w=input()
print(sys.stdin.read().lower().split().count(w))
| s271070991 | s926017381 | p02419 | python | Time Limit Exceeded |
m,n=map(int,input().split())
print(m**n%1000000007)
| m,n=[ int(x) for x in input().split()]
k=1000000007
REM={}
def remainder(i):
if i in REM.keys():
return REM[i]
if i==1:
re=m%k
REM[1]=re
return re
if i==2:
re=(m%k)**2%k
REM[2]=re
return re
left=i//2
right=i-left
... | s171296612 | s123823847 | p02468 | python | Time Limit Exceeded |
m=24*60*60
while True:
n=int(input())
if n==0:break
dp=[0]*(m+1)
for _ in range(n):
a,d=input().split()
a,b,c=map(int,a.split(':'));
d,e,f=map(int,d.split(':'));
dp[a*3600+b*60+c]+=1
dp[d*3600+e*60+f]-=1
for i in range(m):
dp[i+1]+=dp[i]
print(max(dp)) | m=24*60*60
while True:
n=int(raw_input())
if n==0:break
dp=[0]*(m+1)
for _ in range(n):
a,d=raw_input().split()
a,b,c=map(int,a.split(':'));
d,e,f=map(int,d.split(':'));
dp[a*3600+b*60+c]+=1
dp[d*3600+e*60+f]-=1
for i in range(m):
dp[i+1]+=dp[i]
print(max(dp)) | s729530130 | s285278451 | p01138 | python | Runtime Error |
m=24*60*60
while True:
n=int(input())
if n==0:break
dp=[0]*(m+1)
for _ in range(n):
a,d=input().split()
a,b,c=map(int,a.split(':'));
d,e,f=map(int,d.split(':'));
dp[a*3600+b*60+c]+=1
dp[d*3600+e*60+f]-=1
for i in range(m):
dp[i+1]+=dp[i]
print(max(dp)) | m=24*60*60
while True:
n=int(raw_input())
if n==0:break
dp=[0]*(m+1)
for _ in range(n):
a,d=raw_input().split()
a,b,c=map(int,a.split(':'));
d,e,f=map(int,d.split(':'));
dp[a*3600+b*60+c]+=1
dp[d*3600+e*60+f]-=1
for i in range(m):
dp[i+1]+=dp[i]
print(max(dp)) | s327248861 | s285278451 | p01138 | python | Runtime Error |
m=24*60*60
while True:
n=int(input())
if n==0:break
dp=[0]*(m+1)
for _ in range(n):
a,d=input().split()
a,b,c=map(int,a.split(':'));
d,e,f=map(int,d.split(':'));
# dp[a*3600+b*60+c]+=1
# dp[d*3600+e*60+f]-=1
for i in range(m):
dp[i+1]+=dp[i]
print(max(dp)) | m=24*60*60
while True:
n=int(raw_input())
if n==0:break
dp=[0]*(m+1)
for _ in range(n):
a,d=raw_input().split()
a,b,c=map(int,a.split(':'));
d,e,f=map(int,d.split(':'));
dp[a*3600+b*60+c]+=1
dp[d*3600+e*60+f]-=1
for i in range(m):
dp[i+1]+=dp[i]
print(max(dp)) | s001815991 | s285278451 | p01138 | python | Runtime Error |
m=24*60*60
while True:
n=int(input())
if n==0:break
dp=[0]*(m+1)
for _ in range(n):
a,d=input().split()
# a,b,c=map(int,a.split(':'));
# d,e,f=map(int,d.split(':'));
# dp[a*3600+b*60+c]+=1
# dp[d*3600+e*60+f]-=1
for i in range(m):
dp[i+1]+=dp[i]
print(max(dp)) | m=24*60*60
while True:
n=int(raw_input())
if n==0:break
dp=[0]*(m+1)
for _ in range(n):
a,d=raw_input().split()
a,b,c=map(int,a.split(':'));
d,e,f=map(int,d.split(':'));
dp[a*3600+b*60+c]+=1
dp[d*3600+e*60+f]-=1
for i in range(m):
dp[i+1]+=dp[i]
print(max(dp)) | s556001507 | s285278451 | p01138 | python | Runtime Error |
m=24*60*60
while True:
n=int(input())
if n==0:break
dp=[0]*(m+1)
for _ in range(n):
a,d=input().split()
# a,b,c=map(int,a.split(':'));
# d,e,f=map(int,d.split(':'));
# dp[a*3600+b*60+c]+=1
# dp[d*3600+e*60+f]-=1
# for i in range(m):
# dp[i+1]+=dp[i]
# print(max(dp)) | m=24*60*60
while True:
n=int(raw_input())
if n==0:break
dp=[0]*(m+1)
for _ in range(n):
a,d=raw_input().split()
a,b,c=map(int,a.split(':'));
d,e,f=map(int,d.split(':'));
dp[a*3600+b*60+c]+=1
dp[d*3600+e*60+f]-=1
for i in range(m):
dp[i+1]+=dp[i]
print(max(dp)) | s973795760 | s285278451 | p01138 | python | Runtime Error |
m=24*60*60
while True:
n=int(input())
if n==0:break
# dp=[0]*(m+1)
for _ in range(n):
a,d=input().split()
# a,b,c=map(int,a.split(':'));
# d,e,f=map(int,d.split(':'));
# dp[a*3600+b*60+c]+=1
# dp[d*3600+e*60+f]-=1
# for i in range(m):
# dp[i+1]+=dp[i]
# print(max(dp)) | m=24*60*60
while True:
n=int(raw_input())
if n==0:break
dp=[0]*(m+1)
for _ in range(n):
a,d=raw_input().split()
a,b,c=map(int,a.split(':'));
d,e,f=map(int,d.split(':'));
dp[a*3600+b*60+c]+=1
dp[d*3600+e*60+f]-=1
for i in range(m):
dp[i+1]+=dp[i]
print(max(dp)) | s207518192 | s285278451 | p01138 | python | Runtime Error |
m=24*60*60
while True:
n=int(input())
if n==0:break
# dp=[0]*(m+1)
# for _ in range(n):
# a,d=input().split()
# a,b,c=map(int,a.split(':'));
# d,e,f=map(int,d.split(':'));
# dp[a*3600+b*60+c]+=1
# dp[d*3600+e*60+f]-=1
# for i in range(m):
# dp[i+1]+=dp[i]
# print(max(dp)) | m=24*60*60
while True:
n=int(raw_input())
if n==0:break
dp=[0]*(m+1)
for _ in range(n):
a,d=raw_input().split()
a,b,c=map(int,a.split(':'));
d,e,f=map(int,d.split(':'));
dp[a*3600+b*60+c]+=1
dp[d*3600+e*60+f]-=1
for i in range(m):
dp[i+1]+=dp[i]
print(max(dp)) | s890488780 | s285278451 | p01138 | python | Runtime Error |
import math
debt = 100000
for i in range(n):
debt = math.ceil(debt*1.05/1000)*1000
print int(debt) | import math
debt = 100000
n = int(raw_input())
for i in range(n):
debt = math.ceil(debt*1.05/1000)*1000
print int(debt) | s161170066 | s721618366 | p00007 | python | Runtime Error |
import sys
for n in sys.stdin: print len([None for a in range(10) for b in range(10) for c in range(10) for d in range(10) if a+b+c+d == N]) | import sys
for n in sys.stdin: print len([None for a in range(10) for b in range(10) for c in range(10) for d in range(10) if a+b+c+d == int(n)]) | s032970165 | s655683842 | p00008 | python | Runtime Error |
LIMIT = 10000000
isPrime = [True for _ in range(LIMIT)]
isPrime[0] = isPrime[1] = False
for i in range(2, int(LIMIT ** 0.5)+1):
if isPrime[i]:
for j in range(i * i, LIMIT, i):
isPrime[j] = False
try:
while True:
n = int(input())
count = 0
for i in range(n+1):
i... | import sys
ifprime = [1]*(1000000)
ifprime[0] = ifprime[1] = 0
a = 2
while a < 1000000:
if ifprime[a]:
b = a*a
while b < 1000000:
ifprime[b] = 0
b += a
a += 1
for n in sys.stdin:
print sum(ifprime[:int(n)+1]) | s818035536 | s643611279 | p00009 | python | Time Limit Exceeded |
import sys
for n in sys.stdin:
num = int(n)
ifprime = [1]*(num+1)
ifprime[0] = ifprime[1] = 0
a = 2
while a*a <= num:
if ifprime[a]:
b = a*a
while b <= num:
ifprime[b] = 0
b += a
a += 1
print sum(ifprime) | import sys
ifprime = [1]*(1000000)
ifprime[0] = ifprime[1] = 0
a = 2
while a < 1000000:
if ifprime[a]:
b = a*a
while b < 1000000:
ifprime[b] = 0
b += a
a += 1
for n in sys.stdin:
print sum(ifprime[:int(n)+1]) | s999304012 | s643611279 | p00009 | python | Time Limit Exceeded |
import sys
ifprime = [1]*(1000000)
ifprime[0] = ifprime[1] = 0
a = 2
while a <= num:
if ifprime[a]:
ans += 1
b = a*a
while b <= num:
ifprime[b] = 0
b += a
a += 1
for n in sys.stdin:
print sum(ifprime[:int(n)]) | import sys
ifprime = [1]*(1000000)
ifprime[0] = ifprime[1] = 0
a = 2
while a < 1000000:
if ifprime[a]:
b = a*a
while b < 1000000:
ifprime[b] = 0
b += a
a += 1
for n in sys.stdin:
print sum(ifprime[:int(n)+1]) | s060395458 | s643611279 | p00009 | python | Runtime Error |
import sys
for d in sys.stdin:
print sum([d*x*x for x in range(d,600,d)]) | import sys
for d in map(int, sys.stdin):
print sum([d*x*x for x in range(d,600,d)]) | s553611017 | s721769503 | p00014 | python | Runtime Error |
import sys
for d in int(sys.stdin):
print sum([d*x*x for x in range(d,600,d)]) | import sys
for d in map(int, sys.stdin):
print sum([d*x*x for x in range(d,600,d)]) | s755230377 | s721769503 | p00014 | python | Runtime Error |
direction = {'N' : 0, 'E' : 1, 'S' : 2, 'W' : 3}
step = [(-1, 0), (0, 1), (1, 0), (0, -1)]
while True:
W, H = map(int, raw_input().split())
if W == 0 and H == 0: break
m = [None] * H
for i in xrange(H):
m[i] = list(raw_input())
people = []
for i in xrange(H):
for j in xrange(W):... | import sys
direction = {'N' : 0, 'E' : 1, 'S' : 2, 'W' : 3}
step = [( -1, 0 ), ( 0, 1 ), ( 1, 0 ), ( 0, -1 )]
vv = []
while True:
W, H = map( int, sys.stdin.readline().rstrip().split() )
if W == 0 and H == 0: break
m = [ list( sys.stdin.readline().strip() ) for i in xrange( H ) ]
people = [ [ i, j, di... | s804027091 | s668609498 | p00210 | python | Runtime Error |
direction = {'N' : 0, 'E' : 1, 'S' : 2, 'W' : 3}
step = [( -1, 0 ), ( 0, 1 ), ( 1, 0 ), ( 0, -1 )]
while True:
W, H = map( int, raw_input().split() )
if W == 0 and H == 0: break
m = [ list( raw_input().split() ) for i in xrange( H ) ]
people = [ ( i, j, direction[ m[i][j] ] ) for i in xrange( H ) for j... | import sys
direction = {'N' : 0, 'E' : 1, 'S' : 2, 'W' : 3}
step = [( -1, 0 ), ( 0, 1 ), ( 1, 0 ), ( 0, -1 )]
vv = []
while True:
W, H = map( int, sys.stdin.readline().rstrip().split() )
if W == 0 and H == 0: break
m = [ list( sys.stdin.readline().strip() ) for i in xrange( H ) ]
people = [ [ i, j, di... | s537808120 | s668609498 | p00210 | python | Runtime Error |
import sys
direction = {'N' : 0, 'E' : 1, 'S' : 2, 'W' : 3}
step = [( -1, 0 ), ( 0, 1 ), ( 1, 0 ), ( 0, -1 )]
vv = []
while True:
W, H = map( int, sys.stdin.readline().rstrip().split() )
if W == 0 and H == 0: break
m = [ list( sys.stdin.readline().strip() ) for i in xrange( H ) ]
people = [ ( i, j, di... | import sys
direction = {'N' : 0, 'E' : 1, 'S' : 2, 'W' : 3}
step = [( -1, 0 ), ( 0, 1 ), ( 1, 0 ), ( 0, -1 )]
vv = []
while True:
W, H = map( int, sys.stdin.readline().rstrip().split() )
if W == 0 and H == 0: break
m = [ list( sys.stdin.readline().strip() ) for i in xrange( H ) ]
people = [ [ i, j, di... | s016028281 | s668609498 | p00210 | python | Runtime Error |
a, b, c, d = sorted(map(int, input().split())
print("YES" if a == b and c == d else "NO") | a, b, c, d = sorted(map(int, input().split()))
print("yes" if a == b and c == d else "no") | s944512988 | s773650450 | p00340 | python | Runtime Error |
out = []
append = out.append
cnt = int(raw_input())
while cnt > 0:
trans = {}
while cnt > 0:
k,v = raw_input().split(' ')
trans[k] = v
cnt -= 1
cnt = int(raw_input())
ans = ''
while cnt > 0:
load = raw_input()
if load in trans.keys(): load = trans[load]
... | out = []
while True:
n = int(raw_input())
if n == 0: break
trans = {}
for i in range(n):
k,v = raw_input().split()
trans[k] = v.rstrip()
cnt = int(raw_input())
res = ""
for j in range(cnt):
a = raw_input().rstrip()
if a in trans: a = trans[a]
res += a
out.append(res)
for o in out: pr... | s768062822 | s774399513 | p00424 | python | Runtime Error |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.