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 fractions import gcd
INF = 2 << 30
V = 1002
G = [[] for _ in xrange(V)]
visited = [False]*V
def add_edge(fro, to, cap):
G[fro].append([to,cap,len(G[to])])
G[to].append([fro,0,len(G[fro])-1])
def dfs(v,t,f):
if v == t:
return f
visited[v] = True
for i,(to,cap,rev) in enumerate((G[v]))... | from fractions import gcd
V = 1001
G = []
visited = []
match = []
def add_edge(u,v):
G[u].append(v)
G[v].append(u)
def dfs(v):
visited[v] = True
for u in G[v]:
w = match[u]
if w < 0 or not visited[w] and dfs(w):
match[v] = u
match[u] = v
return True... | s392149434 | s879503584 | p00744 | python | Runtime Error |
from fractions import gcd
INF = 2 << 30
V = 1002
G = [[] for _ in xrange(V)]
visited = [False]*V
def add_edge(fro, to, cap):
G[fro].append([to,cap,len(G[to])])
G[to].append([fro,0,len(G[fro])-1])
def dfs(v,t,f):
if v == t:
return f
visited[v] = True
for i,(to,cap,rev) in enumerate((G[v]))... | from fractions import gcd
V = 1001
G = []
visited = []
match = []
def add_edge(u,v):
G[u].append(v)
G[v].append(u)
def dfs(v):
visited[v] = True
for u in G[v]:
w = match[u]
if w < 0 or not visited[w] and dfs(w):
match[v] = u
match[u] = v
return True... | s068443553 | s879503584 | p00744 | python | Runtime Error |
from fractions import gcd
INF = 2 << 30
V = 1002
G = [[] for _ in xrange(V)]
visited = [False]*V
def add_edge(fro, to, cap):
G[fro].append([to,cap,len(G[to])])
G[to].append([fro,0,len(G[fro])-1])
def dfs(v,t,f):
if v == t:
return f
visited[v] = True
for i,(to,cap,rev) in enumerate((G[v]))... | from fractions import gcd
V = 1001
G = []
visited = []
match = []
def add_edge(u,v):
G[u].append(v)
G[v].append(u)
def dfs(v):
visited[v] = True
for u in G[v]:
w = match[u]
if w < 0 or not visited[w] and dfs(w):
match[v] = u
match[u] = v
return True... | s492984252 | s879503584 | p00744 | python | Runtime Error |
from fractions import gcd
INF = 2 << 30
V = 1002
G = [[] for _ in xrange(V)]
visited = [False]*V
def add_edge(fro, to, cap):
G[fro].append([to,cap,len(G[to])])
G[to].append([fro,0,len(G[fro])-1])
def dfs(v,t,f):
if v == t:
return f
visited[v] = True
for i,(to,cap,rev) in enumerate((G[v]))... | from fractions import gcd
V = 1001
G = []
visited = []
match = []
def add_edge(u,v):
G[u].append(v)
G[v].append(u)
def dfs(v):
visited[v] = True
for u in G[v]:
w = match[u]
if w < 0 or not visited[w] and dfs(w):
match[v] = u
match[u] = v
return True... | s385782233 | s879503584 | p00744 | python | Runtime Error |
from itertools import product
L = [10, 50, 100, 500]
def solve():
#print N
ans = [[20] * 4, [20] * 4]
for c in product(*[range(N[i] + 1) for i in xrange(4)]):
#print "out", c
r = calc(c)
#print "in", r
if check(c, r):
ans = min([r, c], ans, key = lambda x: sum(x[... | L = (10, 50, 100, 500)
def calc():
ret = [0] * 4
r = sum(L[i] * N[i] for i in xrange(4)) - M
for i in xrange(3, -1, -1):
ret[i] += r / L[i]
r -= ret[i] * L[i]
return ret
M = int(raw_input())
while M != 0:
N = map(int, raw_input().split())
for i, n in zip(L, map(lambda a, b: max(... | s591627092 | s439374663 | p01132 | python | Runtime Error |
def toBinary(block):
return [sum(1 << i for i,bb in enumerate(b) if bb == "#") for b in block]
def toStr(bfield):
return ["".join("." if f & (1<<i) == 0 else "#" for i in xrange(W)) for f in bfield]
def rotated(block):
return map(lambda x:"".join(x),zip(*[b[:] for b in block]))[::-1]
def striped(block):
... | def toBinary(block):
return [sum(1 << i for i,bb in enumerate(b) if bb == "#") for b in block]
def toStr(bfield):
return ["".join("." if f & (1<<i) == 0 else "#" for i in xrange(W)) for f in bfield]
def rotated(block):
return map(lambda x:"".join(x),zip(*[b[:] for b in block]))[::-1]
def striped(block):
... | s277164022 | s836829385 | p01214 | python | Runtime Error |
def toBinary(block):
return [sum(1 << i for i,bb in enumerate(b) if bb == "#") for b in block]
def toStr(bfield):
return ["".join("." if f & (1<<i) == 0 else "#" for i in xrange(W)) for f in bfield]
def rotated(block):
return map(lambda x:"".join(x),zip(*[b[:] for b in block]))[::-1]
def striped(block):
... | while True:
n = input()
if n == 0:
break
L = [sum(map(int, raw_input().split())) for _ in xrange(n)]
print "{} {}".format(max(L), min(L)) | s956023974 | s525795823 | p01321 | python | Runtime Error |
graph = []
def init():
global graph
graph = [[False] * 26 + [True] for _ in xrange(27)]
graph[26][26] = False
def atoi(c):#index
if c == "#":
return 26
return ord(c) - ord("a")
def make_graph(L):
global graph
tmp = []
while "" in L:
L.remove("")
for s1, s2 in zip(L... | graph = []
def init():
global graph
graph = [[False] * 26 + [True] for _ in xrange(27)]
graph[26][26] = False
def atoi(c):#index
if c == "#":
return 26
return ord(c) - ord("a")
def make_graph(L):
global graph
cur = 0
L = [L[0]] + [L[i] for i in xrange(1, len(L)) if L[i] != L[i... | s369005925 | s857128168 | p01646 | python | Runtime Error |
graph = []
def init():
global graph
graph = [[False] * 26 + [True] for _ in xrange(27)]
graph[26][26] = False
def atoi(c):#index
if c == "#":
return 26
return ord(c) - ord("a")
def make_graph(L):
global graph
tmp = []
while "" in L:
L.remove("")
for s1, s2 in zip(L... | graph = []
def init():
global graph
graph = [[False] * 26 + [True] for _ in xrange(27)]
graph[26][26] = False
def atoi(c):#index
if c == "#":
return 26
return ord(c) - ord("a")
def make_graph(L):
global graph
cur = 0
L = [L[0]] + [L[i] for i in xrange(1, len(L)) if L[i] != L[i... | s439086253 | s857128168 | p01646 | python | Runtime Error |
N = input()
M = [map(int, raw_input().split()) for i in xrange(N)]
cache = {}
for i in xrange(N):
cache[(i, i+1)] = 0
def dfs(left, right):#[left, right)
if (left, right) in cache:
return cache[(left, right)]
min_cost = float("inf")
for mid in xrange(left+1, right):
tmp = M[left][0] * M[... | N = input()
M = [map(int, raw_input().split()) for i in xrange(N)]
cache = {}
for i in xrange(N):
cache[(i, i+1)] = 0
def dfs(left, right):
if (left, right) in cache:
return cache[(left, right)]
min_cost = float("inf")
for mid in xrange(left+1, right):
tmp = M[left][0] * M[mid-1][1] * M[... | s881830724 | s663067196 | p02234 | python | Time Limit Exceeded |
N = input()
M = [map(int, raw_input().split()) for i in xrange(N)]
cache = {}
for i in xrange(N):
cache[(i, i+1)] = 0
def dfs(left, right):#[left, right)
if (left, right) in cache:
return cache[(left, right)]
min_cost = float("inf")
for mid in xrange(left+1, right):
tmp = M[left][0] * M[... | N = input()
M = [map(int, raw_input().split()) for i in xrange(N)]
cache = {}
for i in xrange(N):
cache[(i, i+1)] = 0
def dfs(left, right):
if (left, right) in cache:
return cache[(left, right)]
min_cost = float("inf")
for mid in xrange(left+1, right):
tmp = M[left][0] * M[mid-1][1] * M[... | s854751449 | s663067196 | p02234 | python | Time Limit Exceeded |
N = input()
M = [map(int, raw_input().split()) for i in xrange(N)]
cache = {}
for i in xrange(N):
cache[(i, i+1)] = 0
def dfs(left, right):#[left, right)
if (left, right) in cache:
return cache[(left, right)]
min_cost = float("inf")
for mid in xrange(left+1, right):
tmp = M[left][0] * M[... | N = input()
M = [map(int, raw_input().split()) for i in xrange(N)]
cache = {}
for i in xrange(N):
cache[(i, i+1)] = 0
def dfs(left, right):
if (left, right) in cache:
return cache[(left, right)]
min_cost = float("inf")
for mid in xrange(left+1, right):
tmp = M[left][0] * M[mid-1][1] * M[... | s172221761 | s663067196 | p02234 | python | Time Limit Exceeded |
from operator import itemgetter
def eratosthenes(n):
table = [True] * (n + 1)
table[0] = table[1] = True
for i in range(2, int(round(pow(n, 0.5)))):
if not table[i]:
continue
for j in range(i + i, n, i):
table[j] = False
return table
if __name__ == "__main__":
... | from random import randrange
def eratosthenes(size):
table = [True] * (size + 1)
table[0] = table[1] = True
for i in range(2, int(round(pow(size+1, 0.5)))):
if not table[i]:
continue
for j in range(i + i, size+1, i):
table[j] = False
return table
def miller_ra... | s896298887 | s134351618 | p02257 | python | Runtime Error |
from operator import itemgetter
def eratosthenes(n):
table = [True] * (n + 1)
table[0] = table[1] = True
for i in range(2, int(round(pow(n, 0.5)))):
if not table[i]:
continue
for j in range(i + i, n, i):
table[j] = False
return table
if __name__ == "__main__":
... | from random import randrange
def eratosthenes(size):
table = [True] * (size + 1)
table[0] = table[1] = True
for i in range(2, int(round(pow(size+1, 0.5)))):
if not table[i]:
continue
for j in range(i + i, size+1, i):
table[j] = False
return table
def miller_ra... | s756854311 | s134351618 | p02257 | python | Runtime Error |
input()
print(" ".join.(input().split()[::-1]) | input()
print(" ".join(input().split()[::-1])) | s380525430 | s356911085 | p02407 | python | Runtime Error |
input()
print(" ".join(input().split()[::-1]) | input()
print(" ".join(input().split()[::-1])) | s542559449 | s356911085 | p02407 | python | Runtime Error |
#!/usr/bin/python
# -*- coding: utf-8 -*-
import sys
station = ""... | #!/usr/bin/python
# -*- coding: utf-8 -*-
import sys
def main():
... | s412340822 | s196323811 | p01620 | python | Runtime Error |
#!/usr/bin/python
# -*- coding: utf-8 -*-
import sys
def main():
... | #!/usr/bin/python
# -*- coding: utf-8 -*-
import sys
def main():
... | s875213413 | s196323811 | p01620 | python | Runtime Error |
#!/usr/bin/python
# -*- coding: utf-8 -*-
import sys
def main():
... | #!/usr/bin/python
# -*- coding: utf-8 -*-
import sys
def main():
... | s488141573 | s196323811 | p01620 | python | Runtime Error |
#!/usr/bin/python
# -*- coding: utf-8 -*-
import sys
def main():
... | #!/usr/bin/python
# -*- coding: utf-8 -*-
import sys
def main():
... | s824926121 | s196323811 | p01620 | python | Runtime Error |
lis = []
for i in xrange(10):
lis.append(input())
for a in sorted(lis,reversed=True)[:3]:
print a | lis = []
for i in xrange(10):
lis.append(input())
for a in sorted(lis,reverse=True)[:3]:
print a | s695529625 | s811725812 | p00001 | python | Runtime Error |
import sys
T = input()
for i in range(0,T):
K,P = raw_input().split(' ')
K = int(K)
P = int(P)
print ( K % P - 1 + P ) % P + 1 | import sys
T = input()
for i in range(0,T):
K,P = raw_input().split(' ')
K = int(K)
P = int(P)
print ( K % P - 1 + P ) % P + 1 | s147184035 | s865852203 | p00292 | python | Runtime Error |
a,b = map(int,input())
print((a+b)//2) | a,b = map(int,input().split())
print((a+b)//2) | s541729624 | s629719502 | p00352 | python | Runtime Error |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import itertools
def solve():
cache = dict()
def loop(i, w):
if (i, w) in cache:
return cache[i, w]
if i == N:
return (0, 0)
cache[i, w] = loop(i + 1, w)
if v[i][1] <= w:
t = loop(i + 1, w - v[i][... | import itertools
for dn in itertools.count(1):
W = int(input())
if W == 0: break
N = int(input())
d = [tuple(map(int, input().split(','))) for _ in range(N)]
v = [0 for _ in range(W + 1)]
for i in range(N):
for j in range(W, d[i][1] - 1, -1):
v[j] = max(v[j], v[j - d[i][1]]... | s802438537 | s442756311 | p00042 | python | Runtime Error |
import itertools
def solve():
cache = {}
def loop(i, w):
if (i, w) in cache:
return cache[i, w]
if i == N:
return (0, 0)
cache[i, w] = loop(i + 1, w)
if v[i][1] <= w:
t = loop(i + 1, w - v[i][1])
cache[i, w] = max(cache[i, w], (t[0... | import itertools
for dn in itertools.count(1):
W = int(input())
if W == 0: break
N = int(input())
d = [tuple(map(int, input().split(','))) for _ in range(N)]
v = [0 for _ in range(W + 1)]
for i in range(N):
for j in range(W, d[i][1] - 1, -1):
v[j] = max(v[j], v[j - d[i][1]]... | s573891222 | s442756311 | p00042 | python | Runtime Error |
import itertools
def solve(W, N, v):
cache = {}
def loop(i, w):
if (i, w) in cache:
return cache[i, w]
if i == N:
return (0, 0)
cache[i, w] = loop(i + 1, w)
if v[i][1] <= w:
t = loop(i + 1, w - v[i][1])
cache[i, w] = max(cache[i, w... | import itertools
for dn in itertools.count(1):
W = int(input())
if W == 0: break
N = int(input())
d = [tuple(map(int, input().split(','))) for _ in range(N)]
v = [0 for _ in range(W + 1)]
for i in range(N):
for j in range(W, d[i][1] - 1, -1):
v[j] = max(v[j], v[j - d[i][1]]... | s892533809 | s442756311 | p00042 | python | Runtime Error |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import itertools
def solve(W, N, v):
cache = [[None for _ in range(W + 1)] for _ in range(N)]
def loop(i, w):
if i == N:
return (0, 0)
if cache[i][w] is not None:
return cache[i][w]
cache[i][w] = loop(i + 1, w)
... | import itertools
for dn in itertools.count(1):
W = int(input())
if W == 0: break
N = int(input())
d = [tuple(map(int, input().split(','))) for _ in range(N)]
v = [0 for _ in range(W + 1)]
for i in range(N):
for j in range(W, d[i][1] - 1, -1):
v[j] = max(v[j], v[j - d[i][1]]... | s953407805 | s442756311 | p00042 | python | Runtime Error |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import itertools
def solve(W, N, v):
cache = {}
def loop(i, w):
if i == N:
return (0, 0)
if (i, w) in cache:
return cache[i, w]
cache[i, w] = loop(i + 1, w)
if v[i][1] <= w:
t = loop(i + 1, w - v[... | import itertools
for dn in itertools.count(1):
W = int(input())
if W == 0: break
N = int(input())
d = [tuple(map(int, input().split(','))) for _ in range(N)]
v = [0 for _ in range(W + 1)]
for i in range(N):
for j in range(W, d[i][1] - 1, -1):
v[j] = max(v[j], v[j - d[i][1]]... | s709644587 | s442756311 | p00042 | python | Runtime Error |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import re
from typing import List
def rdp_connect() -> bool:
global s1, s2
s1 = input()
if s1 == '.':
return False
s2 = input()
return True
def rdp_token(s: str) -> List[str]:
res = []
while s:
match = re.match(r'[a-zA-Z0-9;]+'... | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import re
def rdp_connect() -> bool:
global s1, s2
s1 = input()
if s1 == '.':
return False
s2 = input()
return True
def rdp_token(s: str):
res = []
while s:
match = re.match(r'[a-zA-Z0-9;]+', s)
if match:
re... | s099659158 | s423973755 | p01102 | python | Runtime Error |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import re
from typing import List
def rdp_connect() -> bool:
global s1, s2
s1 = input()
if s1 == '.':
return False
s2 = input()
return True
def rdp_token(s: str) -> List[str]:
res = []
while s:
match = re.match(r'[a-zA-Z0-9;]+'... | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import re
def rdp_connect() -> bool:
global s1, s2
s1 = input()
if s1 == '.':
return False
s2 = input()
return True
def rdp_token(s: str):
res = []
while s:
match = re.match(r'[a-zA-Z0-9;]+', s)
if match:
re... | s604652225 | s423973755 | p01102 | python | Runtime Error |
import itertools
n = int(input())
a = [input() for _ in range(n)]
suits = ['S', 'H', 'C', 'D']
cards = ["%s %d" % (s, r) for s, r in suits, range(1, 14)]
answers = [c for c in cards if c not in a]
for card in answers:
print(card)
| import itertools
n = int(input())
a = [input() for _ in range(n)]
suits = ['S', 'H', 'C', 'D']
cards = ["%s %d" % (s, r) for s, r in itertools.product(suits, range(1, 14))]
answers = [c for c in cards if c not in a]
for card in answers:
print(card)
| s985193931 | s261335106 | p02408 | python | Runtime Error |
while 1:
n,m,q=map(int,input().split())
if (n|m|q)==0: break
p=[]
res=[[_ for _ in range(n)] for _ in range(m)]
for i in range(q):
s,b=[[int(c) for c in s] for s in input().split()]
if i>0:
for j in range(n):
s[j]^=p[j]
for j in range(n):
for k in range(m):
if s[j]!=... | while 1:
n,m,q=map(int,input().split())
if (n|m|q)==0: break
p=[]
res=[{_ for _ in range(n)} for _ in range(m)]
for i in range(q):
s,b=[[int(c) for c in s] for s in input().split()]
if i>0:
for j in range(n):
s[j]^=p[j]
zero={i for i in range(n) if s[i]==0}
one={i for i in ran... | s367691272 | s308443127 | p01702 | python | Runtime Error |
code="""
#include <iostream>
using namespace std;
int main()
{
int x; cin>>x;
cout<<x*x*x<<endl;
}
"""
import os,tempfile
(_,filename)=tempfile.mkstemp(".cpp")
f=open(filename,"w")
f.write(code)
f.close()
os.system("g++ -std=c++11 {} -o a.out".format(filename))
os.system("./a.out") | code="""
#include <iostream>
using namespace std;
int main()
{
int x; cin>>x;
cout<<x*x*x<<endl;
}
"""
import os,tempfile
(_,filename)=tempfile.mkstemp(".cpp")
f=open(filename,"w")
f.write(code)
f.close()
os.system("g++ -std=c++0x {} -o ./a.out".format(filename))
os.system("./a.out") | s600114942 | s048077309 | p02480 | python | Runtime Error |
code="""
using System;
using System.Numerics;
class Test{
static void Main(){
BigInteger x=BigInteger.Parse(Console.ReadLine());
Console.WriteLine(x*x*x);
}
}
"""
import os,tempfile
(_,filename)=tempfile.mkstemp()
f=open(filename,"w")
f.write(code)
f.close()
os.system("dmcs {} -r:System.Numerics -out:a.e... | code="""
#include <iostream>
using namespace std;
int main()
{
int x; cin>>x;
cout<<x*x*x<<endl;
}
"""
import os,tempfile
(_,filename)=tempfile.mkstemp(".cpp")
f=open(filename,"w")
f.write(code)
f.close()
os.system("g++ -std=c++0x {} -o ./a.out".format(filename))
os.system("./a.out") | s717846260 | s048077309 | p02480 | python | Runtime Error |
code="""
#include <iostream>
using namespace std;
int main()
{
int x; cin>>x;
cout<<x*x*x<<endl;
}
"""
import os,tempfile
(_,filename)=tempfile.mkstemp(".cpp")
f=open(filename,"w")
f.write(code)
f.close()
os.system("g++ -std=c++11 {} -o ./a.out".format(filename))
os.system("./a.out") | code="""
#include <iostream>
using namespace std;
int main()
{
int x; cin>>x;
cout<<x*x*x<<endl;
}
"""
import os,tempfile
(_,filename)=tempfile.mkstemp(".cpp")
f=open(filename,"w")
f.write(code)
f.close()
os.system("g++ -std=c++0x {} -o ./a.out".format(filename))
os.system("./a.out") | s295731836 | s048077309 | p02480 | python | Runtime Error |
def kaijou(n):
res=1
for i in xrange(1,x+1):
res*=i
return res
def comb(a,b):
if(a<b or b<0):return 0
if(b==0):return 1
return kaijou(a)/kaijou(b)/kaijou(a-b)
a,b,c=map(int,raw_input().split())
c-=a*b
print comb(c+a-1,c) | def kaijou(n):
res=1
for i in xrange(1,n+1):
res*=i
return res
def comb(a,b):
if(a<b or b<0):return 0
if(b==0):return 1
return kaijou(a)/kaijou(b)/kaijou(a-b)
a,b,c=map(int,raw_input().split())
c-=a*b
print comb(c+a-1,c) | s241323673 | s631015855 | p00514 | python | Runtime Error |
n = int(raw_input())
d = ""
for i in range(n):
p,q = map(str,raw_input().split())
if p == "insert":
d = Insert(d,q)
elif p == "find":
rst = Find(d,q)
print rst
def Insert(d,v):
d += v
return d
def Find(d,v):
r = d.find(v)
if(r >= 0):
return "yes"
else:
... | n = int(raw_input())
d = set()
for i in range(n):
p,q = map(str,raw_input().split())
if p == "insert":
d.add(q)
elif p == "find":
if(q in d):
print "yes"
else:
print "no" | s466880825 | s800458491 | p02269 | python | Runtime Error |
n = int(raw_input())
d = ""
for i in range(n):
p,q = map(str,raw_input().split())
if p == "insert":
d += q
elif p == "find":
r = d.find(q)
if(r >= 0):
return "yes"
else:
return "no" | n = int(raw_input())
d = set()
for i in range(n):
p,q = map(str,raw_input().split())
if p == "insert":
d.add(q)
elif p == "find":
if(q in d):
print "yes"
else:
print "no" | s715738254 | s800458491 | p02269 | python | Runtime Error |
i=1
j=1
while i<10:
j=1
while j<10:
print i,'x',j,'=',i*j,"\n"
j=j+1
i=i+1 | x = range(1,10)
for i in x:
for j in x:
print u"%dx%d=%d"%(i, j, i*j) | s703551669 | s319158556 | p00000 | python | Runtime Error |
i=range(1,10)
for s in i:
for b in i:
print "%dx%d=%d",i,j,i*j | x = range(1,10)
for i in x:
for j in x:
print u"%dx%d=%d"%(i, j, i*j) | s395149338 | s319158556 | p00000 | python | Runtime Error |
i=1
j=1
while i<10:
j=1
while j<10:
print i,"x",j,"=",i*j | x = range(1,10)
for i in x:
for j in x:
print u"%dx%d=%d"%(i, j, i*j) | s421906588 | s319158556 | p00000 | python | Time Limit Exceeded |
i=gets
i=i.to_i
print i*i*i,"\n" | input_num = int(input())
print(input_num ** 3)
| s772277765 | s776140756 | p02388 | python | Runtime Error |
x = input()
print(x ** 3) | x = input()
y = int(x)**3
print(y) | s139017467 | s350889462 | p02388 | python | Runtime Error |
x = input()
print(x ** 3) | x = input()
y = int(x)**3
print(y) | s064797113 | s350889462 | p02388 | python | Runtime Error |
x = int(input()
print(x ** 3) | x = input()
y = int(x)**3
print(y) | s499534350 | s350889462 | p02388 | python | Runtime Error |
# -*- coding:utf-8 -*-
import sys
num_list = []
diff = -sys.maxsize -1
for i in range(int(input())):
num_list.append(int(input()))
for (idx, Rt) in enumerate(num_list):
if(idx+1 == len(num_list)-1):
tmp = num_list[idx+1] - Rt
if (tmp > diff):
diff = tmp
else:
for Rj in ... | import sys
max_diff = -sys.maxsize - 1
for idx in range(int(input())):
Rt = int(input())
if(idx):
tmp = Rt - min_num
if(tmp > max_diff):
max_diff = tmp
if(Rt < min_num):
min_num = Rt
else:
min_num = Rt
print(max_diff)
| s184090867 | s018935975 | p02258 | python | Time Limit Exceeded |
x = input()
Pow = x*x*x
print ("Pow") | # -*- coding: utf-8 -*-
x = int(input())
print(x*x*x) | s944874659 | s208368018 | p02388 | python | Runtime Error |
x = input()
Pow = x*x*x
print (Pow) | # -*- coding: utf-8 -*-
x = int(input())
print(x*x*x) | s108961858 | s208368018 | p02388 | python | Runtime Error |
# -*- coding:utf-8 -*-
import math
r = int(input())
print("{0:f} {1:f}".format(r*r*math.pi,2*r*math.pi)) | # -*- coding:utf-8 -*-
import math
r = float(input())
print("{0:f} {1:f}".format(r*r*math.pi,2*r*math.pi)) | s201743968 | s348540601 | p02400 | python | Runtime Error |
# -*- coding: utf-8 -*-
n,m,l = [int(i)for i in input().split(' ')]
A = []
B = []
C = [[0for _ in range(n)]for _ in range(l)]
for i in range(n):
A.append([int(a)for a in input().split(' ')])
for i in range(m):
B.append([int(a)for a in input().split(' ')])
for i in range(n):
for j in range(l):
s = 0... | # -*- coding: utf-8 -*-
n,m,l = [int(i)for i in input().split(' ')]
A = []
B = []
C = [[0for _ in range(l)]for _ in range(n)]
for i in range(n):
A.append([int(a)for a in input().split(' ')])
for i in range(m):
B.append([int(a)for a in input().split(' ')])
for i in range(n):
for j in range(l):
s = 0... | s803870757 | s990591649 | p02414 | python | Runtime Error |
# -*- coding: utf-8 -*-
n,m,l = [int(i)for i in input().split(' ')]
A = []
B = []
C = [[0for _ in range(n)]for _ in range(l)]
for i in range(n):
A.append([int(a)for a in input().split(' ')])
for i in range(m):
B.append([int(a)for a in input().split(' ')])
for i in range(n):
for j in range(l):
s = 0... | # -*- coding: utf-8 -*-
n,m,l = [int(i)for i in input().split(' ')]
A = []
B = []
C = [[0for _ in range(l)]for _ in range(n)]
for i in range(n):
A.append([int(a)for a in input().split(' ')])
for i in range(m):
B.append([int(a)for a in input().split(' ')])
for i in range(n):
for j in range(l):
s = 0... | s933091821 | s990591649 | p02414 | python | Runtime Error |
from math import sqrt
x1, y1, x2, y2 = (int(i) for i in input().split())
d = sqrt((x1 - x2) ** 2 + (y1 - y2) ** 2)
print(d) | from math import sqrt
x1, y1, x2, y2 = (float(i) for i in input().split())
d = sqrt((x1 - x2) ** 2 + (y1 - y2) ** 2)
print(d) | s279776906 | s594264928 | p02379 | python | Runtime Error |
import math
n = int(input())
for i in range(0, n):
a = int(input())
b = int(input())
if math.log10(a + b) + 1 > 80:
print("overflow")
else :
print(a + b) | n = int(input())
for i in range(0, n):
a = int(input())
b = int(input())
if len(str(a + b)) > 80:
print("overflow")
elif len(str(a)) > 80:
print("overflow")
elif len(str(b)) > 80:
print("overflow")
else :
print(a + b) | s586749419 | s842481500 | p00015 | python | Runtime Error |
import math
n = int(input())
for i in range(0, n):
a = int(input())
b = int(input())
if int(math.log10(a + b)) + 1 > 80:
print("overflow")
else :
print(a + b) | n = int(input())
for i in range(0, n):
a = int(input())
b = int(input())
if len(str(a + b)) > 80:
print("overflow")
elif len(str(a)) > 80:
print("overflow")
elif len(str(b)) > 80:
print("overflow")
else :
print(a + b) | s812397798 | s842481500 | p00015 | python | Runtime Error |
import math
n = int(input())
for i in range(0, n) :
a = int(input())
b = int(input())
if math.log10(a + b) + 1 > 80 :
print("overflow")
elif math.log10(a) + 1 > 80 :
print("overflow")
elif math.log10(b) + 1 > 80 :
print("overflow")
else :
print(a + b) | n = int(input())
for i in range(0, n):
a = int(input())
b = int(input())
if len(str(a + b)) > 80:
print("overflow")
elif len(str(a)) > 80:
print("overflow")
elif len(str(b)) > 80:
print("overflow")
else :
print(a + b) | s303800096 | s842481500 | p00015 | python | Runtime Error |
n = int(input())
for i in range(0, n):
a = int(input())
b = int(input())
if len(str(a + b)) >= 80
print("overflow")
elif len(str(a)) >= 80:
print("overflow")
elif len(str(b)) >= 80
print("overflow")
else :
print(a + b) | n = int(input())
for i in range(0, n):
a = int(input())
b = int(input())
if len(str(a + b)) > 80:
print("overflow")
elif len(str(a)) > 80:
print("overflow")
elif len(str(b)) > 80:
print("overflow")
else :
print(a + b) | s413206818 | s842481500 | p00015 | python | Runtime Error |
n = int(input())
for i in range(0, n):
a = int(input())
b = int(input())
if len(str(a + b)) > 80
print("overflow")
elif len(str(a)) > 80:
print("overflow")
elif len(str(b)) > 80
print("overflow")
else :
print(a + b) | n = int(input())
for i in range(0, n):
a = int(input())
b = int(input())
if len(str(a + b)) > 80:
print("overflow")
elif len(str(a)) > 80:
print("overflow")
elif len(str(b)) > 80:
print("overflow")
else :
print(a + b) | s541413815 | s842481500 | p00015 | python | Runtime Error |
while True:
n = input()
if n == "0000":
break
if n.count(n[0]) == 4:
print("NA")
continue
cnt = 0
while n != "6174":
L, S = list(n), list(n)
L.sort(reverse=True)
S.sort()
n = str(int("".join(L)) - int("".join(S)))
cnt += 1
print(... | while True:
n = input()
if n == "0000":
break
if n.count(n[0]) == 4:
print("NA")
continue
cnt = 0
while n != "6174":
L, S = list(n), list(n)
L.sort(reverse=True)
S.sort()
n = str(int("".join(L)) - int("".join(S))).zfill(4)
cnt += 1
... | s707294599 | s967480927 | p00254 | python | Time Limit Exceeded |
#coding: UTF-8
for i in range(1,10):
for j in range(1,10):
print(i + "*" + j + "=" + i*j) | #coding: UTF-8
for i in range(1,10):
for j in range(1,10):
print str(i) + 'x' + str(j) + '=' + str(i*j) | s820854412 | s465817503 | p00000 | python | Runtime Error |
ans = ['A','B','C','D','E','F','G']
def get(x):
for i in range(8):
for j in range(8):
if i < 7 and j < 7:
if x[i][j]=='1' and x[i+1][j]=='1' and x[i][j+1]=='1' and x[i+1][j+1]=='1':
return 0
if i<5:
if x[i][j]=='1' and x[i+1][j]=='1... | ans = ['A','B','C','D','E','F','G']
def get(x):
for i in range(8):
for j in range(8):
if i < 7 and j < 7:
if x[i][j]=='1' and x[i+1][j]=='1' and x[i][j+1]=='1' and x[i+1][j+1]=='1':
return 0
if i<5:
if x[i][j]=='1' and x[i+1][j]=='1... | s661303803 | s719975406 | p00036 | python | Runtime Error |
count = 0
while 1:
a = raw_input()
b = a[::-1]
if a == b: count+=1
print count
| count = 0
try:
while 1:
a = raw_input()
b = a[::-1]
if a == b: count+=1
except EOFError: pass
print count | s313615162 | s652395721 | p00063 | python | Runtime Error |
line = False
while True:
a,b = map(int, raw_input().split())
if line: print ""
line = True
count = 0
for i in range(a, b+1):
if (i % 4 == 0 and i % 100 != 0) or i % 400 == 0:
print i
count += 1
if count == 0: print "NA" | line = False
while 1:
a,b = map(int, raw_input().split())
if a == b == 0: break
if line: print
line = True
count = 0
for i in range(a, b+1):
if (i % 4 == 0 and i % 100 != 0) or (i % 400 == 0):
print i
count += 1
if count == 0: print "NA" | s970388684 | s894037117 | p00093 | python | Runtime Error |
a,b = map(int, raw_input().split)
gA = []
gb = []
for i in range(a):
gA.append(map(int, raw_input().split()))
for i in range(b):
gb.append(input())
for i in range(a):
ans = 0
for j in range(b):
ans += gA[i][j] * gb[j]
print ans | m,n = map(int, raw_input().split())
a = []
b = []
for i in range(m):
a.append(map(int, raw_input().split()))
for i in range(n):
b.append(input())
for i in range(m):
ans = 0
for j in range(n):
ans += a[i][j] * b[j]
print ans | s156633204 | s413434758 | p02410 | python | Runtime Error |
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
>>> import time
>>> time.sleep(1)
if(a>=0):
print ((b-a)*e);
else:
print(a*-c+d+b*e); | a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
if(a>=0):
print ((b-a)*e);
else:
print(a*-c+d+b*e); | s927570878 | s024593568 | p00553 | python | Runtime Error |
height = map(int, raw_input().split())
height.sort()
for i in range(3):
print height[9-i] | s = []
for i in xrange(10):
s.append(int(raw_input()))
s.sort()
s.reverse()
for i in xrange(3):
print s[i] | s965623523 | s857003841 | p00001 | python | Runtime Error |
import math
while True:
a, b = map(int,raw_input().split())
print int(math.log10(a+b) + 1) | while True:
try:
a,b = map(int,raw_input().split())
print len(str(a+b))
except EOFError:
break | s107121794 | s816913733 | p00002 | python | Runtime Error |
import math
while True:
a, b = map(int,raw_input().split())
print int(math.log10(a+b) + 1) | while True:
try:
a,b = map(int,raw_input().split())
print len(str(a+b))
except EOFError:
break | s204730280 | s816913733 | p00002 | python | Runtime Error |
while True:
import math
a, b = map(int,raw_input().split())
print int(math.log10(a+b) + 1) | while True:
try:
a,b = map(int,raw_input().split())
print len(str(a+b))
except EOFError:
break | s033979858 | s816913733 | p00002 | python | Runtime Error |
import math
while 1:
a, b = map(int,raw_input().split())
print int(math.log10(a+b)+1) | while True:
try:
a,b = map(int,raw_input().split())
print len(str(a+b))
except EOFError:
break | s706180193 | s816913733 | p00002 | python | Runtime Error |
while True:
a,b = map(int,raw_input().split())
print strlen(srt(a+b)) | while True:
try:
a,b = map(int,raw_input().split())
print len(str(a+b))
except EOFError:
break | s249013530 | s816913733 | p00002 | python | Runtime Error |
while True:
a,b = map(int,raw_input().split())
print len(srt(a+b)) | while True:
try:
a,b = map(int,raw_input().split())
print len(str(a+b))
except EOFError:
break | s155812976 | s816913733 | p00002 | python | Runtime Error |
while True:
a,b = map(int,raw_input().split())
print len(str(a+b)) | while True:
try:
a,b = map(int,raw_input().split())
print len(str(a+b))
except EOFError:
break | s609286830 | s816913733 | p00002 | python | Runtime Error |
a = int,raw_input()
for i in range(0,a):
x, y, z = map(int,raw_input().split())
if(x > y > z or x > z > y and x*x == y*y + z*z):
print 'YES'
elif(y > x > z or y > z > x and y*y == x*x + z*z):
print 'YES'
elif(z > x > y or z > y > z and z*z == x*x + y*y):
print 'YES'
else:
print 'NO' | n = int(raw_input())
for i in xrange(n):
a = map(int,raw_input().split())
a.sort()
if a[0]**2 + a[1]**2 == a[2]**2:
print 'YES'
else:
print'NO'
| s654990728 | s987859290 | p00003 | python | Runtime Error |
while True:
a,b,e,d,e,f = map(float,raw_input().split())
x = (e*c-b*f) / (e*a-b*d)
y = (c*d-a*f) / (b*d-e*a)
print '%d %d' % (x,y) | while True:
try:
a,b,c,d,e,f = map(float,raw_input().split())
x = (e*c-b*f) / (e*a-b*d)
y = (c*d-a*f) / (b*d-e*a)
if x == -0.0:
x = 0
if y == -0.0:
y = 0
print '%.3f %.3f' % (x,y)
except EOFError:
break | s125155628 | s221665741 | p00004 | python | Runtime Error |
while True:
a,b,c,d,e,f = map(float,raw_input().split())
x = (e*c-b*f) / (e*a-b*d)
y = (c*d-a*f) / (b*d-e*a)
print '%.3f %.3f' % (x,y) | while True:
try:
a,b,c,d,e,f = map(float,raw_input().split())
x = (e*c-b*f) / (e*a-b*d)
y = (c*d-a*f) / (b*d-e*a)
if x == -0.0:
x = 0
if y == -0.0:
y = 0
print '%.3f %.3f' % (x,y)
except EOFError:
break | s586332088 | s221665741 | p00004 | python | Runtime Error |
while True:
a,b,c,d,e,f = map(float,raw_input().split())
x = (e*c-b*f) / (e*a-b*d)
y = (c*d-a*f) / (b*d-e*a)
print '%.3f %.3f' % (x,y) | while True:
try:
a,b,c,d,e,f = map(float,raw_input().split())
x = (e*c-b*f) / (e*a-b*d)
y = (c*d-a*f) / (b*d-e*a)
if x == -0.0:
x = 0
if y == -0.0:
y = 0
print '%.3f %.3f' % (x,y)
except EOFError:
break | s932907921 | s221665741 | p00004 | python | Runtime Error |
while True:
try:
a,b,c,d,e,f = map(float,raw_input().split())
x = (e*c-b*f) / (e*a-b*d)
y = (c*d-a*f) / (b*d-e*a)
if x == -0.0:
x = 0
if y == -0.0
y = 0
print '%.3f %.3f' % (x,y)
except EOFError:
break | while True:
try:
a,b,c,d,e,f = map(float,raw_input().split())
x = (e*c-b*f) / (e*a-b*d)
y = (c*d-a*f) / (b*d-e*a)
if x == -0.0:
x = 0
if y == -0.0:
y = 0
print '%.3f %.3f' % (x,y)
except EOFError:
break | s836918580 | s221665741 | p00004 | python | Runtime Error |
while True:
ans = 0
n = int(raw_input())
for i in xrange(10):
for j in xrange(10):
for k in xrange(10):
for l in xrange(10):
if i+j+k+l == n:
ans += 1
print ans | while True:
try:
ans = 0
n = int(raw_input())
for i in xrange(10):
for j in xrange(10):
for k in xrange(10):
for l in xrange(10):
if i+j+k+l == n:
ans += 1
print ans
except EOFError:
break | s581876215 | s654890334 | p00008 | python | Runtime Error |
IsPrimes = [True] * 1000002
IsPimes[0], IsPimes[1] = False, False
for i in range(2, 1001):
if IsPrime[i]:
for j in range(i*i, 1000001, i)
IsPrime[j]= False
cnt = [0] * 1000001
for i in range(1000001):
if IsPimes[i]:
cnt[i] += 1
for i in range(1, 1000001):
cnt[i] += cnt[i-1]
... | era = [True]*1000001
for i in xrange(2,1000001):
if era[i-2]:
for j in xrange(i*2,1000001,i):
era[j-2]=False
while True:
try:
n = int(raw_input())
print era[:n-1].count(True)
except EOFError:
break | s297903385 | s838854370 | p00009 | python | Runtime Error |
while True:
try:
n = int(raw_input())
era=[True]*(n)
for i in xrange(2,n):
if(era[i-1]):
for j in xrange(i*i-1,n,i):
era[j]=False
print era[1:n].count(T... | era = [True]*1000001
for i in xrange(2,1000001):
if era[i-2]:
for j in xrange(i*2,1000001,i):
era[j-2]=False
while True:
try:
n = int(raw_input())
print era[:n-1].count(True)
except EOFError:
break | s005545652 | s838854370 | p00009 | python | Time Limit Exceeded |
import math
n = int(raw_input())
for i in range(n):
x1, y1, x2, y2, x3, y3 = map(int, raw_input().split())
px = ((y2 - y3)*(x1*x1 + y1*y1) + (y3 - y1)*(x2*x2 + y2*y2) + (y1 - y2)*(x3*x3 + y3*y3))/(2*(x1*(y2 - y3) + x2*(y3 - y1) + x3*(y1 - y2)))
py = ((x2 - x3)*(x1*x1 + y1*y1) + (x3 - x1)*(x2*x2 + y2*y2) + (x1... | import math
n = int(raw_input())
for i in range(n):
x1, y1, x2, y2, x3, y3 = map(float, raw_input().split())
px = ((y2 - y3)*(x1*x1 + y1*y1) + (y3 - y1)*(x2*x2 + y2*y2) + (y1 - y2)*(x3*x3 + y3*y3))/(2*(x1*(y2 - y3) + x2*(y3 - y1) + x3*(y1 - y2)))
py = ((x2 - x3)*(x1*x1 + y1*y1) + (x3 - x1)*(x2*x2 + y2*y2) + (... | s465297109 | s273583003 | p00010 | python | Runtime Error |
import math
n = int(raw_input())
for i in range(n):
x1, y1, x2, y2, x3, y3 = map(int, raw_input().split())
px = ((y2 - y3)*(x1*x1 + y1*y1) + (y3 - y1)*(x2*x2 + y2*y2) + (y1 - y2)*(x3*x3 + y3*y3))/(2*(x1*(y2 - y3) + x2*(y3 - y1) + x3*(y1 - y2)))
py = ((x2 - x3)*(x1*x1 + y1*y1) + (x3 - x1)*(x2*x2 + y2*y2) + (x1... | import math
n = int(raw_input())
for i in range(n):
x1, y1, x2, y2, x3, y3 = map(float, raw_input().split())
px = ((y2 - y3)*(x1*x1 + y1*y1) + (y3 - y1)*(x2*x2 + y2*y2) + (y1 - y2)*(x3*x3 + y3*y3))/(2*(x1*(y2 - y3) + x2*(y3 - y1) + x3*(y1 - y2)))
py = ((x2 - x3)*(x1*x1 + y1*y1) + (x3 - x1)*(x2*x2 + y2*y2) + (... | s976251197 | s273583003 | p00010 | python | Runtime Error |
#!/usr/bin/env python2
# coding: utf-8
def casar(s, n):
d = {}
for c in (65, 97):
for i in range(26):
d[chr(i+c)] = chr((i+n) % 26 + c)
return "".join([d.get(c, c) for c in s])
try:
while True:
encrypttxt = raw_input()
for i in range(26):
t = casar(encrypttxt, i)
if "the" in... | #!/usr/bin/env python2
# coding: utf-8
def caesar(s, n):
d = {}
for c in (65, 97):
for i in range(26):
d[chr(i+c)] = chr((i+n) % 26 + c)
return "".join([d.get(c, c) for c in s])
while True:
try:
encrypt_txt = raw_input()
except EOFError:
break
for i in ra... | s138749093 | s848866819 | p00017 | python | Runtime Error |
while True:
a = map(int, raw_input().split())
b = map(int, raw_input().split())
hit = 0
blow = 0
for i in range(4):
if(a[i] == b[i]):
hit += 1
elif(a[i] in b):
blow += 1
print hit, blow | while True:
try:
a = map(int, raw_input().split())
b = map(int, raw_input().split())
hit = blow = 0
for i in range(4):
if(a[i] == b[i]):
hit += 1
elif(a[i] in b):
blow += 1
print hit, blow
except EOFError:
break | s430093148 | s215748475 | p00025 | python | Runtime Error |
while True:
a = map(int, raw_input().split(' '))
b = map(int, raw_input().split(' '))
hit = blow = 0
for i in range(4):
if(a[i] == b[i]):
hit += 1
elif(a[i] in b):
blow += 1
print hit, blow | while True:
try:
a = map(int, raw_input().split())
b = map(int, raw_input().split())
hit = blow = 0
for i in range(4):
if(a[i] == b[i]):
hit += 1
elif(a[i] in b):
blow += 1
print hit, blow
except EOFError:
break | s815554927 | s215748475 | p00025 | python | Runtime Error |
while True:
try:
a = map(int, raw_input().split(' '))
b = map(int, raw_input().split(' '))
hit = blow = 0
for i in range(4):
if(a[i] == b[i]):
hit += 1
elif(a[i] in b):
blow += 1
print hit, blow
except EOFError:
break | while True:
try:
a = map(int, raw_input().split())
b = map(int, raw_input().split())
hit = blow = 0
for i in range(4):
if(a[i] == b[i]):
hit += 1
elif(a[i] in b):
blow += 1
print hit, blow
except EOFError:
break | s992629157 | s215748475 | p00025 | python | Runtime Error |
# coding: utf-8
# Convert String to List
def String2List(s):
L = []; tmp = ""
for i in s:
if i.isdigit():
tmp += i
else:
if tmp != "":
L.append(tmp)
tmp = ""
L.append(i)
if tmp != "":
L.append(tmp)
return L
# ... | # coding: utf-8
# Convert String to List
def String2List(s):
L = []; tmp = ""
for i in s:
if i.isdigit():
tmp += i
else:
if tmp != "":
L.append(tmp)
tmp = ""
L.append(i)
if tmp != "":
L.append(tmp)
return L
# ... | s988400481 | s107157585 | p00109 | python | Runtime Error |
# coding: utf-8
# Convert String to List
def String2List(s):
L = []; tmp = ""
for i in s:
if i.isdigit():
tmp += i
else:
if tmp != "":
L.append(tmp)
tmp = ""
L.append(i)
if tmp != "":
L.append(tmp)
return L
# ... | # coding: utf-8
# Convert String to List
def String2List(s):
L = []; tmp = ""
for i in s:
if i.isdigit():
tmp += i
else:
if tmp != "":
L.append(tmp)
tmp = ""
L.append(i)
if tmp != "":
L.append(tmp)
return L
# ... | s378867829 | s107157585 | p00109 | python | Runtime Error |
def bubble_sort(A, N):
flag = True
c = 0
i = 0
while flag:
flag = False
for j in range(N-1, i, -1):
if A[j] < A[j-1]:
A[j], A[j-1] = A[j-1], A[j]
c += 1
flag = True
i += 1
return c
while True:
N = int(raw_in... | def bubble_sort(A, N):
flag = True
i, c = 0, 0
while flag:
flag = False
for j in range(1, N-i):
if A[j] < A[j-1]:
A[j], A[j-1] = A[j-1], A[j]
flag = True
c += 1
i += 1
return c
while True:
N = int(raw_in... | s915343937 | s712421710 | p00167 | python | Runtime Error |
while True:
N, Q = map(int, raw_input().split())
if N == 0 and Q == 0:
break
t = [map(int, raw_input().split())[1:] for _ in range(N)]
table = [[i, 0] for i in range(10)]
for i in t:
for j in i:
table[j][1] += 1
table.sort(reverse=True, key=lambda x: x[1])
pr... | while True:
N, Q = map(int, raw_input().split())
if N == 0 and Q == 0:
break
t = [map(int, raw_input().split())[1:] for _ in range(N)]
table = [[i, 0] for i in range(101)]
for i in t:
for j in i:
table[j][1] += 1
table.sort(reverse=True, key=lambda x: x[1])
p... | s453051750 | s231827651 | p00705 | python | Runtime Error |
while True:
n = int(raw_input())
if n == 0:
break
l = []
for i in range(n):
l.append(int(raw_input())
print (sum(l) - max(l) - min(l)) / (len(l) - 2) | while True:
n = int(raw_input())
if n == 0:
break
L = [int(raw_input()) for _ in range(n)]
print (sum(L) - max(L) - min(L)) / (n - 2)
| s967919736 | s200481880 | p00728 | python | Runtime Error |
while True:
n = int(raw_input())
if !n:
break
L = [int(raw_input()) for _ in range(n)]
print (sum(L) - max(L) - min(L)) / (n - 2)
| while True:
n = int(raw_input())
if n == 0:
break
L = [int(raw_input()) for _ in range(n)]
print (sum(L) - max(L) - min(L)) / (n - 2)
| s798125115 | s200481880 | p00728 | python | Runtime Error |
while True:
x, y, s = map(int, raw_input().split())
if x == 0 and y == 0 and s == 0:
break
ans = 0
for i in range(1, s):
for j in range(1, s):
a = i * (100 + x) / 100;
b = j * (100 + x) / 100;
if a + b != s:
continue
an... | while True:
x, y, s = map(int, raw_input().split())
if x == 0 and y == 0 and s == 0:
break
ans = 0
for i in range(1, s):
for j in range(1, s-i+1):
if int(i * (100 + x) / 100.0) + int(j * (100 + x) / 100.0) == s:
ans = max(ans, int(i * (100 + y) / 100.0) + i... | s900753980 | s885733107 | p00773 | python | Runtime Error |
while True:
n, m = map(int, raw_input().split())
if n == 0 and m == 0:
break
a = [int(raw_input()) for _ in range(n)]
ans = -1
for i in range(n-1):
for j in range(i+1, n):
if a[i] + a[j] <= m:
ans = max(ans, a[i] + a[j])
print "NONE" if ans == -1 ... | while True:
n, m = map(int, raw_input().split())
if n == 0 and m == 0:
break
a = map(int, raw_input().split())
ans = -1
for i in range(n-1):
for j in range(i+1, n):
if a[i] + a[j] <= m:
ans = max(ans, a[i] + a[j])
print "NONE" if ans == -1 else an... | s782731924 | s978978088 | p01101 | python | Runtime Error |
while True:
e = int(raw_input())
if e == 0:
break
ans = float('inf')
for z in range(10**2+1):
for y in range(10**3+1):
if y**2 + z**3 <= e:
x = e - y**2 - z**3
ans = min(ans, x+y+z)
print ans
| #!/usr/bin/env python3
from math import sqrt
while True:
e = int(input())
if e == 0: break
z, ans = 0, e
while z ** 3 <= e:
y = int(sqrt(e - z**3))
x = e - y**2 - z**3
ans = min(ans, x + y + z)
z += 1
print(ans)
| s145877873 | s276262113 | p01137 | python | Runtime Error |
while True:
e = int(raw_input())
if e == 0:
break
ans = 1e8
for z in range(10**2+1):
for y in range(10**3+1):
if y**2 + z**3 <= e:
x = e - y**2 - z**3
ans = min(ans, x+y+z)
print ans
| #!/usr/bin/env python3
from math import sqrt
while True:
e = int(input())
if e == 0: break
z, ans = 0, e
while z ** 3 <= e:
y = int(sqrt(e - z**3))
x = e - y**2 - z**3
ans = min(ans, x + y + z)
z += 1
print(ans)
| s952095650 | s276262113 | p01137 | python | Runtime Error |
while True:
e = int(raw_input())
if e == 0: break
ans = 1e8
for z in range(10**2+1):
for y in range(10**3+1):
if y**2 + z**3 > e:
break
x = e - y**2 - z**3
ans = min(ans, x+y+z)
print ans
| #!/usr/bin/env python3
from math import sqrt
while True:
e = int(input())
if e == 0: break
z, ans = 0, e
while z ** 3 <= e:
y = int(sqrt(e - z**3))
x = e - y**2 - z**3
ans = min(ans, x + y + z)
z += 1
print(ans)
| s211093493 | s276262113 | p01137 | python | Runtime Error |
while True:
e = int(raw_input())
if e == 0: break
ans = 1e8
x, y, z = 0, 0, 0
for z in range(e):
if z**3 > e: break
for y in range(e):
if y**2 + z**3 > e: break
x = e - y**2 - z**3
ans = min(ans, x+y+z)
print ans
| #!/usr/bin/env python3
from math import sqrt
while True:
e = int(input())
if e == 0: break
z, ans = 0, e
while z ** 3 <= e:
y = int(sqrt(e - z**3))
x = e - y**2 - z**3
ans = min(ans, x + y + z)
z += 1
print(ans)
| s366340287 | s276262113 | p01137 | python | Runtime Error |
while True:
e = int(raw_input())
if e == 0: break
x, y, z, ans = 0, 0, 0, e
for z in range(e):
if z**3 > e: break
for y in range(e):
if y**2 + z**3 > e: break
x = e - y**2 - z**3
ans = min(ans, x+y+z)
print ans
| #!/usr/bin/env python3
from math import sqrt
while True:
e = int(input())
if e == 0: break
z, ans = 0, e
while z ** 3 <= e:
y = int(sqrt(e - z**3))
x = e - y**2 - z**3
ans = min(ans, x + y + z)
z += 1
print(ans)
| s285980470 | s276262113 | p01137 | python | Runtime Error |
from math import sqrt
while True:
e = int(raw_input())
if e == 0: break
x, y, z, ans = 0, 0, 0, e
for z in range(e):
if z**3 > e: break
y = int(sqrt(e - z**3))
x = e - y**2 - z**3
ans = min(ans, x+y+z)
print ans
| #!/usr/bin/env python3
from math import sqrt
while True:
e = int(input())
if e == 0: break
z, ans = 0, e
while z ** 3 <= e:
y = int(sqrt(e - z**3))
x = e - y**2 - z**3
ans = min(ans, x + y + z)
z += 1
print(ans)
| s009344272 | s276262113 | p01137 | python | Runtime Error |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.