buggy
stringlengths
1
618k
fixed
stringlengths
16
618k
buggy_submission_id
stringlengths
10
10
fixed_submission_id
stringlengths
10
10
problem_id
stringlengths
6
6
lang
stringclasses
1 value
buggy_verdict
stringclasses
2 values
import sys def dijkstra(m, start, goal, matrix): defnode = {} cost = [sys.maxint] * (m+1) cost[start] = 0 node = start while True: defnode[node] = True for i in xrange(1, m+1): if i in defnode: continue if matrix[node][i] == sys.maxint: continue cost[i] = min(cost[i]...
import sys def dijkstra(m, start, goal, matrix): defnode = [False] * (m+1) cost = [sys.maxint] * (m+1) cost[start] = 0 node = start while True: defnode[node] = True for i in xrange(1, m+1): if defnode[i]: continue if matrix[node][i] == sys.maxint: continue cost[i] = ...
s786814736
s974283142
p00200
python
Time Limit Exceeded
import sys def dijkstra(m, start, goal, matrix): defnode = [False] * (m+1) cost = [sys.maxint] * (m+1) cost[start] = 0 node = start while True: defnode[node] = True minnode = sys.maxint mincost = sys.maxint for i in xrange(1, m+1): if defnode[i]: continue if matrix[node][i...
import sys def dijkstra(m, start, goal, matrix): defnode = [False] * (m+1) cost = [sys.maxint] * (m+1) cost[start] = 0 node = start while True: defnode[node] = True for i in xrange(1, m+1): if defnode[i]: continue if matrix[node][i] == sys.maxint: continue cost[i] = ...
s681212582
s974283142
p00200
python
Runtime Error
import Queue blockpos = [[[0,0], [0,1], [1,0], [1,1], [2,0], [2,1], [3,0], [3,1]], [[0,0], [0,1], [0,2], [0,3], [1,0], [1,1], [1,2], [1,3]]] dxy = [[0,1], [1,0], [0,-1], [-1,0]] q = Queue.Queue() W, H = 0, 0 def checker(xs, ys, xg, yg, field, color): if color == 0: return False global W, H x = xs y = ys ...
import Queue blockpos = [[[0,0], [0,1], [1,0], [1,1], [2,0], [2,1], [3,0], [3,1]], [[0,0], [0,1], [0,2], [0,3], [1,0], [1,1], [1,2], [1,3]]] dxy = [[0,1], [1,0], [0,-1], [-1,0]] q = Queue.Queue() W, H = 0, 0 def checker(xs, ys, xg, yg, field, color): if color == 0: return False global W, H x = xs y = ys ...
s283491950
s334569213
p00207
python
Runtime Error
import sys def dijkstra(nodes, start, matrix): defnode = [False] * (nodes) cost = [sys.maxint] * (nodes) cost[start] = 0 node = start counter = 0 while True: counter += 1 if counter == nodes: return cost defnode[node] = True for i in xrange(1, nodes): if defnode[i]: cont...
import sys def dijkstra(nodes, start, matrix): defnode = [False] * (nodes) cost = [sys.maxint] * (nodes) cost[start] = 0 node = start counter = 0 while True: counter += 1 if counter == nodes or node == sys.maxint: return cost defnode[node] = True for i in xrange(nodes): if defn...
s184500826
s832640720
p00212
python
Runtime Error
while True: n,m,a = map(int, raw_input().split()) if n==m==a==0: break lst = [0] * n for i in xrange(n): lst[i] = i ms = {} for _ in xrange(n): h,p,q = map(int, raw_input().split()) if h not in ms: ms[h] = {} ms[h][p] = q for i,v in sorted(ms.items()): for k,l in v.items(): ...
while True: n,m,a = map(int, raw_input().split()) if n==m==a==0: break lst = [0] * n for i in xrange(n): lst[i] = i ms = {} for _ in xrange(m): h,p,q = map(int, raw_input().split()) if h not in ms: ms[h] = {} ms[h][p] = q for i,v in sorted(ms.items()): for k,l in v.items(): ...
s799009082
s968027591
p01126
python
Runtime Error
import sys def warshall(n, matrix): for i in xrange(n): matrix[i][i] = 0 for i in xrange(n): for j in xrange(n): for k in xrange(n): matrix[j][k] = min(matrix[j][k], matrix[j][i]+matrix[i][k]) return matrix def dijkstra(nodes, start, matrix): defnode = [False] * (nodes) cost = [sys.max...
import sys import heapq class Dijkstra(object): # def dijkstra(self, adj, start, goal=None): def dijkstra(self, num, path, start, goal=None): # num = len(adj) dist = [sys.maxint] * num prev = [sys.maxint] * num dist[start] = 0 q = [] heapq.heappush(q, (0, start)) while len(q) != 0: ...
s176285013
s605791838
p01146
python
Runtime Error
import sys def warshall(n, matrix): for i in xrange(n): matrix[i][i] = 0 for i in xrange(n): for j in xrange(n): for k in xrange(n): matrix[j][k] = min(matrix[j][k], matrix[j][i]+matrix[i][k]) return matrix def dijkstra(nodes, start, matrix): defnode = [False] * (nodes) cost = [sys.max...
import sys import heapq class Dijkstra(object): # def dijkstra(self, adj, start, goal=None): def dijkstra(self, num, path, start, goal=None): # num = len(adj) dist = [sys.maxint] * num prev = [sys.maxint] * num dist[start] = 0 q = [] heapq.heappush(q, (0, start)) while len(q) != 0: ...
s791034893
s605791838
p01146
python
Runtime Error
import sys import heapq class Dijkstra(object): def dijkstra(self, adj, start, goal=None): num = len(adj) dist = [sys.maxint] * num prev = [sys.maxint] * num dist[start] = 0 q = [] heapq.heappush(q, (0, start)) while len(q) != 0: prov_cost, src = heapq.heappop(q) if dist[src]...
import sys import heapq class Dijkstra(object): # def dijkstra(self, adj, start, goal=None): def dijkstra(self, num, path, start, goal=None): # num = len(adj) dist = [sys.maxint] * num prev = [sys.maxint] * num dist[start] = 0 q = [] heapq.heappush(q, (0, start)) while len(q) != 0: ...
s287319238
s605791838
p01146
python
Runtime Error
from collections import deque class Process: def __init__(self, name, time): self.name = name self.time = time def getName(self): return self.name def getTime(self): return self.time def setTime(self, time): self.time = time queue = deque() n, q = map(int, raw_input().split()) for _ in ...
from collections import deque nameq = deque() timeq = deque() n, q = map(int, raw_input().split()) for _ in xrange(n): name, time = raw_input().split() nameq.append(name) timeq.append(int(time)) t = 0 while nameq: name = nameq.popleft() time = timeq.popleft() if time > q: time -= q nameq.append(na...
s542039117
s031634174
p02264
python
Runtime Error
class UnionFind: def __init__(self, size): self.table = [-1 for _ in xrange(size)] def find(self, x): while self.table[x] >= 0: x = self.table[x] return x def union(self, x, y): s1 = self.find(x) s2 = self.find(y) if s1 != s2: if self.table[s1] >= self.table[s2]: self.table...
import heapq def prim(n, path): selected = {} paths = [] hq = [] selected[0] = True if 0 not in path: return [] for s,d,w in path[0]: heapq.heappush(hq, (w, [0,d,w])) while len(hq) != 0: k,root = heapq.heappop(hq) if root[1] in selected: continue selected[root[1]] = True paths....
s544862339
s474898669
p02364
python
Time Limit Exceeded
m=[0,1,0,0,0,0,1,0] (a, b, c) = map(int, raw_input().split()) print ["Close", "Open"][a * 4 + b * 2 + c]
m=[0,1,0,0,0,0,1,0] (a, b, c) = map(int, raw_input().split()) print ["Close", "Open"][m[a * 4 + b * 2 + c]]
s634733485
s578779295
p00252
python
Runtime Error
a = 0 o = "" while True: s = raw_input() if s == "=": break if s in ["+", "-", "*", "/"]: o = s else: a = eval(str(a) + o + s) print a
(a, o) = ("", "") while True: s = raw_input() if s == "=": break if s in ["+", "-", "*", "/"]: o = s else: a = eval(str(a) + o + s) print a
s456832991
s720900880
p00511
python
Runtime Error
#! /usr/bin/env python # -*- coding: utf-8 -*- def main(): while True: n = input() if not n: break w = 0 a = [0, 0] ans = 0 for s in raw_input().split(): f = 0 if s[0] == "l" else 1 u = 0 if s[1] == "d" else 1 a[f] = u if w == 0 and a[0] == 1 and a[1] == 1: w ...
#! /usr/bin/env python # -*- coding: utf-8 -*- def main(): while True: n = input() if not n: break w = 0 a = [0, 0] ans = 0 for s in raw_input().split(): f = 0 if s[0] == "l" else 1 u = 0 if s[1] == "d" else 1 a[f] = u if w == 0 and a[0] == 1 and a[1] == 1: w ...
s813566108
s470038355
p01694
python
Runtime Error
while True: t = raw_input().split(',') l = [int(x) for x in t[:10]] v = [int(x) for x in t[10:]] time = float(sum(l)) / float(sum(v)) dis = time * float(v[0]) s = 0 for (i, x) in enumerate(l): s += x if s >= int(dis): print i + 1 break
import sys for line in iter(sys.stdin.readline, ''): t = line.strip().split(',') l = [int(x) for x in t[:10]] v = [int(x) for x in t[10:]] time = float(sum(l)) / float(sum(v)) dis = time * float(v[0]) s = 0 for (i, x) in enumerate(l): s += x if s >= int(dis): print i + 1 break
s331428904
s140280666
p00034
python
Runtime Error
def cross(p0, p1, p2): dx1, dx2 = p1[0] - p0[0], p2[0] - p0[0] dy1, dy2 = p1[1] - p0[1], p2[1] - p0[1] return True if dy2 * dx1 > dy1 * dx2 else False while True: l = [float(x) for x in raw_input().split(',')] a = l[0:2] b = l[2:4] c = l[4:6] d = l[6:8] if((cross(a, c, b) != cross(a, c, d)) and (cro...
import sys def cross(p0, p1, p2): dx1, dx2 = p1[0] - p0[0], p2[0] - p0[0] dy1, dy2 = p1[1] - p0[1], p2[1] - p0[1] return dy2 * dx1 - dy1 * dx2 for line in iter(sys.stdin.readline, ''): l = [float(r) for r in line.split(',')] a, b, c, d = l[0:2], l[2:4], l[4:6], l[6:8] print 'YES' if (cross(a, c, b) * cro...
s759069250
s745624537
p00035
python
Runtime Error
def cross(p0, p1, p2): dx1, dx2 = p1[0] - p0[0], p2[0] - p0[0] dy1, dy2 = p1[1] - p0[1], p2[1] - p0[1] return dy2 * dx1 - dy1 * dx2 while True: line = raw_input() l = [float(r) for r in line.split(',')] a, b, c, d = l[0:2], l[2:4], l[4:6], l[6:8] print 'YES' if (cross(a, c, b) * cross(a, c, d)) < 0 and ...
import sys def cross(p0, p1, p2): dx1, dx2 = p1[0] - p0[0], p2[0] - p0[0] dy1, dy2 = p1[1] - p0[1], p2[1] - p0[1] return dy2 * dx1 - dy1 * dx2 for line in iter(sys.stdin.readline, ''): l = [float(r) for r in line.split(',')] a, b, c, d = l[0:2], l[2:4], l[4:6], l[6:8] print 'YES' if (cross(a, c, b) * cro...
s981008818
s745624537
p00035
python
Runtime Error
import math i, size = 0, 0 rs = [] while True: line = raw_input() if line == '0 0 0': for r in rs: if size <= r: print 'OK' else: print 'NA' break else: i += 1 if i == 1: t = [int(n) for n in line.split()] t...
import math results = [] while True: line = raw_input() if line == '0 0 0': for r in results: print r break else: t = [int(n) for n in line.split()] t.sort() size = math.sqrt(t[0] * t[0] + t[1] * t[1]) entry = input() for i in range(entry)...
s397366641
s810642944
p00107
python
Runtime Error
def form_check(t): plus = t.index('+') equal = t.index('=') if len(t[:plus]) > 1 or len(t[plus + 1:equal]) > 1 or len(t[equal + 1:] > 1): return False return True def check(t): equal = t.index('=') if eval(t[:equal]) == eval(t[equal + 1:]): return True else: return ...
def form_check(t): plus = t.index('+') equal = t.index('=') n = [t[:plus], t[plus + 1:equal], t[equal + 1:]] for a in n: if len(a) > 1 and a[0] == 'X': return False return True def check(t): if eval(t.replace('=', ' == ')): return True else: return False ...
s880043664
s694166995
p00110
python
Runtime Error
'''aizu 0309 http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0309 ''' # encoding: 'utf-8' def main(): '''main func. ''' node_n = int(input()) nodes = list() edges = list() for _ in range(node_n): nodes.append(Node(input())) for _ in range(node_n - 1): edges.append(...
'''aizu 0309 http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0309 ''' # encoding: 'utf-8' N = 1000000007 def main(): node_n = int(input()) nodes = list() for _ in range(node_n): nodes.append(Node(input())) for _ in range(node_n - 1): i, j = tuple([int(x) for x in input().split...
s100610718
s322953082
p00304
python
Runtime Error
'''aizu 0309 http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0309 ''' # encoding: 'utf-8' N = 1000000007 def main(): '''main func. ''' node_n = int(input()) nodes = list() edges = list() for _ in range(node_n): nodes.append(Node(input())) for _ in range(node_n - 1): ...
'''aizu 0309 http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0309 ''' # encoding: 'utf-8' N = 1000000007 def main(): node_n = int(input()) nodes = list() for _ in range(node_n): nodes.append(Node(input())) for _ in range(node_n - 1): i, j = tuple([int(x) for x in input().split...
s053176875
s322953082
p00304
python
Runtime Error
'''aizu 0309 http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0309 ''' # encoding: 'utf-8' N = 1000000007 def main(): '''main func. ''' node_n = int(input()) nodes = list() edges = list() for _ in range(node_n): nodes.append(Node(input())) for _ in range(node_n - 1): ...
'''aizu 0309 http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0309 ''' # encoding: 'utf-8' N = 1000000007 def main(): node_n = int(input()) nodes = list() for _ in range(node_n): nodes.append(Node(input())) for _ in range(node_n - 1): i, j = tuple([int(x) for x in input().split...
s255219588
s322953082
p00304
python
Runtime Error
'''aizu 0309 http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0309 ''' # encoding: 'utf-8' N = 1000000007 def main(): '''main func. ''' node_n = int(input()) nodes = list() for _ in range(node_n): nodes.append(Node(input())) for _ in range(node_n - 1): i, j = tuple([in...
'''aizu 0309 http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0309 ''' # encoding: 'utf-8' N = 1000000007 def main(): node_n = int(input()) nodes = list() for _ in range(node_n): nodes.append(Node(input())) for _ in range(node_n - 1): i, j = tuple([int(x) for x in input().split...
s546925205
s322953082
p00304
python
Runtime Error
'''aizu 0309 http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0309 ''' # encoding: 'utf-8' N = 1000000007 def main(): '''main func. ''' node_n = int(input()) nodes = list() for _ in range(node_n): nodes.append(Node(input())) for _ in range(node_n - 1): i, j = tuple([in...
'''aizu 0309 http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0309 ''' # encoding: 'utf-8' N = 1000000007 def main(): node_n = int(input()) nodes = list() for _ in range(node_n): nodes.append(Node(input())) for _ in range(node_n - 1): i, j = tuple([int(x) for x in input().split...
s336360978
s322953082
p00304
python
Runtime Error
'''aizu 0309 http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0309 ''' # encoding: 'utf-8' import sys from math import log10 N = 1000000007 LOGN = 9 def main(): '''main func. ''' node_n = int(input()) nodes = list() for _ in range(node_n): nodes.append(Node(input())) for _ in...
'''aizu 0309 http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0309 ''' # encoding: 'utf-8' N = 1000000007 def main(): node_n = int(input()) nodes = list() for _ in range(node_n): nodes.append(Node(input())) for _ in range(node_n - 1): i, j = tuple([int(x) for x in input().split...
s696860560
s322953082
p00304
python
Runtime Error
'''aizu 0309 http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0309 ''' # encoding: 'utf-8' from math import log10 N = 1000000007 LOGN = 9 def main(): '''main func. ''' node_n = int(input()) nodes = list() for _ in range(node_n): nodes.append(Node(input())) for _ in range(node...
'''aizu 0309 http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0309 ''' # encoding: 'utf-8' N = 1000000007 def main(): node_n = int(input()) nodes = list() for _ in range(node_n): nodes.append(Node(input())) for _ in range(node_n - 1): i, j = tuple([int(x) for x in input().split...
s431655351
s322953082
p00304
python
Runtime Error
'''aizu 0309 http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0309 ''' # encoding: 'utf-8' N = 1000000007 def main(): '''main func. ''' node_n = int(input()) nodes = list() for _ in range(node_n): nodes.append(Node(input())) for _ in range(node_n - 1): i, j = tuple([in...
'''aizu 0309 http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0309 ''' # encoding: 'utf-8' N = 1000000007 def main(): node_n = int(input()) nodes = list() for _ in range(node_n): nodes.append(Node(input())) for _ in range(node_n - 1): i, j = tuple([int(x) for x in input().split...
s601081368
s322953082
p00304
python
Runtime Error
'''aizu 0309 http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0309 ''' # encoding: 'utf-8' N = 1000000007 def main(): '''main func. ''' node_n = int(input()) nodes = list() for _ in range(node_n): nodes.append(Node(input())) for _ in range(node_n - 1): i, j = tuple([in...
'''aizu 0309 http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0309 ''' # encoding: 'utf-8' N = 1000000007 def main(): node_n = int(input()) nodes = list() for _ in range(node_n): nodes.append(Node(input())) for _ in range(node_n - 1): i, j = tuple([int(x) for x in input().split...
s878879958
s322953082
p00304
python
Runtime Error
# encoding: 'utf-8' N = int(input()) ls = list() for _ in range(N): e = sorted([int(x) for x in split(input())]) if e in ls: continue else: ls.append(e) print(N - len(ls))
# encoding: 'utf-8' N = int(input()) ls = list() for _ in range(N): e = sorted([int(x) for x in input().split()]) if e in ls: continue else: ls.append(e) print(N - len(ls))
s631700093
s887356184
p00334
python
Runtime Error
# encoding: "utf-8" class Unreachable(Exception): pass def main(): [n, q] = [int(x) for x in input().split()] setlist = list() for i in range(n): setlist.append(set(i)) for _ in range(q): run(setlist) def run(setlist): com, x, y = [int(x) for x in input().split()] if com...
# encoding: "utf-8" from enum import Enum class Unreachable(Exception): pass class Type(Enum): VAL = 0 PTR = 1 class Elem: def __init__(self, i, value, _type): self.idx = i self.value = value self.type = _type def set(self, value, _type): self.value = value ...
s381906799
s255512879
p02343
python
Runtime Error
# encoding: "utf-8" class Unreachable(Exception): pass def main(): n, q = [int(x) for x in input().split()] setlist = list() for i in range(n): setlist.append({i}) for _ in range(q): run(setlist) def run(setlist): com, x, y = [int(x) for x in input().split()] if com == 0...
# encoding: "utf-8" from enum import Enum class Unreachable(Exception): pass class Type(Enum): VAL = 0 PTR = 1 class Elem: def __init__(self, i, value, _type): self.idx = i self.value = value self.type = _type def set(self, value, _type): self.value = value ...
s121082045
s255512879
p02343
python
Time Limit Exceeded
# encoding: "utf-8" class Unreachable(Exception): pass def main(): n, q = [int(x) for x in input().split()] setlist = list() for i in range(n): setlist.append({i}) commands = list() for _ in range(q): com, x, y = [int(x) for x in input().split()] commands.append((com, ...
# encoding: "utf-8" from enum import Enum class Unreachable(Exception): pass class Type(Enum): VAL = 0 PTR = 1 class Elem: def __init__(self, i, value, _type): self.idx = i self.value = value self.type = _type def set(self, value, _type): self.value = value ...
s831674992
s255512879
p02343
python
Time Limit Exceeded
# encoding: "utf-8" class Unreachable(Exception): pass def main(): n, q = [int(x) for x in input().split()] setlist = list() for i in range(n): setlist.append({i}) commands = list() for _ in range(q): com, x, y = [int(x) for x in input().split()] commands.append((com, ...
# encoding: "utf-8" from enum import Enum class Unreachable(Exception): pass class Type(Enum): VAL = 0 PTR = 1 class Elem: def __init__(self, i, value, _type): self.idx = i self.value = value self.type = _type def set(self, value, _type): self.value = value ...
s733716725
s255512879
p02343
python
Time Limit Exceeded
# encoding: "utf-8" class Unreachable(Exception): pass class SetManager: def __init__(self, n): self.data = list() for i in range(n): self.data.append((i, {i})) def ref(self, i): return self.data[i][1] def set(self, i, value): self.data[i] = (i, value) ...
# encoding: "utf-8" from enum import Enum class Unreachable(Exception): pass class Type(Enum): VAL = 0 PTR = 1 class Elem: def __init__(self, i, value, _type): self.idx = i self.value = value self.type = _type def set(self, value, _type): self.value = value ...
s723660516
s255512879
p02343
python
Runtime Error
# encoding: "utf-8" class Unreachable(Exception): pass class SetManager: def __init__(self, n): self.data = list() for i in range(n): self.data.append((i, {i})) def ref(self, i): return self.data[i][1] def set(self, i, value): self.data[i] = (i, value) ...
# encoding: "utf-8" from enum import Enum class Unreachable(Exception): pass class Type(Enum): VAL = 0 PTR = 1 class Elem: def __init__(self, i, value, _type): self.idx = i self.value = value self.type = _type def set(self, value, _type): self.value = value ...
s193760834
s255512879
p02343
python
Runtime Error
# encoding: "utf-8" class Unreachable(Exception): pass class SetManager: def __init__(self, n): self.data = list() for i in range(n): self.data.append((i, {i})) def ref(self, i): return self.data[i][1] def set(self, i, value): self.data[i] = (i, value) ...
# encoding: "utf-8" from enum import Enum class Unreachable(Exception): pass class Type(Enum): VAL = 0 PTR = 1 class Elem: def __init__(self, i, value, _type): self.idx = i self.value = value self.type = _type def set(self, value, _type): self.value = value ...
s290628805
s255512879
p02343
python
Runtime Error
a = input() b = input() print a*b
xs = map(int,raw_input().split()) a = xs[0] b = xs[1] print a*b, 2*(a+b)
s540931910
s748681930
p02389
python
Runtime Error
def aizu001 (): xs = map(int,raw_input().split()) a = xs[0] b = xs[1] if a > b: print "a > b" else if a < b: print "a < b" else : print "a == b"
def aizu001 (): xs = map(int,raw_input().split()) a = xs[0] b = xs[1] if a > b: print "a > b" elif a < b: print "a < b" else : print "a == b" aizu001()
s726402426
s059302951
p02391
python
Runtime Error
def aizu001 (): xs = map(int,raw_input().split()) a = xs[0] b = xs[1] if a > b: print "a > b" else if a < b: print "a < b" else : print "a == b" aizu001 ()
def aizu001 (): xs = map(int,raw_input().split()) a = xs[0] b = xs[1] if a > b: print "a > b" elif a < b: print "a < b" else : print "a == b" aizu001()
s328643464
s059302951
p02391
python
Runtime Error
import scipy as np def az18_2(): n,m = map(int,raw_input().split()) a = np.array([map(int, raw_input().split()) for i in range(n)]) b = np.array([input() for i in range(m)]) for i in range(n): print a.dot(b)[i] az18_2()
def az18(): n,m = map(int,raw_input().split()) a = [[0 for i in range(m)] for j in range(n)] b = [0 for i in range(m)] for i in range(n): a[i] = map(int,raw_input().split()) for i in range(m): b[i] = input() for i in range(n): t = map(lambda (x,y): x*y, zip(a[i],b)) ...
s875385985
s254178365
p02410
python
Runtime Error
import numpy as np def az18_2(): n,m = map(int,raw_input().split()) a = np.array([map(int, raw_input().split()) for i in range(n)]) b = np.array([input() for i in range(m)]) for i in range(n): print a.dot(b)[i] az18_2()
def az18(): n,m = map(int,raw_input().split()) a = [[0 for i in range(m)] for j in range(n)] b = [0 for i in range(m)] for i in range(n): a[i] = map(int,raw_input().split()) for i in range(m): b[i] = input() for i in range(n): t = map(lambda (x,y): x*y, zip(a[i],b)) ...
s185451583
s254178365
p02410
python
Runtime Error
#!/usr/bin/env python while 1: n=int(raw_input()) if n==0: break h1=map(int, raw_input().split()) for h in h1: h2=[ x for x in h1 if x!=h ] g=[ h2[i+1]-h2[i] for i in range(n-1) ] if len(set(g))==1: print h break
import sys,math for line in sys.stdin.readlines(): V=float(line.rstrip()) N=0 while 1: N+=1 v=9.8*math.sqrt((5*N-5)/4.9) if V-v<=0: break print N
s609442893
s019458110
p00024
python
Runtime Error
import sys for rec in sys.stdin.readlines(): while len(d)>1: tmp=[] for i in range(1,len(d)): tmp.append((d[i-1]+d[i])%10) d=tmp print d[0]
import sys for rec in sys.stdin.readlines(): d=map(int,list(rec.rstrip())) while len(d)>1: tmp=[] for i in range(1,len(d)): tmp.append((d[i-1]+d[i])%10) d=tmp print d[0]
s836237923
s242907176
p00062
python
Runtime Error
import re print sum(map(int,re.sub("\w+"," ",raw_input()).strip().split()))
import re, sys print sum(map(int,re.sub(r"[^\d]+",r" "," ".join(sys.stdin.readlines())).strip().split()))
s528257667
s309280168
p00064
python
Runtime Error
import re, sys print sum(map(int,re.sub("\w+|\s+"," ",sys.stdin.readlines()).strip().split()))
import re, sys print sum(map(int,re.sub(r"[^\d]+",r" "," ".join(sys.stdin.readlines())).strip().split()))
s703828572
s309280168
p00064
python
Runtime Error
import re, sys print sum(map(int,re.sub("[^\d]+"," ",sys.stdin.readlines()).strip().split()))
import re, sys print sum(map(int,re.sub(r"[^\d]+",r" "," ".join(sys.stdin.readlines())).strip().split()))
s082088469
s309280168
p00064
python
Runtime Error
#!/usr/bin/env python while 1: n=int(raw_input()) if n==0: break h1=map(int, raw_input().split()) for h in h1: h2=[ x for x in h1 if x!=h ] g=[ h2[i+1]-h2[i] for i in range(n-1) ] if len(set(g))==1: print h break
#!/usr/bin/env python while 1: n=int(raw_input()) if n==0: break grass=map(int, raw_input().split()) for i in range(n+1): h=[ x for j,x in enumerate(grass) if i!=j ] g=[ h[j+1]-h[j] for j in range(len(h)-1) ] if len(set(g))==1: print grass[i] break
s557247682
s619724139
p00253
python
Runtime Error
#!/usr/bin/env python while 1: n=int(raw_input()) if n==0: break h1=map(int, raw_input().split()) for h in h1: h2=[ x for x in h1 if x!=h ] g=[ h2[i+1]-h2[i] for i in range(n-1) ] if len(set(g))==1: print h break
#!/usr/bin/env python while 1: n=int(raw_input()) if n==0: break grass=map(int, raw_input().split()) for i in range(n+1): h=[ x for j,x in enumerate(grass) if i!=j ] g=[ h[j+1]-h[j] for j in range(len(h)-1) ] if len(set(g))==1: print grass[i] break
s391154981
s619724139
p00253
python
Runtime Error
#!/usr/bin/env python while 1: try: n=int(raw_input()) if n==0: break h1=map(int, raw_input().split()) for h in h1: h2=[ x for x in h1 if x!=h ] g=[ h2[i+1]-h2[i] for i in range(n-1) ] if len(set(g))==1: print h brea...
#!/usr/bin/env python while 1: n=int(raw_input()) if n==0: break grass=map(int, raw_input().split()) for i in range(n+1): h=[ x for j,x in enumerate(grass) if i!=j ] g=[ h[j+1]-h[j] for j in range(len(h)-1) ] if len(set(g))==1: print grass[i] break
s794402669
s619724139
p00253
python
Runtime Error
#!/usr/bin/env python while 1: try: n=int(raw_input()) if n==0: break h1=map(int, raw_input().split()) for h in h1: h2=[ x for x in h1 if x!=h ] g=[ h2[i+1]-h2[i] for i in range(n-1) ] if len(set(g))==1: print h brea...
#!/usr/bin/env python while 1: n=int(raw_input()) if n==0: break grass=map(int, raw_input().split()) for i in range(n+1): h=[ x for j,x in enumerate(grass) if i!=j ] g=[ h[j+1]-h[j] for j in range(len(h)-1) ] if len(set(g))==1: print grass[i] break
s090833057
s619724139
p00253
python
Runtime Error
for line in sys.stdin.readlines(): print sum(map(int,line.rstrip().split()))
import sys for line in sys.stdin.readlines(): print sum(map(int,line.rstrip().split()))
s764970873
s175171848
p00586
python
Runtime Error
n, m = map(int, raw_input().split()) c = map(int, raw_input().split()) INF = 1000000000 t = [INF] * n t[0] = 0 for i in range(m): # print(c[i]) for j in range(c[i], n): t[j] = min([t[j], t[j - c[i]] + 1]) # print(t) print(t[n - 1]) ~
n, m = map(int, raw_input().split()) c = map(int, raw_input().split()) INF = 1000000000 t = [INF] * (n + 1) t[0] = 0 for i in range(m): for j in range(c[i], n + 1): t[j] = min([t[j], t[j - c[i]] + 1]) print(t[n])
s517835086
s040263733
p02314
python
Runtime Error
while 1: a,op,b=raw_input().split() if(a==b=='0' and op=='?'): break a,b=map(int,[a,b]) ans=0 if op=='+': ans=a+b elif op=='-': ans=a-b elif op=='*': ans=a*b elif op=='/': ans=a/b print ans
while 1: a,op,b=raw_input().split() if(op=='?'): break a,b=map(int,[a,b]) ans=0 if op=='+': ans=a+b elif op=='-': ans=a-b elif op=='*': ans=a*b elif op=='/': ans=a/b print ans
s561455222
s178054480
p02401
python
Runtime Error
while 1: m,f,r=map(int,raw_input().split()) ans='' if m==0 or f==0: ans='F' elif 80<=m+f: ans='A' elif 65<=m+f: ans='B' elif 60<=m+f: ans='C' elif 30<=m+f: if 50<=r: ans='C' else: ans='D' else: ans='C' print ans
while 1: m,f,r=map(int,raw_input().split()) if m==f==r==-1: break ans='' if m==-1 or f==-1: ans='F' elif 80<=m+f: ans='A' elif 65<=m+f: ans='B' elif 50<=m+f: ans='C' elif 30<=m+f: if 50<=r: ans='C' else: ans='D' else: ans='F' print ans
s555514530
s373967347
p02497
python
Runtime Error
input() print " ".join(sorted(map(int,raw_input().split())))
input() print " ".join(map(str,sorted(map(int,raw_input().split()))))
s175958259
s981891702
p02528
python
Runtime Error
n=input() S=set([map(int,raw_input().split())]) q=input() T=set([map(int,raw_input().split())]) print len(S&T)
n=input() S=set(map(int,raw_input().split())) q=input() T=set(map(int,raw_input().split())) print len(S&T)
s816564704
s600389479
p02529
python
Runtime Error
while 1: n = int(raw_input()) if n == 0: break dp = [[0] * n for i in range(n)] r = 0 for i in range(n): for j, ch in enumerate(raw_input()): if ch == '*': continue dp[i][j] = 1 if i >= 1 or j >= 1: for k in range(1,...
while 1: n = int(raw_input()) if n == 0: break dp = [[0] * n for i in range(n)] r = 0 for i in range(n): for j, ch in enumerate(raw_input()): if ch == '*': continue dp[i][j] = 1 if i >= 1 or j >= 1: dp[i][j] += min(d...
s528537854
s671695776
p00092
python
Time Limit Exceeded
import numpy as np n = input() n = int(n) a = input() a = a.split() a = [int(x) for x in a] q = input() q = int(q) ms = input() ms = ms.split() ms = [int(x) for x in ms] np.sort(a) a = np.array(a) for m in ms: if m > a[-1]: print("no") elif a.any()==m: print("yes") else: a_new = a...
import re from itertools import product import itertools q1 = int(input()) q2 = input() q3 = int(input()) q4 = input() S = re.split(r' ',q2) S=list(map(int, S)) T = re.split(r' ',q4) T=list(map(int, T)) S_len = len(S) T_len = len(T) array = [] for j in range(q1+1): x = list(itertools.combinations(S, j)) fo...
s552551361
s316531756
p02271
python
Runtime Error
flag = [False] * 53 n = int(input()) for i in range(n): c, n = map(str, input().split()) n = int(n) if(c == "S"): flag[n] = True elif(c == "H"): flag[13 + n] = True elif(c == "C"): flag[26 + n] = True else: flag[39 + n] = True suit = ["S", "H", "C", "D"] for i in ...
flag = [False] * 53 n = int(input()) for i in range(n): c, n = map(str, input().split()) n = int(n) if(c == "S"): flag[n] = True elif(c == "H"): flag[13 + n] = True elif(c == "C"): flag[26 + n] = True else: flag[39 + n] = True suit = ["S", "H", "C", "D"] for i in ...
s398769415
s827638182
p02408
python
Runtime Error
n = input() S = list(map(int, input().split())) q = input() T = list(map(int, input().split())) cnt = 0 for i in range(len(T)): if S.count(T[i]) >= 1: cnt += 1 print(cnt)
_ = input() S = set(input().split()) _ = input() T = set(input().split()) print(len(S & T))
s606791142
s486040273
p02526
python
Time Limit Exceeded
def checker(x1,y1,x2,y2,xp,yp): vec = (x2 - x1) * (yp - y1) - (y2 - y1) * (xp - x1) if vec > 0: return 1 elif vec < 0: return -1 while True: try: x1,y1,x2,y2,x3,y3,xp,yp = map(float,raw_input().split()) except EOFError: break r = checker(x1,y1,x2,y2,xp,yp) r += checker(x2, y2, x3, y3, xp, yp) r += chec...
def checker(x1,y1,x2,y2,xp,yp): r = 0 vec = (x2 - x1) * (yp - y1) - (y2 - y1) * (xp - x1) if vec > 0: r = 1 elif vec < 0: r = -1 return r if __name__ == '__main__': while True: try: x1,y1,x2,y2,x3,y3,xp,yp = map(float,raw_input().split()) r = 0 r += int(checker(x1,y1,x2,y2,xp,yp)) r += int(chec...
s652883535
s964238381
p00012
python
Runtime Error
def checker(x1,y1,x2,y2,xp,yp): vec = (x2 - x1) * (yp - y1) - (y2 - y1) * (xp - x1) if vec > 0: return 1 elif vec < 0: return -1 while True: try: x1,y1,x2,y2,x3,y3,xp,yp = map(float,raw_input().split()) r = checker(x1,y1,x2,y2,xp,yp) r += checker(x2, y2, x3, y3, xp, yp) r += checker(x3, y3, x1, y1, xp,...
def checker(x1,y1,x2,y2,xp,yp): r = 0 vec = (x2 - x1) * (yp - y1) - (y2 - y1) * (xp - x1) if vec > 0: r = 1 elif vec < 0: r = -1 return r if __name__ == '__main__': while True: try: x1,y1,x2,y2,x3,y3,xp,yp = map(float,raw_input().split()) r = 0 r += int(checker(x1,y1,x2,y2,xp,yp)) r += int(chec...
s952262433
s964238381
p00012
python
Runtime Error
def checker(x1,y1,x2,y2,xp,yp): vec = (x2 - x1) * (yp - y1) - (y2 - y1) * (xp - x1) if vec > 0: return 1 elif vec < 0: return -1 while True: try: x1,y1,x2,y2,x3,y3,xp,yp = map(float,raw_input().split()) r = checker(x1,y1,x2,y2,xp,yp) r += checker(x2, y2, x3, y3, xp, yp) r += checker(x3, y3, x1, y1, xp,...
def checker(x1,y1,x2,y2,xp,yp): r = 0 vec = (x2 - x1) * (yp - y1) - (y2 - y1) * (xp - x1) if vec > 0: r = 1 elif vec < 0: r = -1 return r if __name__ == '__main__': while True: try: x1,y1,x2,y2,x3,y3,xp,yp = map(float,raw_input().split()) r = 0 r += int(checker(x1,y1,x2,y2,xp,yp)) r += int(chec...
s981092847
s964238381
p00012
python
Runtime Error
global r def checker(x1,y1,x2,y2,xp,yp): vec = (x2 - x1) * (yp - y1) - (y2 - y1) * (xp - x1) if vec > 0: return 1 elif vec < 0: return -1 while True: try: x1,y1,x2,y2,x3,y3,xp,yp = map(float,raw_input().split()) r = 0 r = r + checker(x1,y1,x2,y2,xp,yp) r = r + checker(x2, y2, x3, y3, xp, yp) r = r +...
def checker(x1,y1,x2,y2,xp,yp): r = 0 vec = (x2 - x1) * (yp - y1) - (y2 - y1) * (xp - x1) if vec > 0: r = 1 elif vec < 0: r = -1 return r if __name__ == '__main__': while True: try: x1,y1,x2,y2,x3,y3,xp,yp = map(float,raw_input().split()) r = 0 r += int(checker(x1,y1,x2,y2,xp,yp)) r += int(chec...
s089369479
s964238381
p00012
python
Runtime Error
global r def checker(x1,y1,x2,y2,xp,yp): vec = (x2 - x1) * (yp - y1) - (y2 - y1) * (xp - x1) if vec > 0: return int(1) elif vec < 0: return int(-1) while True: try: x1,y1,x2,y2,x3,y3,xp,yp = map(float,raw_input().split()) r = 0 r += checker(x1,y1,x2,y2,xp,yp) print r r += checker(x2, y2, x3, y3, xp,...
def checker(x1,y1,x2,y2,xp,yp): r = 0 vec = (x2 - x1) * (yp - y1) - (y2 - y1) * (xp - x1) if vec > 0: r = 1 elif vec < 0: r = -1 return r if __name__ == '__main__': while True: try: x1,y1,x2,y2,x3,y3,xp,yp = map(float,raw_input().split()) r = 0 r += int(checker(x1,y1,x2,y2,xp,yp)) r += int(chec...
s591932173
s964238381
p00012
python
Runtime Error
global r def checker(x1,y1,x2,y2,xp,yp): vec = (x2 - x1) * (yp - y1) - (y2 - y1) * (xp - x1) if vec > 0: return int(1) elif vec < 0: return int(-1) if __name__ == '__main__': while True: try: x1,y1,x2,y2,x3,y3,xp,yp = map(float,raw_input().split()) r = 0 r += checker(x1,y1,x2,y2,xp,yp) r += chec...
def checker(x1,y1,x2,y2,xp,yp): r = 0 vec = (x2 - x1) * (yp - y1) - (y2 - y1) * (xp - x1) if vec > 0: r = 1 elif vec < 0: r = -1 return r if __name__ == '__main__': while True: try: x1,y1,x2,y2,x3,y3,xp,yp = map(float,raw_input().split()) r = 0 r += int(checker(x1,y1,x2,y2,xp,yp)) r += int(chec...
s015256381
s964238381
p00012
python
Runtime Error
global r def checker(x1,y1,x2,y2,xp,yp): vec = (x2 - x1) * (yp - y1) - (y2 - y1) * (xp - x1) if vec > 0: return int(1) elif vec < 0: return int(-1) if __name__ == '__main__': while True: try: x1,y1,x2,y2,x3,y3,xp,yp = map(float,raw_input().split()) r = 0 r += int(checker(x1,y1,x2,y2,xp,yp)) r +=...
def checker(x1,y1,x2,y2,xp,yp): r = 0 vec = (x2 - x1) * (yp - y1) - (y2 - y1) * (xp - x1) if vec > 0: r = 1 elif vec < 0: r = -1 return r if __name__ == '__main__': while True: try: x1,y1,x2,y2,x3,y3,xp,yp = map(float,raw_input().split()) r = 0 r += int(checker(x1,y1,x2,y2,xp,yp)) r += int(chec...
s319878761
s964238381
p00012
python
Runtime Error
def checker(x1,y1,x2,y2,xp,yp): r = 0 vec = (x2 - x1) * (yp - y1) - (y2 - y1) * (xp - x1) if vec > 0: r = 1 return r elif vec < 0: r = -1 return r if __name__ == '__main__': while True: try: x1,y1,x2,y2,x3,y3,xp,yp = map(float,raw_input().split()) r = 0 r += int(checker(x1,y1,x2,y2,xp,yp)) r...
def checker(x1,y1,x2,y2,xp,yp): r = 0 vec = (x2 - x1) * (yp - y1) - (y2 - y1) * (xp - x1) if vec > 0: r = 1 elif vec < 0: r = -1 return r if __name__ == '__main__': while True: try: x1,y1,x2,y2,x3,y3,xp,yp = map(float,raw_input().split()) r = 0 r += int(checker(x1,y1,x2,y2,xp,yp)) r += int(chec...
s336716975
s964238381
p00012
python
Runtime Error
l = [] while True: try: train = int(raw_input()) if train == 0: print(l.pop()) else: l.append(train) except EOFError: break
l = [] while True: try: train = raw_input() if train == '0': print(l.pop()) else: l.append(train) except EOFError: break
s913346033
s692526933
p00013
python
Runtime Error
alphabet = [chr(i) for i in range(ord('a'), ord('z')+1)] s = "" while True: n = raw_input().lower() if n == "": break s += n for i in range(26): count = s.count(alphabet[i]) print("{0} : {1}").format(alphabet[i],count)
alphabet = [chr(i) for i in range(ord('a'), ord('z')+1)] s = "" while True: try: s += raw_input().lower() except EOFError: break for i in range(26): count = s.count(alphabet[i]) print("{0} : {1}").format(alphabet[i],count)
s225948721
s649191726
p02499
python
Runtime Error
n = (int)(raw_input()) s = map(int,raw_input().split()) q = (int)(raw_input()) t = map(int,raw_input().split()) count = 0 for i in range(q): for j in range(n): if t[i] == s[j]: count += 1 break print(count)
n = (int)(raw_input()) s = set(map(int,raw_input().split())) q = (int)(raw_input()) t = set(map(int,raw_input().split())) count = 0 print(len(s.intersection(t)))
s071118348
s174940532
p02526
python
Time Limit Exceeded
a = input() b = input() print a**b+" "+2*a+2*b
a, b = map(int, raw_input().split(" ")) print a*b, (a+b)*2
s374972414
s603982786
p02481
python
Runtime Error
a, b = map(raw_input().split(" ")) print a*b, (a+b)*2
a, b = map(int, raw_input().split(" ")) print a*b, (a+b)*2
s963643652
s603982786
p02481
python
Runtime Error
a, b = map(raw_input().split(' ')) print a*b, (a+b)*2
a, b = map(int, raw_input().split(" ")) print a*b, (a+b)*2
s455194822
s603982786
p02481
python
Runtime Error
x = map(int, raw_input().split(" ")) x.sort() for i x x_last print x[i]
x = map(int, raw_input().split(" ")) x.sort() for i in x: print i,
s494202656
s739643115
p02483
python
Runtime Error
while True: try: nums = map(int, raw_input().split(' ')) ans = nums[0]+nums[1] x = 0 while True: if (10**x -1) < ans < 10**(x+1): print x+1 break else: x = x+1 except EOFerror: bre...
while True: try: nums = map(int, raw_input().split(' ')) ans = nums[0]+nums[1] x = 0 while True: if (10**x -1) < ans < 10**(x+1): print x+1 break else: x = x+1 except EOFError: break...
s834263646
s495645666
p00002
python
Runtime Error
while True: a = map(float, raw_input().split(' ')) if a[1]*a[3]-a[0]*a[4] == 0: print 'No answer' else: x = (a[1]*a[5]-a[2]*a[4])/(a[1]*a[3]-a[0]*a[4]) y = (a[2]*a[3]-a[0]*a[5])/(a[1]*a[3]-a[0]*a[4]) print '%.3f %.3f ' % (x,y)
while True: try: a = map(float, raw_input().split(' ')) x = (a[1]*a[5]-a[2]*a[4])/(a[1]*a[3]-a[0]*a[4]) y = (a[2]*a[3]-a[0]*a[5])/(a[1]*a[3]-a[0]*a[4]) if x == 0: x = abs(x) if y == 0: y = abs(y) print '%.3f %.3f' % (x,y) except EOFError: ...
s598512375
s809019642
p00004
python
Runtime Error
while True: a = map(float, raw_input().split(' ')) if a[1]*a[3]-a[0]*a[4] == 0: print 'No answer' else: x = (a[1]*a[5]-a[2]*a[4])/(a[1]*a[3]-a[0]*a[4]) y = (a[2]*a[3]-a[0]*a[5])/(a[1]*a[3]-a[0]*a[4]) if x == 0: x = abs(x) if y == 0: y = abs(y) ...
while True: try: a = map(float, raw_input().split(' ')) x = (a[1]*a[5]-a[2]*a[4])/(a[1]*a[3]-a[0]*a[4]) y = (a[2]*a[3]-a[0]*a[5])/(a[1]*a[3]-a[0]*a[4]) if x == 0: x = abs(x) if y == 0: y = abs(y) print '%.3f %.3f' % (x,y) except EOFError: ...
s715293989
s809019642
p00004
python
Runtime Error
while True: a = map(float, raw_input().split(' ')) x = (a[1]*a[5]-a[2]*a[4])/(a[1]*a[3]-a[0]*a[4]) y = (a[2]*a[3]-a[0]*a[5])/(a[1]*a[3]-a[0]*a[4]) if x == 0: x = abs(x) if y == 0: y = abs(y) print '%.3f %.3f ' % (x,y)
while True: try: a = map(float, raw_input().split(' ')) x = (a[1]*a[5]-a[2]*a[4])/(a[1]*a[3]-a[0]*a[4]) y = (a[2]*a[3]-a[0]*a[5])/(a[1]*a[3]-a[0]*a[4]) if x == 0: x = abs(x) if y == 0: y = abs(y) print '%.3f %.3f' % (x,y) except EOFError: ...
s786587056
s809019642
p00004
python
Runtime Error
while True: try: x = int(raw_input()) count = 0 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 == x : count += 1 ...
while True: try: x = input() count = 0 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 == x : count += 1 print c...
s299089078
s851096369
p00008
python
Runtime Error
num =input() YN = [] for i in range(num): x = map(float, raw_input().split(' ')) if (x[0]-x[2])/(x[1]-x[3]) == (x[4]-x[6])/(x[5]-x[7]): YN.append('YES') else: YN.append('NO') for i in YN: print i
num =input() for i in range(num): x = map(float, raw_input().split(' ')) if x[1]-x[3] == 0 or x[5]-x[7] == 0: if x[1]-x[3] == 0 and x[5]-x[7] == 0: print 'YES' else: print 'NO' elif (x[0]-x[2])/(x[1]-x[3]) == (x[4]-x[6])/(x[5]-x[7]): print 'YES' ...
s966476429
s328771284
p00021
python
Runtime Error
num =input() for i in range(num): x = map(float, raw_input().split(' ')) if (x[0]-x[2])/(x[1]-x[3]) == (x[4]-x[6])/(x[5]-x[7]): print 'YES' else: print 'NO'
num =input() for i in range(num): x = map(float, raw_input().split(' ')) if x[1]-x[3] == 0 or x[5]-x[7] == 0: if x[1]-x[3] == 0 and x[5]-x[7] == 0: print 'YES' else: print 'NO' elif (x[0]-x[2])/(x[1]-x[3]) == (x[4]-x[6])/(x[5]-x[7]): print 'YES' ...
s305247146
s328771284
p00021
python
Runtime Error
num =input() for i in range(num): x = map(float, raw_input().split(' ')) if x[1]-x[3] == 0 or x[1]-x[3] == 0: if x[1]-x[3] == 0 and x[1]-x[3] == 0: print 'YES' elif: print 'NO' elif (x[0]-x[2])/(x[1]-x[3]) == (x[4]-x[6])/(x[5]-x[7]): print 'YES' ...
num =input() for i in range(num): x = map(float, raw_input().split(' ')) if x[1]-x[3] == 0 or x[5]-x[7] == 0: if x[1]-x[3] == 0 and x[5]-x[7] == 0: print 'YES' else: print 'NO' elif (x[0]-x[2])/(x[1]-x[3]) == (x[4]-x[6])/(x[5]-x[7]): print 'YES' ...
s980758188
s328771284
p00021
python
Runtime Error
num =input() for i in range(num): x = map(float, raw_input().split(' ')) if x[1]-x[3] == 0 or x[5]-x[7] == 0: if x[1]-x[3] == 0 and x[5]-x[7] == 0: print 'YES' elif: print 'NO' elif (x[0]-x[2])/(x[1]-x[3]) == (x[4]-x[6])/(x[5]-x[7]): print 'YES' ...
num =input() for i in range(num): x = map(float, raw_input().split(' ')) if x[1]-x[3] == 0 or x[5]-x[7] == 0: if x[1]-x[3] == 0 and x[5]-x[7] == 0: print 'YES' else: print 'NO' elif (x[0]-x[2])/(x[1]-x[3]) == (x[4]-x[6])/(x[5]-x[7]): print 'YES' ...
s247290506
s328771284
p00021
python
Runtime Error
while True: try: listA = map(int,raw_input().split(' ')) listB = map(int,raw_input().split(' ')) hit=0 blw=0 for tB in listB: if (tB in listA) and (listB.index(tB) == listA.index(tB)): hit += 1 elif (tB in listA) and (listB.index(tB) ...
while True: try: listA = map(str,raw_input().split(' ')) listB = map(str,raw_input().split(' ')) hit=0 blw=0 for tB in listB: if (tB in listA) and (listB.index(tB) == listA.index(tB)): hit += 1 elif (tB in listA) and (listB.index(tB) ...
s731079671
s080158742
p00025
python
Runtime Error
dates = [] youbi = [] for i in range(1,13): if i == 1 or i == 3 or i == 5 or i == 7 or i == 8 or i == 10 or i == 12: for j in range(1,32): dates.append([i,j]) elif i == 4 or i == 6 or i == 9 or i == 11: for j in range(1,31): dates.append([i,j]) elif i == 2: ...
dates = [] youbi = [] for i in range(1,13): if i == 1 or i == 3 or i == 5 or i == 7 or i == 8 or i == 10 or i == 12: for j in range(1,32): dates.append([i,j]) elif i == 4 or i == 6 or i == 9 or i == 11: for j in range(1,31): dates.append([i,j]) elif i == 2: ...
s032750763
s118640094
p00027
python
Runtime Error
while True: array = map(str,raw_input()) display = [] for i in range(len(array)): if array[i] != '@': display.append(array[i]) elif array[i] == '@': insert = int(array[i+1])*array[i+2] display.append(insert) array[i+1] ,array[i+2]= '','' ...
while True: try: array = map(str,raw_input()) display = [] for i in range(len(array)): if array[i] != '@': display.append(array[i]) elif array[i] == '@': insert = int(array[i+1])*array[i+2] display.append(insert) ...
s039526312
s734166384
p00077
python
Runtime Error
import math def third(n,q): n = int(n) q = float(q) if n == 1: return q/2 else : return third(n-1,q)- (third(n-1,q)**3-q)/(3*third(n-1,q)**2) kai = [] while(True): try: q = input() if q == -1: for ka in kai: print ka break elif q != -...
while(True): try: q = input() if q == -1: break else : q = float(q) x = q/2 while (abs(q-x**3) >= 0.00001*q): x = x- (x**3-q)/(3*x**2) print '{:.6f}'.format(x) except EOFError: break
s778385523
s912138709
p00080
python
Time Limit Exceeded
def third(n,q): n = int(n) q = float(q) if n == 1: return q/2 else : return third(n-1,q)- (third(n-1,q)**3-q)/(3*third(n-1,q)**2) kai = [] while(True): try: q = input() if q == -1: break else : n = 1 q = float(q) while (abs(...
while(True): try: q = input() if q == -1: break else : q = float(q) x = q/2 while (abs(q-x**3) >= 0.00001*q): x = x- (x**3-q)/(3*x**2) print '{:.6f}'.format(x) except EOFError: break
s171443563
s912138709
p00080
python
Time Limit Exceeded
x = map(int, raw_input().split(" ") print x[0]+x[1]
while True: try: x = map(int, raw_input().split(" ")) print x[0]+x[1] except EOFError: break
s332733171
s471147463
p00586
python
Runtime Error
import sys for line in sys.stdin n =map(int,line.split()) a = n[0]+n[1] print line(str(a))
import sys for line in sys.stdin: n =map(int,line.split()) a = n[0]+n[1] print len(str(a))
s883789488
s270629660
p00002
python
Runtime Error
import sys for line in sys.stdin n =map(int,line.split()) a = n[0]+n[1] print len(str(a))
import sys for line in sys.stdin: n =map(int,line.split()) a = n[0]+n[1] print len(str(a))
s017421255
s270629660
p00002
python
Runtime Error
e True: try: a = map(long,raw_input().split()) m = a[0]*a[4]-a[1]*a[3] x = (a[4]*a[2] - a[1]*a[5])/m y = (a[0]*a[5] - a[2]*a[3])/m if x == -0: x = 0 if y == -0: y = 0 print "%.3f %.3f" % (x,y) except EOFError: break
while True: try: a = map(float,raw_input().split()) m = a[0]*a[4]-a[1]*a[3] x = (a[4]*a[2] - a[1]*a[5])/m y = (a[0]*a[5] - a[2]*a[3])/m if x == -0: x = 0 if y == -0: y = 0 print "%.3f %.3f" % (x,y) except EOFError: break
s136531953
s660396868
p00004
python
Runtime Error
a = raw_input() [::-1] print a
a = raw_input() a = a[::-1] print a
s428031146
s675841697
p00006
python
Runtime Error
import math while True: try: g = 9.8 l = 4.9 v = float(raw_input()) t = v/g ...
while True: try: g = 9.8 l = 4.9 v = float(raw_input()) t = v/g y = l*(t)**2 ...
s319133460
s135765659
p00024
python
Runtime Error
nm = [0,31,29,31,30,31,30,31,31,30,31,30] while True: m,d = map(int,raw_input().split(" ")) if m == 0: break nd = 0 for i in range(m): nd += nm[i] ...
nm = [0,31,29,31,30,31,30,31,31,30,31,30] while True: m,d = map(int,raw_input().split(" ")) if m == 0: break else: nd = 0 for i in range(m): nd += nm[i] nd += d n = nd%7 if n == 1: print "Thursday" elif n == 2: pri...
s326302604
s504491910
p00027
python
Runtime Error
nm = [0,31,29,31,30,31,30,31,31,30,31,30] while True: m,d = map(int,raw_input().split(" ")) if m == 0: break nd = 0 for i in range(m): nd += nm[i] nd += d n = nd%7 if n == 1: print "Thursday" elif n == 2: print "Tryday" elif n == 3: print ...
nm = [0,31,29,31,30,31,30,31,31,30,31,30] while True: m,d = map(int,raw_input().split(" ")) if m == 0: break else: nd = 0 for i in range(m): nd += nm[i] nd += d n = nd%7 if n == 1: print "Thursday" elif n == 2: pri...
s608566709
s504491910
p00027
python
Runtime Error
nm = [0,31,29,31,30,31,30,31,31,30,31,30] while True: m,d = map(int,raw_input().split(" ")) if m == 0: break nd = 0 for i in range(m): nd += nm[i] nd += d n = nd%7 if n == 1: print "Thursday" elif n == 2: print "Friday" ...
nm = [0,31,29,31,30,31,30,31,31,30,31,30] while True: m,d = map(int,raw_input().split(" ")) if m == 0: break else: nd = 0 for i in range(m): nd += nm[i] nd += d n = nd%7 if n == 1: print "Thursday" elif n == 2: pri...
s655013966
s504491910
p00027
python
Runtime Error
nm = [0,31,29,31,30,31,30,31,31,30,31,30] while True: m,d = map(int,raw_input().split(" ")) if m == 0: break else: nd = 0 for i in range(m): ...
nm = [0,31,29,31,30,31,30,31,31,30,31,30] while True: m,d = map(int,raw_input().split(" ")) if m == 0: break else: nd = 0 for i in range(m): nd += nm[i] nd += d n = nd%7 if n == 1: print "Thursday" elif n == 2: pri...
s527616498
s504491910
p00027
python
Runtime Error
mport math def cal(x): a=10 y= [] for i in range(1,11): d= pow(2,(10-i)) if x>=d: x -= d y.append(d) return y if __name__ == "__main__": while True: try: a=int(raw_input()) b = cal(a) b.reverse() for...
import math def cal(x): y = [] for i in xrange(1,11): d= pow(2,(10-i)) if x>=d: x -= d y.append(d) return y if __name__ == "__main__": while True: try: b = cal(int(raw_input())) b.reverse() for i in b: ...
s184153847
s149732778
p00031
python
Runtime Error
while True: try: n = int(raw_input()) print (a**2+a+2)/2 except EOFError: break ~
while True: try: a = int(raw_input()) print (a**2+a+2)/2 except EOFError: break
s924347698
s105181872
p00057
python
Runtime Error