s_id
stringlengths
10
10
p_id
stringlengths
6
6
u_id
stringlengths
10
10
date
stringlengths
10
10
language
stringclasses
1 value
original_language
stringclasses
11 values
filename_ext
stringclasses
1 value
status
stringclasses
1 value
cpu_time
stringlengths
1
5
memory
stringlengths
1
7
code_size
stringlengths
1
6
code
stringlengths
1
539k
s041607742
p00207
u227162786
1490018860
Python
Python3
py
Runtime Error
0
0
1085
def dfs(x, y, m, v, W, H, xg, yg): ''' ''' v[y][x] = True for dx, dy in [(-1, 0), (1, 0), (0, -1), (0, 1)]: nx = x + dx ny = y + dy if nx in range(W) and ny in range(H) and m[ny][nx] == m[y][x] and v[ny][nx] == False: dfs(nx, ny, m, v, W, H, xg, yg) while True: H...
s092698653
p00207
u227162786
1490019105
Python
Python3
py
Runtime Error
0
0
1216
def dfs(x, y, m, v, W, H, xg, yg): ''' ''' v[y][x] = True for dx, dy in [(-1, 0), (1, 0), (0, -1), (0, 1)]: nx = x + dx ny = y + dy if nx in range(W) and ny in range(H) and m[ny][nx] == m[y][x] and v[ny][nx] == False: dfs(nx, ny, m, v, W, H, xg, yg) if __name__ == '_...
s090657938
p00207
u510797278
1504579063
Python
Python3
py
Runtime Error
0
0
1349
BLOCK_WIDTH = 4 BLOCK_HEIGHT = 2 field = [] dx = [-1, 0, 1, 0] dy = [0, 1, 0, -1] w = 0 h = 0 xg = 0 yg = 0 def main(): global field, w, h, xg, yg while True: w, h = map(int, input().split()) if w == 0 and h == 0: break xs, ys = map(int, input().split()) xg, yg = map...
s408923606
p00207
u510797278
1504582808
Python
Python3
py
Runtime Error
0
0
1349
BLOCK_WIDTH = 4 BLOCK_HEIGHT = 2 field = [] dx = [-1, 0, 1, 0] dy = [0, 1, 0, -1] w = 0 h = 0 xg = 0 yg = 0 def main(): global field, w, h, xg, yg while True: w, h = map(int, input().split()) if w == 0 and h == 0: break xs, ys = map(int, input().split()) xg, yg = map...
s789657511
p00207
u510797278
1504589441
Python
Python3
py
Runtime Error
0
0
1359
BLOCK_WIDTH = 4 BLOCK_HEIGHT = 2 field = [] dx = [-1, 0, 1, 0] dy = [0, 1, 0, -1] w = 0 h = 0 xg = 0 yg = 0 def main(): global field, w, h, xg, yg while True: w, h = map(int, input().split()) if w == 0 and h == 0: break xs, ys = map(int, input().split()) xg, yg = map...
s983644866
p00207
u633068244
1398939558
Python
Python
py
Runtime Error
0
0
84
B[y][x] = -1 check(B,x-1,y,c);check(B,x,y-1,c);check(B,x+1,y,c);check(B,x,y+1,c)
s802672130
p00207
u633068244
1398939570
Python
Python
py
Runtime Error
0
0
641
global B def check(B,x,y,c): if 0 < x < w+2 and 0 < y < h+2 and B[y][x] == c: B[y][x] = -1 check(B,x-1,y,c);check(B,x,y-1,c);check(B,x+1,y,c);check(B,x,y+1,c) while 1: w,h = map(int,raw_input().split()) if w == 0: break B = [[0]*(w+2) for i in range(h+2)] xs,ys = map(int,raw_input().split()) xg,yg = map(int,...
s700452548
p00207
u633068244
1398939596
Python
Python
py
Runtime Error
0
0
641
global B def check(B,x,y,c): if 0 < x < w+2 and 0 < y < h+2 and B[y][x] == c: B[y][x] = -1 check(B,x-1,y,c);check(B,x,y-1,c);check(B,x+1,y,c);check(B,x,y+1,c) while 1: w,h = map(int,raw_input().split()) if w == 0: break B = [[0]*(w+2) for i in range(h+2)] xs,ys = map(int,raw_input().split()) xg,yg = map(int,...
s165896795
p00208
u566872786
1512379166
Python
Python3
py
Runtime Error
0
0
67
while(1):print(oct(n)[2:].translate(str.maketrans('4567', '5789')))
s656682715
p00208
u531592024
1528988557
Python
Python3
py
Runtime Error
0
0
282
def ge(arr): for i in range(len(arr)): tmp = int(arr[i]) if tmp >= 4: tmp += 1 if tmp >= 6: tmp += 1 arr[i] = str(tmp) while True: n = int(input) if n == 0: break print("".join(ge(list(oct(n))[2:])))
s775166019
p00208
u870370075
1389355786
Python
Python
py
Runtime Error
0
0
700
inputlist=[] while 1: inputnum=int(raw_input()) if(inputnum==0):break inputlist.append(inputnum) def octnpower(num): flag=0 maxi=0 maxj=0 if(num<8): temp[0]=num return for i in range(1,11): for j in range(1,8): if(num>=(8**i)*j): flag=(8**i)*j maxi=i maxj=j else: temp[maxi]=maxj ...
s080357072
p00209
u633068244
1399116113
Python
Python
py
Runtime Error
0
0
776
while 1: n,m = map(int,raw_input().split()) if n == 0: break scene = [map(int,raw_input().split()) for i in range(n)] pic = [map(int,raw_input().split()) for i in range(m)] ans = "NA" for rot in range(4): for y in range(n-m): for x in range(n-m): flag = 0 for dy in range(m): for dx in range(m): ...
s461542242
p00209
u633068244
1399116320
Python
Python
py
Runtime Error
0
0
832
def getxy(pic): flag = 0 for dy in range(m): for dx in range(m): if pic[dy][dx] > -1: ans = str(x+dx+1)+" "+str(y+dy+1) flag = 1 break if flag == 1: break return ans while 1: n,m = map(int,raw_input().split()) if n == 0: break scene = [map(int,raw_input().split()) for i in range(n)] pic = [m...
s804027091
p00210
u858885710
1404010356
Python
Python
py
Runtime Error
0
0
1877
direction = {'N' : 0, 'E' : 1, 'S' : 2, 'W' : 3} step = [(-1, 0), (0, 1), (1, 0), (0, -1)] while True: W, H = map(int, raw_input().split()) if W == 0 and H == 0: break m = [None] * H for i in xrange(H): m[i] = list(raw_input()) people = [] for i in xrange(H): for j in xrange(W):...
s537808120
p00210
u858885710
1404017337
Python
Python
py
Runtime Error
0
0
1772
direction = {'N' : 0, 'E' : 1, 'S' : 2, 'W' : 3} step = [( -1, 0 ), ( 0, 1 ), ( 1, 0 ), ( 0, -1 )] while True: W, H = map( int, raw_input().split() ) if W == 0 and H == 0: break m = [ list( raw_input().split() ) for i in xrange( H ) ] people = [ ( i, j, direction[ m[i][j] ] ) for i in xrange( H ) for j...
s016028281
p00210
u858885710
1404022377
Python
Python
py
Runtime Error
0
0
1907
import sys direction = {'N' : 0, 'E' : 1, 'S' : 2, 'W' : 3} step = [( -1, 0 ), ( 0, 1 ), ( 1, 0 ), ( 0, -1 )] vv = [] while True: W, H = map( int, sys.stdin.readline().rstrip().split() ) if W == 0 and H == 0: break m = [ list( sys.stdin.readline().strip() ) for i in xrange( H ) ] people = [ ( i, j, di...
s535338685
p00210
u673933691
1404029626
Python
Python
py
Runtime Error
0
0
4995
import copy def hinan(): ans = [] while True: n = raw_input().split(" ") if n == ["0" ,"0"]: for an in ans: print an break elif len(n) == 2: xs = [] k = int(n[1]) for m in range(k): n = map(str,ra...
s909267724
p00210
u673933691
1404029800
Python
Python
py
Runtime Error
0
0
4995
import copy def hinan(): ans = [] while True: n = raw_input().split(" ") if n == ["0" ,"0"]: for an in ans: print an break elif len(n) == 2: xs = [] k = int(n[1]) for m in range(k): n = map(str,ra...
s730907477
p00210
u673933691
1404029861
Python
Python
py
Runtime Error
0
0
4995
import copy def hinan(): ans = [] while True: n = raw_input().split(" ") if n == ["0" ,"0"]: for an in ans: print an break elif len(n) == 2: xs = [] k = int(n[1]) for m in range(k): n = map(str,ra...
s254610284
p00210
u673933691
1404031789
Python
Python
py
Runtime Error
0
0
5532
import copy def hinan(): ans = [] while True: n = raw_input().split(" ") if n == ["0" ,"0"]: for an in ans: print an break elif len(n) == 2: xs = [] k = int(n[1]) for m in range(k): n = map(str,ra...
s087371571
p00210
u673933691
1404244109
Python
Python
py
Runtime Error
0
0
2173
def add(x ,y): return x + y def hinan(): ans ,houi ,vector = [] ,[[0 ,1] ,[-1 ,0] ,[0 ,-1] ,[1 ,0] ,[0 ,1] ,[-1 , 0] ,[1 ,0]] ,["E" ,"N" ,"W" ,"S"] while True: n = raw_input().split(" ") if n == ["0" ,"0"]: for an in ans: print an break else: ...
s762415947
p00210
u673933691
1404307505
Python
Python
py
Runtime Error
0
0
2038
def hinan(): ans ,houi ,vector = [] ,[[0 ,1] ,[-1 ,0] ,[0 ,-1] ,[1 ,0] ,[0 ,1] ,[-1 , 0] ,[1 ,0]] ,["E" ,"N" ,"W" ,"S"] while True: n = raw_input().split(" ") if n == ["0" ,"0"]: for an in ans: print an break else: xs =[[] ,[] ,[]] ...
s202528482
p00210
u673933691
1404390349
Python
Python
py
Runtime Error
0
0
2030
def hinan(): ans ,houi ,vector = [] ,[[0 ,1] ,[-1 ,0] ,[0 ,-1] ,[1 ,0] ,[0 ,1] ,[-1 , 0] ,[1 ,0]] ,["E" ,"N" ,"W" ,"S"] while True: n = raw_input().split(" ") if n == ["0" ,"0"]: for an in ans: print an break else: xs =[[] ,[] ,[]] ...
s894867641
p00210
u673933691
1404390464
Python
Python
py
Runtime Error
0
0
2005
def hinan(): ans ,houi ,vector = [] ,[[0 ,1] ,[-1 ,0] ,[0 ,-1] ,[1 ,0] ,[0 ,1] ,[-1 , 0] ,[1 ,0]] ,["E" ,"N" ,"W" ,"S"] while True: n = raw_input().split(" ") if n == ["0" ,"0"]: for an in ans: print an break else: xs =[[] ,[] ,[]] ...
s747172782
p00210
u567380442
1429154503
Python
Python3
py
Runtime Error
0
0
2453
from sys import stdin readline = stdin.readline from itertools import product N, W, S, E = (0, -1), (-1, 0), (0, 1), (1, 0) BLANK = ('.', 'X') DIRECTION = { 'N': N, 'W': W, 'S': S, 'E': E, } check_priority = { N: (E, N, W, S), W: (N, W, S, E), S: (W, S, E, N), E: (S, E, N, W), } s...
s666059391
p00210
u567380442
1429154746
Python
Python3
py
Runtime Error
0
0
2480
from sys import stdin readline = stdin.readline from itertools import product N, W, S, E = (0, -1), (-1, 0), (0, 1), (1, 0) BLANK = ('.', 'X') DIRECTION = { 'N': N, 'W': W, 'S': S, 'E': E, } check_priority = { N: (E, N, W, S), W: (N, W, S, E), S: (W, S, E, N), E: (S, E, N, W), } st...
s986576441
p00211
u873482706
1437133552
Python
Python
py
Runtime Error
0
0
926
import copy def main(): _data = copy.deepcopy(data) while 1 < len(_data): d1, v1 = _data[0] d2, v2 = _data[1] l = f1(v1, v2) v = l m1, m2 = list(f2(l, v1, v2)) d = f1(d1*m1, d2*m2) for i in range(2): del _data[0] _data.append([d, v]) else: ...
s163643900
p00211
u755162050
1475596406
Python
Python3
py
Runtime Error
0
0
992
def gcd(x, y): while y: x, y = y, x % y return x def lcm(x, y): l_lcm = (x * y) // gcd(x, y) return l_lcm def mul_lcm(array): l = lcm(array[0], array[1]) if len(array) > 3: for i in range(2, len(array)): l = lcm(array[i], l) return l def algorithm(students)...
s001230172
p00211
u755162050
1475596738
Python
Python3
py
Runtime Error
0
0
1185
""" Created by Jieyi on 10/4/16. """ import io import sys if len(sys.argv) > 1: filename = sys.argv[1] inp = ''.join(open(filename, "r").readlines()) sys.stdin = io.StringIO(inp) def gcd(x, y): while y: x, y = y, x % y return x def lcm(x, y): l_lcm = (x * y) // gcd(x, y) return...
s285909499
p00211
u755162050
1476538609
Python
Python3
py
Runtime Error
0
0
890
def lcm(x, y): return (x * y) / gcd(x, y) def mul_lcm(array): l = array[0] if len(array) > 1: for i in range(1, len(array)): l = lcm(array[i], l) return l def algorithm(students): denominator_lcm = mul_lcm([y for _, y in students]) for i in range(len(students)): ...
s218161754
p00211
u755162050
1476539075
Python
Python3
py
Runtime Error
0
0
1166
""" Created by Jieyi on 10/4/16. """ import io import sys from fractions import gcd if len(sys.argv) > 1: filename = sys.argv[1] inp = ''.join(open(filename, "r").readlines()) sys.stdin = io.StringIO(inp) def lcm(x, y): return (x * y) / gcd(x, y) def mul_lcm(array): l = array[0] if len(arra...
s193297547
p00211
u755162050
1476573933
Python
Python3
py
Runtime Error
0
0
1166
""" Created by Jieyi on 10/4/16. """ import io import sys from fractions import gcd if len(sys.argv) > 1: filename = sys.argv[1] inp = ''.join(open(filename, "r").readlines()) sys.stdin = io.StringIO(inp) def lcm(x, y): return (x * y) / gcd(x, y) def mul_lcm(array): l = array[0] if len(arra...
s860012703
p00211
u755162050
1476573989
Python
Python3
py
Runtime Error
0
0
973
from fractions import gcd def lcm(x, y): return (x * y) / gcd(x, y) def mul_lcm(array): l = array[0] if len(array) > 1: for i in range(1, len(array)): l = lcm(array[i], l) return l def algorithm(students, n): denominator_lcm = mul_lcm([y for _, y in students]) for i in ...
s349390968
p00211
u755162050
1476574085
Python
Python3
py
Runtime Error
0
0
1104
import math if len(sys.argv) > 1: filename = sys.argv[1] inp = ''.join(open(filename, "r").readlines()) sys.stdin = io.StringIO(inp) def lcm(x, y): return int((x * y) / math.gcd(x, y)) def mul_lcm(array): l = array[0] if len(array) > 1: for i in range(1, len(array)): l =...
s858854226
p00211
u755162050
1476574123
Python
Python3
py
Runtime Error
0
0
969
import math def lcm(x, y): return int((x * y) / math.gcd(x, y)) def mul_lcm(array): l = array[0] if len(array) > 1: for i in range(1, len(array)): l = lcm(array[i], l) return l def algorithm(students, n): denominator_lcm = mul_lcm([y for _, y in students]) for i in rang...
s040075929
p00211
u755162050
1476575309
Python
Python3
py
Runtime Error
0
0
974
import math def lcm(x, y): return int((x * y) / math.gcd(x, y)) def mul_lcm(array): l = array[0] if len(array) > 1: for i in range(1, len(array)): l = lcm(array[i], l) return l def algorithm(students, n): den = [students[i][1] for i in range(n)] denominator_lcm = mul_lc...
s873117096
p00211
u755162050
1476575540
Python
Python3
py
Runtime Error
0
0
1247
""" Created by Jieyi on 10/4/16. """ import io import sys import math if len(sys.argv) > 1: filename = sys.argv[1] inp = ''.join(open(filename, "r").readlines()) sys.stdin = io.StringIO(inp) def lcm(x, y): return int((x * y) / math.gcd(x, y)) def mul_lcm(array): l = array[0] if len(array) >...
s031195889
p00212
u874172052
1435216996
Python
Python
py
Runtime Error
0
0
1409
def express_bus(coupon,city,route,start,end): fare = {} adjacent = [] for i in range(route): s,t,cost = map(int,raw_input().split()) fare[s,t] = cost fare[t,s] = cost for i in range(1,city+1): adjacent.append([]) for j in fare: if i == j[0]: ...
s184500826
p00212
u685815919
1473841700
Python
Python
py
Runtime Error
0
0
1403
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...
s322100692
p00212
u672443148
1516968867
Python
Python3
py
Runtime Error
0
0
1074
from heapq import * while True: #input c,n,m,s,d & creating G #G[to,cost] c,n,m,s,d=map(int,input().split()) if c==n==m==s==d==0: break G=[[]] for i in range(n): G.append([]) for i in range(m): a,b,f=map(int,input().split()) G[a].append([b,f]) ...
s741676712
p00213
u567380442
1429189625
Python
Python3
py
Runtime Error
0
0
1871
from sys import stdin readline = stdin.readline from copy import deepcopy from collections import namedtuple Point = namedtuple('Point', ['x', 'y']) Memo = namedtuple('Memo', 'buyer lot x y') from itertools import product def placeable(lots, buyer, x, y, w, h): if x < 0 or len(lots[0]) < x + w or y < 0 or len(...
s559337702
p00214
u319725914
1535467594
Python
Python3
py
Runtime Error
0
0
1447
from sys import stdin from itertools import product def chk_in_rect(xy1,xy2): for i,j in product(range(4),repeat=2): a = (xy1[(2*i+2)&7]-xy1[(2*i )&7]) * (xy2[(2*j+1)&7]-xy1[(2*i+1)&7]) b = (xy1[(2*i+3)&7]-xy1[(2*i+1)&7]) * (xy2[(2*j )&7]-xy1[(2*i )&7]) if a > b: return False else: ...
s768443463
p00214
u319725914
1535467670
Python
Python3
py
Runtime Error
0
0
1491
from sys import stdin from itertools import product def chk_in_rect(xy1,xy2): for i,j in product(range(4),repeat=2): a = (xy1[(2*i+2)&7]-xy1[(2*i )&7]) * (xy2[(2*j+1)&7]-xy1[(2*i+1)&7]) b = (xy1[(2*i+3)&7]-xy1[(2*i+1)&7]) * (xy2[(2*j )&7]-xy1[(2*i )&7]) if a > b: return False else: ...
s497681735
p00214
u319725914
1535506184
Python
Python3
py
Runtime Error
0
0
1564
from sys import stdin from itertools import product def chk_in_rect(xy1,xy2): for i in range(4): chk = True for j in range(4): a = (xy1[(2*i+2)&7]-xy1[(2*i )&7]) * (xy2[(2*j+1)&7]-xy1[(2*i+1)&7]) b = (xy1[(2*i+3)&7]-xy1[(2*i+1)&7]) * (xy2[(2*j )&7]-xy1[(2*i )&7]) ...
s739026374
p00214
u319725914
1535506356
Python
Python3
py
Runtime Error
0
0
1563
from sys import stdin from itertools import product def chk_in_rect(xy1,xy2): for i in range(4): chk = True for j in range(4): a = (xy1[(2*i+2)&7]-xy1[(2*i )&7]) * (xy2[(2*j+1)&7]-xy1[(2*i+1)&7]) b = (xy1[(2*i+3)&7]-xy1[(2*i+1)&7]) * (xy2[(2*j )&7]-xy1[(2*i )&7]) ...
s386195314
p00214
u319725914
1535507903
Python
Python3
py
Runtime Error
0
0
1600
from sys import stdin from itertools import product def chk_in_rect(xy1,xy2): for i in range(4): chk = True for j in range(4): a = (xy1[(2*i+2)&7]-xy1[(2*i )&7]) * (xy2[(2*j+1)&7]-xy1[(2*i+1)&7]) b = (xy1[(2*i+3)&7]-xy1[(2*i+1)&7]) * (xy2[(2*j )&7]-xy1[(2*i )&7]) ...
s278349724
p00214
u319725914
1535508304
Python
Python3
py
Runtime Error
0
0
1602
from sys import stdin from itertools import product def chk_in_rect(xy1,xy2): for i in range(4): chk = True for j in range(4): a = (xy1[(2*i+2)&7]-xy1[(2*i )&7]) * (xy2[(2*j+1)&7]-xy1[(2*i+1)&7]) b = (xy1[(2*i+3)&7]-xy1[(2*i+1)&7]) * (xy2[(2*j )&7]-xy1[(2*i )&7]) ...
s046042068
p00214
u319725914
1535517046
Python
Python3
py
Runtime Error
0
0
1689
from sys import stdin from itertools import product def chk_in_rect(xy1,xy2): chk = True for i in range(4): for j in range(4): a = (xy1[(2*i+2)&7]-xy1[(2*i )&7]) * (xy2[(2*j+1)&7]-xy1[(2*i+1)&7]) b = (xy1[(2*i+3)&7]-xy1[(2*i+1)&7]) * (xy2[(2*j )&7]-xy1[(2*i )&7]) ...
s068660280
p00214
u319725914
1535525918
Python
Python3
py
Runtime Error
0
0
2024
from sys import stdin from itertools import product def chk_in_rect(xy1,xy2): chk2in1 = True for i in range(4): for j in range(4): a = (xy1[(2*i+2)&7]-xy1[(2*i )&7]) * (xy2[(2*j+1)&7]-xy1[(2*i+1)&7]) b = (xy1[(2*i+3)&7]-xy1[(2*i+1)&7]) * (xy2[(2*j )&7]-xy1[(2*i )&7]) ...
s674044506
p00214
u319725914
1535525984
Python
Python3
py
Runtime Error
0
0
2021
from sys import stdin def chk_in_rect(xy1,xy2): chk2in1 = True for i in range(4): for j in range(4): a = (xy1[(2*i+2)&7]-xy1[(2*i )&7]) * (xy2[(2*j+1)&7]-xy1[(2*i+1)&7]) b = (xy1[(2*i+3)&7]-xy1[(2*i+1)&7]) * (xy2[(2*j )&7]-xy1[(2*i )&7]) if a > b: chk2in1 = False;...
s942080519
p00214
u319725914
1535526027
Python
Python3
py
Runtime Error
0
0
1972
def chk_in_rect(xy1,xy2): chk2in1 = True for i in range(4): for j in range(4): a = (xy1[(2*i+2)&7]-xy1[(2*i )&7]) * (xy2[(2*j+1)&7]-xy1[(2*i+1)&7]) b = (xy1[(2*i+3)&7]-xy1[(2*i+1)&7]) * (xy2[(2*j )&7]-xy1[(2*i )&7]) if a > b: chk2in1 = False; break chk1in2 = T...
s518550928
p00214
u319725914
1535526064
Python
Python3
py
Runtime Error
0
0
2052
# def chk_in_rect(xy1,xy2): # chk2in1 = True # for i in range(4): # for j in range(4): # a = (xy1[(2*i+2)&7]-xy1[(2*i )&7]) * (xy2[(2*j+1)&7]-xy1[(2*i+1)&7]) # b = (xy1[(2*i+3)&7]-xy1[(2*i+1)&7]) * (xy2[(2*j )&7]-xy1[(2*i )&7]) # if a > b: chk2in1 = False; break #...
s237613453
p00214
u319725914
1535526113
Python
Python3
py
Runtime Error
0
0
2009
# def chk_in_rect(xy1,xy2): # chk2in1 = True # for i in range(4): # for j in range(4): # a = (xy1[(2*i+2)&7]-xy1[(2*i )&7]) * (xy2[(2*j+1)&7]-xy1[(2*i+1)&7]) # b = (xy1[(2*i+3)&7]-xy1[(2*i+1)&7]) * (xy2[(2*j )&7]-xy1[(2*i )&7]) # if a > b: chk2in1 = False; break #...
s616130422
p00214
u319725914
1535526155
Python
Python3
py
Runtime Error
0
0
2011
# def chk_in_rect(xy1,xy2): # chk2in1 = True # for i in range(4): # for j in range(4): # a = (xy1[(2*i+2)&7]-xy1[(2*i )&7]) * (xy2[(2*j+1)&7]-xy1[(2*i+1)&7]) # b = (xy1[(2*i+3)&7]-xy1[(2*i+1)&7]) * (xy2[(2*j )&7]-xy1[(2*i )&7]) # if a > b: chk2in1 = False; break #...
s373926588
p00214
u319725914
1535526188
Python
Python3
py
Runtime Error
0
0
233
while(True): n = int(input()) if not n: break for _ in range(n): m = int(input()) # p = list(range(m)) xys = [ list(map(int, input().split())) for i in range(m) ] print(1) continue
s078351720
p00214
u319725914
1535526456
Python
Python3
py
Runtime Error
0
0
227
while(True): n = int(input()) if not n: break for _ in range(n): m = int(input()) # p = list(range(m)) xys = [ map(int, input().split()) for i in range(m) ] print(1) continue
s749093849
p00214
u319725914
1535526480
Python
Python3
py
Runtime Error
0
0
209
while(True): n = int(input()) if not n: break for _ in range(n): m = int(input()) # p = list(range(m)) xys = [ input() for i in range(m) ] print(1) continue
s985937755
p00214
u319725914
1535532620
Python
Python3
py
Runtime Error
0
0
1983
# def chk_in_rect(xy1,xy2): # chk2in1 = True # for i in range(4): # for j in range(4): # a = (xy1[(2*i+2)&7]-xy1[(2*i )&7]) * (xy2[(2*j+1)&7]-xy1[(2*i+1)&7]) # b = (xy1[(2*i+3)&7]-xy1[(2*i+1)&7]) * (xy2[(2*j )&7]-xy1[(2*i )&7]) # if a > b: chk2in1 = False; break #...
s279180811
p00214
u319725914
1535532843
Python
Python3
py
Runtime Error
0
0
226
while(True): n = int(input()) if not n: break for _ in range(n): m = int(input()) # p = list(range(m)) xys = [ map(int,input().split()) for i in range(m) ] print(1) continue
s842903732
p00214
u319725914
1535533423
Python
Python3
py
Runtime Error
0
0
180
while(True): n = int(input()) if not n: break for _ in range(n): m = int(input()) xys = [ map(int,input().split()) for i in range(m) ] print(1)
s346735987
p00214
u319725914
1535533542
Python
Python3
py
Runtime Error
0
0
181
while(True): n = int(input()) if n == 0: break for _ in range(n): m = int(input()) xys = [ map(int,input().split()) for i in range(m) ] print(1)
s534834950
p00214
u319725914
1535533958
Python
Python3
py
Runtime Error
0
0
181
while(True): n = int(input()) if n == 0: break for _ in range(n): m = int(input()) xys = [ map(str,input().split()) for i in range(m) ] print(1)
s169870532
p00214
u319725914
1535534057
Python
Python3
py
Runtime Error
0
0
181
while(True): n = int(input()) if n == 0: break for i in range(n): m = int(input()) xys = [ map(str,input().split()) for i in range(m) ] print(1)
s445358355
p00214
u319725914
1535534099
Python
Python3
py
Runtime Error
0
0
164
while(True): n = int(input()) if n == 0: break for i in range(n): m = int(input()) xys = [ input() for i in range(m) ] print(1)
s439714284
p00214
u319725914
1535534627
Python
Python3
py
Runtime Error
0
0
164
while(True): n = int(input()) if n == 0: break for j in range(n): m = int(input()) xys = [ input() for i in range(m) ] print(1)
s667039808
p00214
u319725914
1535535062
Python
Python3
py
Runtime Error
0
0
147
while(True): n = int(input()) if n == 0: break for j in range(n): m = int(input()) xys = [ input() for i in range(m) ]
s596554721
p00214
u319725914
1535540557
Python
Python3
py
Runtime Error
0
0
167
while(True): n = int(input()) if n == 0: break for j in range(n): m = int(input()) xys = [ [input() for k in range(4)] for i in range(m) ]
s652552320
p00214
u319725914
1535540576
Python
Python3
py
Runtime Error
0
0
167
while(True): n = int(input()) if n == 0: break for j in range(n): m = int(input()) xys = [ [input() for k in range(8)] for i in range(m) ]
s916898280
p00214
u319725914
1535540597
Python
Python3
py
Runtime Error
0
0
167
while(True): n = int(input()) if n == 0: break for j in range(n): m = int(input()) xys = [ [input() for k in range(2)] for i in range(m) ]
s449549545
p00214
u319725914
1535540715
Python
Python3
py
Runtime Error
0
0
186
while(True): n = int(input()) if n == 0: break for j in range(n): m = int(input()) xys = [ [input() for k in range(4)] for i in range(m) ] print(xys)
s544812741
p00214
u319725914
1535540753
Python
Python3
py
Runtime Error
0
0
186
while(True): n = int(input()) if n == 0: break for j in range(n): m = int(input()) xys = [ [input() for k in range(4)] for i in range(m) ] print("1")
s668420308
p00214
u319725914
1535548213
Python
Python3
py
Runtime Error
0
0
187
while(True): n = int(input()) if not n: break for _ in range(n): m = int(input()) xys = [ list(map(int, input().split())) for i in range(m) ] print(1)
s931630187
p00214
u319725914
1535548278
Python
Python3
py
Runtime Error
0
0
198
while(True): n = int(input()) if not n: break for _ in range(n): m = int(input()) for i in range(m): hoge = list(map(int, input().split())) print(1)
s058083038
p00214
u319725914
1535636833
Python
Python3
py
Runtime Error
0
0
198
while(True): n = int(input()) if not n: break for _ in range(n): m = int(input()) for i in range(m): hoge = list(map(int, input().split())) print(1)
s552877007
p00214
u319725914
1535636905
Python
Python3
py
Runtime Error
0
0
236
while(True): try: n = int(input()) except: break if not n: break for _ in range(n): m = int(input()) for i in range(m): hoge = list(map(int, input().split())) print(1)
s251769033
p00214
u319725914
1535637049
Python
Python3
py
Runtime Error
0
0
225
while(True): try: n = int(input()) except: break if not n: break for _ in range(n): m = int(input()) hoge = [list(map(int, input().split())) for j in range(m)] print(1)
s509607758
p00214
u319725914
1535637676
Python
Python3
py
Runtime Error
0
0
227
while(True): try: n = int(input()) except: break if not n: break for _ in range(n): m = int(input()) hoge = [list(map(int, input().split())) for j in range(m)] print("1")
s858045796
p00214
u319725914
1535637709
Python
Python3
py
Runtime Error
0
0
276
from sys import stdin while(True): try: n = int(stdin.readline()) except: break if not n: break for _ in range(n): m = int(stdin.readline()) hoge = [list(map(int, stdin.readline().split())) for j in range(m)] print("1")
s870835065
p00214
u319725914
1535638243
Python
Python3
py
Runtime Error
0
0
305
from sys import stdin while(True): try: n = int(stdin.readline()) except: break if not n: break for _ in range(n): m = int(stdin.readline()) try: hoge = [list(map(int, stdin.readline().split())) for j in range(m)] except: break print("1")
s306139888
p00214
u319725914
1535638328
Python
Python3
py
Runtime Error
0
0
306
from sys import stdin while(True): try: n = int(stdin.readline()) except: break if not n: break for _ in range(n): m = int(stdin.readline()) try: hoge = [list(map(int, stdin.readline().split())) for j in range(m)] except: excit() print("1")
s811674355
p00214
u319725914
1535638386
Python
Python3
py
Runtime Error
0
0
323
from sys import stdin stdin.readline() while(True): try: n = int(stdin.readline()) except: break if not n: break for _ in range(n): m = int(stdin.readline()) try: hoge = [list(map(int, stdin.readline().split())) for j in range(m)] except: excit() print("1"...
s057874300
p00214
u319725914
1535638448
Python
Python3
py
Runtime Error
0
0
322
from sys import stdin stdin.readline() while(True): try: n = int(stdin.readline()) except: break if not n: break for _ in range(n): m = int(stdin.readline()) try: hoge = [list(map(int, stdin.readline().split())) for j in range(m)] except: exit() print("1")...
s747101886
p00214
u319725914
1535638458
Python
Python3
py
Runtime Error
0
0
304
from sys import stdin while(True): try: n = int(stdin.readline()) except: break if not n: break for _ in range(n): m = int(stdin.readline()) try: hoge = [list(map(int, stdin.readline().split())) for j in range(m)] except: exit() print("1")
s645868946
p00214
u319725914
1535639105
Python
Python3
py
Runtime Error
0
0
309
from sys import stdin while(True): try: n = int(stdin.readline()) except: exit() if not n: exit() for _ in range(n): m = int(stdin.readline()) try: hoge = [list(map(int, stdin.readline().split())) for j in range(m)] except: exit() print("1\n")
s637568447
p00214
u567380442
1429250253
Python
Python3
py
Runtime Error
0
0
1912
from sys import stdin readline = stdin.readline class union_find: def __init__(self, size): self.table = [-1 for _ in range(size)] def union(self, x, y): x, y = self.find(x), self.find(y) if x == y: return True if self.table[y] < self.table[x]: x, y = ...
s819016133
p00215
u567380442
1429261093
Python
Python3
py
Runtime Error
19930
11848
1394
from sys import stdin readline = stdin.readline from itertools import product from collections import defaultdict from collections import namedtuple from operator import itemgetter from math import isinf Point = namedtuple('Point', 'x y') def distance(a, b): return abs(a.x - b.x) + abs(a.y - b.y) def solve(rout...
s431292899
p00217
u104911888
1368086034
Python
Python
py
Runtime Error
0
0
195
while True: n=input() if n==0:break D={} m=0 for i in range(n): p,d1,d2=map(int,raw_input().split()) t=d1+d2 m=max(m,t) D[t]=p print D[m],m
s916617507
p00217
u104911888
1368097259
Python
Python
py
Runtime Error
0
0
197
while True: n=input() if n==0:break m=0 dic={} for i in range(n): p,d1,d2=map(int,raw_input().split()) t=d1+d2 m=max(m,t) dic[t]=p print dic[m],m
s656655911
p00217
u918572590
1370090737
Python
Python
py
Runtime Error
0
0
433
def main(): while True: n=int(raw_input()) if n==0: break; solve(n) def solve(n): a=[] for _ in range(n): tmp=map(int,raw_input().split(" ")) a.append(Pair(tmp[0],tmp[1]+tmp[2])) a.sort() print a[-1].x, a[-1].y class Pair: def __init__(self,x,y): ...
s269932095
p00217
u260980560
1386572956
Python
Python
py
Runtime Error
0
0
201
while 1: n = input() if n==0: break pm = -1; m = 0; for i in xrange(n): p,d1,d2 = map(int, raw_input().split()) if m<d1+d2: pm = p; m = d1+d2; print pm,m
s274773219
p00217
u260980560
1386573440
Python
Python
py
Runtime Error
0
0
201
while 1: n = input() if n==0: break pm = -1; m = -1; for i in range(n): p,d1,d2 = map(int, raw_input().split()) if m<d1+d2: pm = p; m = d1+d2; print pm,m
s281004401
p00217
u260980560
1386573828
Python
Python
py
Runtime Error
0
0
223
while 1: n = input() if n==0: break l = [] for i in range(n): p,d1,d2 = map(int, raw_input().split()) l.append([p,d1+d2]) l.sort(reverse=True, key=lambda x:x[1]) print l[0][0],l[0][1]
s397605359
p00217
u633068244
1396444107
Python
Python
py
Runtime Error
0
0
162
while 1: r={} n=input() if n==0:break for i in [1]*n: p,d1,d2=map(int,raw_input().split()) r[p]=d1+d2 a=max(r.items(),key=lambda x:x[1]) print a[0],a[1]
s281759064
p00217
u633068244
1396444336
Python
Python
py
Runtime Error
0
0
168
while 1: try: r={} n=input() l=m=0 for i in [1]*n: p,d1,d2=map(int,raw_input().split()) d=d1+d2 if d>m:l,m=p,d print l,m except syntaxError: pass
s132509776
p00217
u633068244
1396444351
Python
Python
py
Runtime Error
0
0
168
while 1: try: r={} n=input() l=m=0 for i in [1]*n: p,d1,d2=map(int,raw_input().split()) d=d1+d2 if d>m:l,m=p,d print l,m except SyntaxError: pass
s256745593
p00218
u814278309
1559138175
Python
Python3
py
Runtime Error
0
0
499
n=int(input()) while True: if n==0: break for i in range(n): m,e,j=map(int,input().split()) if m==100 or e==100 or j==100: print('{}'.format('A')) elif (m+e)/2>=90: print('{}'.format('A')) elif (m+e+j)/3>=80: print('{}'.format('A')) elif (m+e+j)/3>=70: print('{}'.f...
s351460119
p00218
u647766105
1426653991
Python
Python
py
Runtime Error
0
0
412
while True: try: N = input() except: break pm, pe, pj = points = map(int, raw_input()) ave = sum(points) / 3.0 if 100 in points: print "A" elif (pm + pe) / 2.0 >= 90: print "A" elif ave >= 80: print "A" elif ave >= 70: print "B" elif av...
s922236017
p00218
u078042885
1483523515
Python
Python3
py
Runtime Error
0
0
292
while 1: n=int(input()) if n=='0': break for _ in range(n): a=list(map(int,input().split())) c=sum(a) if sum(a[:2])/2>=90 or c/3>=80 or 100 in a: b='A' elif c/3>=70 or (c/3>=50 and (a[0]>=80 or a[1]>=80)): b='B' else: b='C' print(b)
s028022355
p00218
u546285759
1509356830
Python
Python3
py
Runtime Error
0
0
505
while True: n = int(input()) if n == 0: break dataset = [map(int, input().split()) for _ in range(n)] for map_ in dataset: pm, pe, pj = map_ x = (pm + pe + pj) // 3 if 100 in p: print("A") elif (pm + pe) // 2 >= 90: print("A") elif ...
s311382611
p00218
u180584272
1379839399
Python
Python
py
Runtime Error
0
0
298
for s in sys.stdin: s = map(int, s.split()) if len(s)==1: continue else: (pm,pe,pj) = tuple(s) if 100 in (pm,pe,pj): c = "A" elif pm+pe>=180: c = "A" elif pm+pe+pj>=240: c = "A" elif pm+pe+pj>=240: c = "B" elif pm+pe+pj>=150 and (pm>=80 or pe>=80): c = "B" else: c = "C" print c