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
s306358039
p00202
u032662562
1519308235
Python
Python3
py
Runtime Error
0
0
2309
# -*- coding: utf-8 -*- import pdb import sys,math,time #Debug=True Debug=False nmax=1000000 #unit_cost = [500,305,260,129] #total_cost = 15000 #unit_cost = [12,9,5] #total_cost = 200909 unit_cost = [] total_cost=0 primes=[] pmax=-1 dic = {2:True,3:True} def prime3(n): global dic if n in dic: return(d...
s371597075
p00202
u032662562
1519346154
Python
Python3
py
Runtime Error
0
0
2309
# -*- coding: utf-8 -*- import pdb import sys,math,time #Debug=True Debug=False nmax=1000000 #unit_cost = [500,305,260,129] #total_cost = 15000 #unit_cost = [12,9,5] #total_cost = 200909 unit_cost = [] total_cost=0 primes=[] pmax=-1 dic = {2:True,3:True} def prime3(n): global dic if n in dic: return(d...
s221745652
p00202
u032662562
1519346343
Python
Python3
py
Runtime Error
0
0
2205
# -*- coding: utf-8 -*- import sys,math,time #Debug=True Debug=False nmax=1000000 unit_cost = [] total_cost=0 primes=[] pmax=-1 dic = {2:True,3:True} def prime3(n): global dic if n in dic: return(dic[n]) else: if n % 2==0: return False while True: for i in r...
s968471310
p00202
u032662562
1519346428
Python
Python3
py
Runtime Error
0
0
2203
# -*- coding: utf-8 -*- import sys,math #Debug=True Debug=False nmax=1000000 unit_cost = [] total_cost=0 primes=[] pmax=-1 dic = {2:True,3:True} def prime3(n): global dic if n in dic: return(dic[n]) else: if n % 2==0: return False while True: for i in range(...
s631716471
p00202
u032662562
1519483093
Python
Python3
py
Runtime Error
0
0
1347
# -*- coding: utf-8 -*- import sys from math import sqrt, ceil #Debug=True Debug=False nmax=1000000 nmax1=nmax+1 def nums(unit_cost, total_cost): cand = [True if i==0 else False for i in range(total_cost+1)] for i in range(total_cost+1): if cand[i]: for j in unit_cost: if i +...
s705953996
p00202
u032662562
1519483988
Python
Python3
py
Runtime Error
0
0
1393
# -*- coding: utf-8 -*- import sys from math import sqrt, ceil #Debug=True Debug=False nmax=1000000 nmax1=nmax+1 def nums(unit_cost, total_cost): cand = [True if i==0 else False for i in range(total_cost+1)] for i in range(total_cost+1): if cand[i]: for j in unit_cost: if i +...
s249066665
p00202
u032662562
1519546334
Python
Python
py
Runtime Error
0
0
1394
# -*- coding: utf-8 -*- import sys,time from math import sqrt, ceil range=xrange #Debug=True Debug=False nmax=1000000 nmax1=nmax+1 def nums(unit_cost, total_cost): cand = [True if i==0 else False for i in range(total_cost+1)] for i in range(total_cost+1): if cand[i]: for j in unit_cost: ...
s194255898
p00202
u019169314
1528786819
Python
Python3
py
Runtime Error
0
0
629
N=1000000 isPrime = [False,False]+[True]*(N-2) isPrime[4::2] = [False]*len(isPrime[4::2]) for i in range(3,1000,2): if isPrime[i]: isPrime[2*i::i] = [False]*len(isPrime[2*i::i]) while True: n,g = [int(i) for i in input().split()] prices = [int(input()) for i in range(n)] if n==0: break isP...
s032774376
p00202
u019169314
1528787618
Python
Python3
py
Runtime Error
0
0
638
N=1000000 isPrime = [False,False]+[True]*(N-2) isPrime[4::2] = [False]*len(isPrime[4::2]) for i in range(3,1000,2): if isPrime[i]: isPrime[2*i::i] = [False]*len(isPrime[2*i::i]) while True: n,g = [int(i) for i in input().split()] prices = [int(input()) for i in range(n)] if n==0 and g==0: brea...
s231915136
p00202
u019169314
1528803873
Python
Python3
py
Runtime Error
0
0
640
N=1000000 isPrime = [False,False]+[True]*(N-2) isPrime[4::2] = [False]*len(isPrime[4::2]) for i in range(3,1000,2): if isPrime[i]: isPrime[2*i::i] = [False]*len(isPrime[2*i::i]) while True: n,g = [int(i) for i in input().split()] prices = [int(input()) for i in range(n)] if n==0 and g == 0: br...
s402161807
p00202
u019169314
1528808071
Python
Python3
py
Runtime Error
0
0
565
isPrime = [False,False]+[True]*(1000000-2) isPrime[4::2] = [False]*len(isPrime[4::2]) for i in range(3,1000,2): if isPrime[i]: isPrime[2*i::i] = [False]*len(isPrime[2*i::i]) while True: n,x = [int(i) for i in input().split()] if n==0: break prices = [int(input()) for i in range(n)] isPayabl...
s912524687
p00202
u019169314
1528808330
Python
Python3
py
Runtime Error
0
0
567
isPrime = [False,False]+[True]*(1000000-2) isPrime[4::2] = [False]*len(isPrime[4::2]) for i in range(3,1000,2): if isPrime[i]: isPrime[2*i::i] = [False]*len(isPrime[2*i::i]) while True: n,x = [int(i) for i in input().split()] if n==0: break prices = [int(input()) for i in range(n)] isPayabl...
s496475884
p00202
u019169314
1528866506
Python
Python3
py
Runtime Error
0
0
567
isPrime = [False,False]+[True]*(1000000-2) isPrime[4::2] = [False]*len(isPrime[4::2]) for i in range(3,1000,2): if isPrime[i]: isPrime[2*i::i] = [False]*len(isPrime[2*i::i]) while True: n,x = [int(i) for i in input().split()] if n==0: break prices = [int(input()) for i in range(n)] isPayabl...
s142626256
p00202
u019169314
1528866979
Python
Python3
py
Runtime Error
0
0
604
while True: n,x = [int(i) for i in input().split()] if n==0: break prices = [int(input()) for i in range(n)] isPrime = [False,False]+[True]*(x-1) # x+1 isPrime[4::2] = [False]*len(isPrime[4::2]) for i in range(3,int(x**0.5)+1,2): if isPrime[i]: isPrime[2*i::i] = [False]*len(...
s365962816
p00202
u019169314
1528867316
Python
Python3
py
Runtime Error
0
0
592
isPrime = [False,False]+[True]*(1000000) isPrime[4::2] = [False]*len(isPrime[4::2]) for i in range(3,1000,2): if isPrime[i]: isPrime[2*i::i] = [False]*len(isPrime[2*i::i]) while True: n,x = [int(i) for i in input().split()] if n==0: break prices = [int(input()) for i in range(n)] isPayable ...
s203432247
p00202
u019169314
1528867565
Python
Python3
py
Runtime Error
0
0
650
isPrime = [False,False]+[True]*(1000000) isPrime[4::2] = [False]*len(isPrime[4::2]) for i in range(3,1000,2): if isPrime[i]: isPrime[2*i::i] = [False]*len(isPrime[2*i::i]) while True: n,x = [int(i) for i in input().split()] if n==0: break prices = [int(input()) for i in range(n)] isPayable ...
s369252890
p00202
u019169314
1528869173
Python
Python3
py
Runtime Error
0
0
745
isPrime = [False,False]+[True]*(1000000-1) # 1,000,001 isPrime[4::2] = [False]*len(isPrime[4::2]) for i in range(3,1000,2): if isPrime[i]: isPrime[2*i::i] = [False]*len(isPrime[2*i::i]) while True: # n,x = [int(i) for i in input().split()] n,x = list(map(int, input().split())) if n==0 and x==0:...
s768152922
p00202
u019169314
1528870227
Python
Python3
py
Runtime Error
0
0
522
isPrime = [False, True] * 500000 isPrime[1:3] = [False, True] for i in range(3, 1000, 2): if isPrime[i]: isPrime[2 * i::i] = [False] * len(isPrime[2 * i::i]) while True: n, x = [int(i) for i in input().split()] if n == 0: break prices = [int(input()) for i in range(n)] # n isPayable = [True] + [False] * x # x...
s339638918
p00202
u019169314
1528875694
Python
Python3
py
Runtime Error
0
0
609
isPrime = [False,True]*500000 # len:1,000,000 isPrime[1:3] = [False,True] for i in range(3,1000,2): if isPrime[i]: isPrime[i*i::2*i] = [False]*len(isPrime[i*i::2*i]) n,x = map(int, input().split()) while n!=0: prices = [int(input()) for i in range(n)] # len:n isPayable = [False]*(x+1) # len:x+1 ...
s438098432
p00202
u019169314
1528876514
Python
Python3
py
Runtime Error
0
0
683
isPrime = [False,True]*500000 # len:1,000,000 isPrime[1:3] = [False,True] for i in range(3,1000,2): if isPrime[i]: isPrime[i*i::2*i] = [False]*len(isPrime[i*i::2*i]) while True: # n,x = [int(i) for i in input().split()] n,x = map(int, input().split()) if n==0 and x==0: import sys ...
s900595874
p00202
u019169314
1528876760
Python
Python3
py
Runtime Error
0
0
618
isPrime = [False,True]*500000 + [True] # len:1,000,000 isPrime[1:3] = [False,True] for i in range(3,1000,2): if isPrime[i]: isPrime[i*i::2*i] = [False]*len(isPrime[i*i::2*i]) n,x = map(int, input().split()) while n!=0: prices = [int(input()) for i in range(n)] # len:n isPayable = [False]*(x+1) # le...
s158627737
p00202
u019169314
1528877397
Python
Python3
py
Runtime Error
0
0
626
isPrime = [False,True]*500000+[False] # len:1,000,001 isPrime[1:3] = [False,True] for i in range(3,1000,2): if isPrime[i]: isPrime[i*i::2*i] = [False]*len(isPrime[i*i::2*i]) while True: n,x = map(int, input().split()) if n==0 and x==0: break prices = [int(input()) for i in range(n)] # l...
s187125762
p00202
u847467233
1529982975
Python
Python3
py
Runtime Error
0
0
666
# AOJ 0202: At Boss's Expense # Python3 2018.6.26 bal4u MAX = 1000000 SQRT = 1000 # sqrt(MAX) not_prime = [0]*MAX def sieve(): for i in range(3, SQRT, 2): if not_prime[i] == 0: for j in range(i*i, MAX, i): not_prime[j] = 1 sieve() while True: n, x = map(int, input().split()) if n == 0: break mk, v = [0]...
s807785750
p00202
u847467233
1529983568
Python
Python3
py
Runtime Error
0
0
671
# AOJ 0202: At Boss's Expense # Python3 2018.6.26 bal4u MAX = 1000000 SQRT = 1000 # sqrt(MAX) not_prime = [0]*(MAX+3) def sieve(): for i in range(3, SQRT, 2): if not_prime[i] == 0: for j in range(i*i, MAX, i): not_prime[j] = 1 sieve() while True: n, x = map(int, input().split()) if n == 0: break mk, v ...
s550939980
p00202
u847467233
1530014582
Python
Python3
py
Runtime Error
0
0
670
# AOJ 0202: At Boss's Expense # Python3 2018.6.26 bal4u MAX = 1000000 SQRT = 1000 # sqrt(MAX) not_prime = [0]*(MAX+3) def sieve(): for i in range(3, SQRT, 2): if not_prime[i] == 0: for j in range(i*i, MAX, i): not_prime[j] = 1 sieve() v = [0]*33 while True: n, x = map(int, input().split()) if n == 0: bre...
s232660345
p00202
u759949288
1361350723
Python
Python
py
Runtime Error
19920
122852
573
from array import array PRIME_MAX = 1000001 isPrime = array('b', [True] * PRIME_MAX) isPrime[0] = isPrime[1] = False for i in xrange(2, PRIME_MAX): if not isPrime[i]: continue for j in xrange(i << 1, PRIME_MAX, i): isPrime[j] = False while True: n, x = map(int, raw_input().split()) if n == x == 0: break menu = [...
s010379489
p00202
u759949288
1361351416
Python
Python
py
Runtime Error
19930
122856
564
from array import array PRIME_MAX = 1000001 isPrime = array('b', [1] * PRIME_MAX) isPrime[0] = 0 isPrime[1] = 0 for i in xrange(2, PRIME_MAX): if not isPrime[i]: continue for j in xrange(i << 1, PRIME_MAX, i): isPrime[j] = 0 while True: n, x = map(int, raw_input().split()) if n == x == 0: break menu = [input() f...
s674687800
p00202
u759949288
1361361808
Python
Python
py
Runtime Error
19920
123148
642
import sys from array import array PRIME_MAX = 1000001 isPrime = array('b', [True] * PRIME_MAX) isPrime[0] = isPrime[1] = False for i in xrange(2, PRIME_MAX): if not isPrime[i]: continue for j in xrange(i << 1, PRIME_MAX, i): isPrime[j] = False sin = iter(map(int, "".join(sys.stdin.readlines()).split())) while True...
s522691893
p00202
u759949288
1361362674
Python
Python
py
Runtime Error
19930
122920
643
import sys from array import array PRIME_MAX = 1000010 isPrime = array('b', [True] * PRIME_MAX) isPrime[0] = isPrime[1] = False for i in xrange(2, PRIME_MAX): if not isPrime[i]: continue for j in xrange(i << 1, PRIME_MAX, i): isPrime[j] = False sin = iter(map(int, "".join(sys.stdin.readlines()).split())) while True...
s339708946
p00202
u759949288
1361363171
Python
Python
py
Runtime Error
19930
35560
606
import sys PRIME_MAX = 1000010 isPrime = [True] * PRIME_MAX isPrime[0] = isPrime[1] = False for i in xrange(2, PRIME_MAX): if not isPrime[i]: continue for j in xrange(i << 1, PRIME_MAX, i): isPrime[j] = False sin = iter(map(int, "".join(sys.stdin.readlines()).split())) while True: n = sin.next() x = sin.next() i...
s116228937
p00202
u633068244
1396445778
Python
Python
py
Runtime Error
0
0
363
def prime(n): return True if pow(2,n-1,n)==1 else False while 1: n,x=map(int,raw_input().split()) if n==0:break p=[input() for i in [1]*n] s=[0 for i in [1]*(x+1)] for i in p:s[i]=1 for i in range(1,x+1): if s[i]==1: for j in p: try:s[i+j]=1 except:pass for i in range(x,0,-1): if s[i]==1 and pri...
s299345573
p00202
u633068244
1396445812
Python
Python
py
Runtime Error
0
0
412
def prime(n): return True if pow(2,n-1,n)==1 else False while 1: try: n,x=map(int,raw_input().split()) if n==0:break p=[input() for i in [1]*n] s=[0 for i in [1]*(x+1)] for i in p:s[i]=1 for i in range(1,x+1): if s[i]==1: for j in p: try:s[i+j]=1 except:pass for i in range(x,0,-1): ...
s177246307
p00202
u871901071
1397311056
Python
Python
py
Runtime Error
0
0
1210
input = raw_input def init(): table = [True] * 1000001 table[0] = False table[1] = False n = len(table) for i in range(2, n): for j in range(i + i, n, i): table[j] = False return table def is_prime(p): if p == 0 or p == 1: return False for i in range(2, ...
s011062807
p00202
u871901071
1397311146
Python
Python
py
Runtime Error
0
0
1199
def init(): table = [True] * 1000001 table[0] = False table[1] = False n = len(table) for i in range(2, n): for j in range(i + i, n, i): table[j] = False return table def is_prime(p): if p == 0 or p == 1: return False for i in range(2, p - 1): if ...
s316125368
p00202
u871901071
1397311537
Python
Python
py
Runtime Error
0
0
1210
input = raw_input def init(): table = [True] * 1000001 table[0] = False table[1] = False n = len(table) for i in range(2, n): for j in range(i + i, n, i): table[j] = False return table def is_prime(p): if p == 0 or p == 1: return False for i in range(2, ...
s919736373
p00202
u871901071
1397311849
Python
Python
py
Runtime Error
0
0
1210
input = raw_input def init(): table = [True] * 1000001 table[0] = False table[1] = False n = len(table) for i in range(2, n): for j in range(i + i, n, i): table[j] = False return table def is_prime(p): if p == 0 or p == 1: return False for i in range(2, ...
s315674315
p00202
u871901071
1397369979
Python
Python
py
Runtime Error
0
0
1210
input = raw_input def init(): table = [True] * 1000001 table[0] = False table[1] = False n = len(table) for i in range(2, n): for j in range(i + i, n, i): table[j] = False return table def is_prime(p): if p == 0 or p == 1: return False for i in range(2, ...
s013649940
p00202
u871901071
1397370023
Python
Python
py
Runtime Error
0
0
1210
input = raw_input def init(): table = [True] * 2000001 table[0] = False table[1] = False n = len(table) for i in range(2, n): for j in range(i + i, n, i): table[j] = False return table def is_prime(p): if p == 0 or p == 1: return False for i in range(2, ...
s587322654
p00202
u871901071
1397370085
Python
Python
py
Runtime Error
0
0
1052
input = raw_input def init(): table = [True] * 2000001 table[0] = False table[1] = False n = len(table) for i in range(2, n): for j in range(i + i, n, i): table[j] = False return table def solve(price, ps, is_prime): dp = [] for i in range(len(ps)): dp.a...
s047167725
p00202
u871901071
1397371308
Python
Python
py
Runtime Error
0
0
1401
from datetime import datetime def measure(f): measure_start = datetime.now() v = f() print(datetime.now() - measure_start) return v def init(): table = [True] * 1000001 table[0] = False table[1] = False n = len(table) def prime(p): for i in range(p + p, n, p): ...
s098612977
p00202
u871901071
1397371635
Python
Python
py
Runtime Error
0
0
1402
from datetime import datetime def measure(f): measure_start = datetime.now() v = f() print(datetime.now() - measure_start) return v # input = raw_input def init(): table = [True] * 1000001 table[0] = False table[1] = False n = len(table) def prime(p): for i in range(p...
s407160224
p00202
u871901071
1397377760
Python
Python
py
Runtime Error
0
0
2187
from datetime import datetime def measure(f): measure_start = datetime.now() v = f() print(datetime.now() - measure_start) return v # input = raw_input # range = xrange def init(): table = [True] * 1000001 table[0] = False table[1] = False n = len(table) def prime(p): ...
s169215662
p00202
u871901071
1397379200
Python
Python
py
Runtime Error
0
0
2700
from datetime import datetime def measure(f): measure_start = datetime.now() v = f() print(datetime.now() - measure_start) return v # input = raw_input # range = xrange def init(): table = [True] * 1000001 table[0] = False table[1] = False n = len(table) def prime(p): ...
s378077993
p00202
u871901071
1397379515
Python
Python
py
Runtime Error
0
0
1650
from datetime import datetime def measure(f): measure_start = datetime.now() v = f() print(datetime.now() - measure_start) return v # input = raw_input # range = xrange def init(): table = [True] * 1000001 table[0] = False table[1] = False n = len(table) def prime(p): ...
s480626022
p00202
u871901071
1397379762
Python
Python
py
Runtime Error
0
0
1711
from datetime import datetime def measure(f): measure_start = datetime.now() v = f() print(datetime.now() - measure_start) return v # input = raw_input # range = xrange def init(): table = [True] * 1000001 table[0] = False table[1] = False n = len(table) def prime(p): ...
s931764273
p00202
u633068244
1399111543
Python
Python
py
Runtime Error
0
0
446
r = 1000001 s = int(r*0.5) p = [1]*r p[0] = p[1] = 0 for i in range(2,s+1): if p[i]: p[2*i::i] = [0 for _ in range(2*i,r,i)] while 1: n,x = map(int,raw_input().split()) if n == 0: break dish = [int(raw_input()) for i in range(n)] dp = [0]*(x+1) for i in dish: dp[i] = 1 for cost in dish: for j in range(x-i+...
s303887874
p00202
u633068244
1399111596
Python
Python
py
Runtime Error
0
0
446
r = 1000001 s = int(r*0.5) p = [1]*r p[0] = p[1] = 0 for i in range(2,s+1): if p[i]: p[2*i::i] = [0 for _ in range(2*i,r,i)] while 1: n,x = map(int,raw_input().split()) if n == 0: break dish = [int(raw_input()) for i in range(n)] dp = [0]*(x+1) for i in dish: dp[i] = 1 for cost in dish: for j in range(x-i+...
s428374760
p00202
u633068244
1399111673
Python
Python
py
Runtime Error
0
0
460
r = 1000001 s = int(r*0.5) p = [1]*r p[0] = p[1] = 0 for i in range(2,s+1): if p[i]: p[2*i::i] = [0 for _ in range(2*i,r,i)] while 1: n,x = map(int,raw_input().split()) if n == 0: break dish = [int(raw_input()) for i in range(n)] dp = [0]*(x+1) for i in dish: if i <= x: dp[i] = 1 for cost in dish: for j...
s959246464
p00202
u633068244
1399111750
Python
Python
py
Runtime Error
0
0
449
r = 1000001 s = int(r*0.5) p = [1]*r p[0] = p[1] = 0 for i in range(2,s+1): if p[i]: p[2*i::i] = [0 for _ in range(2*i,r,i)] while 1: n,x = map(int,raw_input().split()) if n == 0: break dish = [int(raw_input()) for i in range(n)] dp = [0]*(x+1) for i in dish: dp[i] = 1 for cost in dish: for j in range(x-co...
s115837398
p00202
u633068244
1399114004
Python
Python
py
Runtime Error
0
0
599
r = 1000001 s = int(r**0.5) p = [1]*r p[0] = p[1] = 0 for i in range(2,s+1): if p[i]: p[2*i::i] = [0 for _ in range(2*i,r,i)] while 1: n,x = map(int,raw_input().split()) if n == 0: break dish = [int(raw_input()) for i in range(n)] c = 0 pay = [0]*(x+1) ref = [0]*(x+1) for i in dish: pay[c] = i ref[c] = 1 ...
s751081714
p00203
u266872031
1428070905
Python
Python
py
Runtime Error
0
0
901
while(1): [X,Y]=[int(x) for x in raw_input().split()] if X==0: break else: F=[] for i in range(Y): F.append([0]+[int(x) for x in raw_input().split()]+[0]) F.append([3 for x in range(X+2)]) S=[[0 for x in range(X+2)] for y in range(Y+1)] #F,S[y][x] ...
s676790581
p00203
u755162050
1471430825
Python
Python3
py
Runtime Error
0
0
1436
""" Created by Jieyi on 8/16/16. """ def algorithm(): def down_jump(x, y, times): if x == r: out_map[x - 1][y] += times elif in_map[x][y] == 2: down_jump(x + 2, y, times) else: out_map[x][y] += times while True: c, r = map(int, input().split...
s175748503
p00203
u755162050
1471431291
Python
Python3
py
Runtime Error
0
0
1496
""" Created by Jieyi on 8/16/16. """ def algorithm(): def down_jump(x, y, times): if x == r: out_map[x - 1][y] += times elif x == r - 1: out_map[x][y] += times elif in_map[x][y] == 2: down_jump(x + 2, y, times) else: out_map[x][y] += ...
s918790574
p00203
u755162050
1471432103
Python
Python3
py
Runtime Error
0
0
1540
""" Created by Jieyi on 8/16/16. """ def algorithm(): def down_jump(x, y, times): if x == r: out_map[x - 1][y] += times elif x == r - 1: out_map[x][y] += times elif in_map[x][y] == 2: down_jump(x + 2, y, times) else: out_map[x][y] += ...
s905198523
p00203
u811733736
1509283225
Python
Python3
py
Runtime Error
0
0
2623
# -*- coding: utf-8 -*- """ http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0203 """ import sys from sys import stdin from collections import deque, defaultdict input = stdin.readline def solve(field): 0 0 # 0: ????????°, 1: ?????????, 2: ?????£????????° course = 0 # ????????????????????????????...
s730315627
p00203
u811733736
1509284411
Python
Python3
py
Runtime Error
0
0
2630
# -*- coding: utf-8 -*- """ http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0203 """ import sys from sys import stdin from collections import deque, defaultdict input = stdin.readline def solve(field): # 0: ????????°, 1: ?????????, 2: ?????£????????° course = 0 # ?????????????????????????????? ...
s346345430
p00203
u811733736
1509284613
Python
Python3
py
Runtime Error
0
0
2673
# -*- coding: utf-8 -*- """ http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0203 """ import sys from sys import stdin from collections import deque, defaultdict input = stdin.readline def solve(field): # 0: ????????°, 1: ?????????, 2: ?????£????????° course = 0 # ?????????????????????????????? ...
s593868251
p00203
u811733736
1509285227
Python
Python3
py
Runtime Error
0
0
2673
# -*- coding: utf-8 -*- """ http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0203 """ import sys from sys import stdin from collections import deque, defaultdict input = stdin.readline def solve(field): # 0: ????????°, 1: ?????????, 2: ?????£????????° ans = 0 # ?????????????????????????????? ...
s359985893
p00203
u811733736
1509285366
Python
Python3
py
Runtime Error
0
0
2672
# -*- coding: utf-8 -*- """ http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0203 """ import sys from sys import stdin from collections import deque, defaultdict input = stdin.readline def solve(field): # 0: ????????°, 1: ?????????, 2: ?????£????????° ans = 0 # ?????????????????????????????? ...
s957320368
p00203
u811733736
1509291157
Python
Python3
py
Runtime Error
0
0
2726
# -*- coding: utf-8 -*- """ http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0203 """ import sys from sys import stdin from collections import deque, defaultdict input = stdin.readline def solve(field): # 0: ????????°, 1: ?????????, 2: ?????£????????° ans = 0 # ??????????????°???...
s419436949
p00203
u811733736
1509293045
Python
Python3
py
Runtime Error
0
0
2718
# -*- coding: utf-8 -*- """ http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0203 """ import sys from sys import stdin from collections import deque, defaultdict input = stdin.readline def solve(field): BLANK, OBSTACLE, JUMP = 0, 1, 2 ans = 0 # ??????????????°???????????° dy...
s212604317
p00203
u811733736
1509293061
Python
Python3
py
Runtime Error
0
0
2768
# -*- coding: utf-8 -*- """ http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0203 """ import sys from sys import stdin from collections import deque, defaultdict input = stdin.readline def solve(field): BLANK, OBSTACLE, JUMP = 0, 1, 2 ans = 0 # ??????????????°???????????° dy...
s446567865
p00204
u673933691
1414165428
Python
Python3
py
Runtime Error
0
0
1221
import math ans = [] while True: ufo = [] n = raw_input().split() if n == ["0", "0"]: for an in ans: print an break else: R = int(n[0]) for i in range(int(n[1])): m = [int(f) for f in raw_input().split()] l = math.sqrt(m[0] ** 2 + m[1] ...
s441542957
p00204
u180584272
1426675223
Python
Python
py
Runtime Error
0
0
12949
from math import sqrt,fabs,ceil,floor,pow,exp,log,sin,cos,tan,asin,acos,atan,atan2,pi eps=1e-10 inf=float("inf") class Angle: #angle. kaku. def __init__(self,th): self.th = float(th)%(2*pi) def __float__(self): return self.th def __eq__(self,other): return abs(float(self)-float(other))<eps or abs(abs(float...
s950309135
p00204
u180584272
1426954531
Python
Python
py
Runtime Error
0
0
1126
from math import sqrt class Ufo: def __init__(self,px,py,d,vd,ui): self.pd=sqrt(px**2+py**2) self.px=float(px) self.py=float(py) self.ex=self.px/self.pd self.ey=self.py/self.pd self.d=float(d) self.vd=float(vd) self.vx=-self.vd*self.ex self.vy=-self.vd*self.ey self.i=ui def move(self): self.pd ...
s302007134
p00204
u180584272
1379862533
Python
Python
py
Runtime Error
0
0
2043
from sys import stdin from math import sqrt,fabs class Ufo: def __init__(self,x,y,r,v): self.x = x*1.0 self.y = y*1.0 self.r = r*1.0 self.v = v*1.0 self.d = sqrt(x**2+y**2) self.cs = self.x / self.d self.si = self.y / self.d self.vx = -self.v*self.cs self.vy = -self.v*self.si self.migigawa = (sel...
s103894157
p00204
u180584272
1379899208
Python
Python
py
Runtime Error
0
0
2075
from sys import stdin from math import sqrt,fabs class Ufo: def __init__(self,x,y,r,v): self.x = x*1.0 self.y = y*1.0 self.r = r*1.0 self.v = v*1.0 self.d = sqrt(x**2+y**2) self.cs = self.x / self.d self.si = self.y / self.d self.vx = -self.v*self.cs self.vy = -self.v*self.si def __str__(self): ...
s051983058
p00204
u180584272
1379900647
Python
Python
py
Runtime Error
0
0
2263
from sys import stdin from math import sqrt,fabs class Game: class Ufo: def __init__(self,x,y,r,v): self.x = x*1.0 self.y = y*1.0 self.r = r*1.0 self.v = v*1.0 self.d = sqrt(x**2+y**2) self.cs = self.x / self.d self.si = self.y / self.d self.vx = -self.v*self.cs self.vy = -self.v*self.si ...
s995100024
p00204
u180584272
1379901428
Python
Python
py
Runtime Error
0
0
2211
from sys import stdin from math import sqrt,fabs class Ufo: def __init__(self,x,y,r,v): self.x = x*1.0 self.y = y*1.0 self.r = r*1.0 self.v = v*1.0 self.d = sqrt(x**2+y**2) self.cs = self.x / self.d self.si = self.y / self.d self.vx = -self.v*self.cs self.vy = -self.v*self.si def __str__(self): ...
s108781852
p00204
u180584272
1379901757
Python
Python
py
Runtime Error
0
0
2204
import sys from math import sqrt,fabs class Ufo: def __init__(self,x,y,r,v): self.x = x*1.0 self.y = y*1.0 self.r = r*1.0 self.v = v*1.0 self.d = sqrt(x**2+y**2) self.cs = self.x / self.d self.si = self.y / self.d self.vx = -self.v*self.cs self.vy = -self.v*self.si def __str__(self): return "ufo...
s554376833
p00204
u180584272
1381653604
Python
Python
py
Runtime Error
0
0
2685
from math import sqrt,fabs class Ufo: def __init__(self,x,y,r,v): self.x = x*1.0 self.y = y*1.0 self.r = r*1.0 self.v = v*1.0 self.d = sqrt(x**2+y**2) self.cs = self.x / self.d self.si = self.y / self.d self.vx = -self.v*self.cs self.vy = -sel...
s502981427
p00204
u633068244
1396550452
Python
Python
py
Runtime Error
0
0
658
def isHit(a,b,ufo): D=abs(a*ufo[0]+b*ufo[1])/int((a**2+b**2)**0.5) return True if D<=ufo[2] else False while 1: R,N=map(int,raw_input().split()) if R==0:break ufos=[map(int,raw_input().split()) for i in range(N)] for i in range(N): ufos[i].append((ufos[i][0]**2+ufos[i][1]**2)**0.5) #ufos[i]=[x,y,r,v,d] invad...
s951956110
p00204
u633068244
1396550501
Python
Python
py
Runtime Error
0
0
716
def isHit(a,b,ufo): D=abs(a*ufo[0]+b*ufo[1])/int((a**2+b**2)**0.5) return True if D<=ufo[2] else False while 1: try: R,N=map(int,raw_input().split()) if R==0:break ufos=[map(int,raw_input().split()) for i in range(N)] for i in range(N): ufos[i].append((ufos[i][0]**2+ufos[i][1]**2)**0.5) #ufos[i]=[x,y,r...
s720922560
p00204
u633068244
1398078340
Python
Python
py
Runtime Error
0
0
1000
import math def isHit(a,b,ufo): if a*ufo[1]<=0 and -b*ufo[0]<=0:return False D=abs(a*ufo[0]+b*ufo[1])*ufo[4] if math.sqrt(ufo[4]**2-D**2)+math.sqrt(ufos[3]**2-D**2)<=R:return False return True if D<=ufo[2]+1e-7 else False while 1: R,N=map(int,raw_input().split()) if R==0:break ufos=[map(int,raw_input().split())...
s994874737
p00204
u633068244
1398078356
Python
Python
py
Runtime Error
0
0
999
import math def isHit(a,b,ufo): if a*ufo[1]<=0 and -b*ufo[0]<=0:return False D=abs(a*ufo[0]+b*ufo[1])*ufo[4] if math.sqrt(ufo[4]**2-D**2)+math.sqrt(ufo[3]**2-D**2)<=R:return False return True if D<=ufo[2]+1e-7 else False while 1: R,N=map(int,raw_input().split()) if R==0:break ufos=[map(int,raw_input().split()) ...
s405814786
p00204
u633068244
1398078502
Python
Python
py
Runtime Error
0
0
1024
import math def isHit(a,b,ufo): if a*ufo[1]<=0 and -b*ufo[0]<=0:return False D=abs(a*ufo[0]+b*ufo[1])*ufo[4] if D>ufo[2]: return False else: if math.sqrt(ufo[4]**2-D**2)+math.sqrt(ufo[3]**2-D**2)<=R: return False else: return True while 1: R,N=map(int,raw_input().split()) if R==0:break ufos=[map(...
s795548872
p00205
u567380442
1429020507
Python
Python3
py
Runtime Error
0
0
426
from sys import stdin readline = stdin.readline R, S, P = 1, 2, 3 W, L, D = 1, 2, 3 rps = { (R, S, P):{R:D, S:D, P:D}, (R, S) :{R:W, S:L}, (S, P) :{S:W, P:L}, (R, P) :{P:W, R:L} } while True: hand = int(readline()) if hand == 0: break hands = [hand] + [int(readline()) for _...
s334749352
p00205
u567380442
1429020633
Python
Python3
py
Runtime Error
0
0
426
from sys import stdin readline = stdin.readline R, S, P = 1, 2, 3 W, L, D = 1, 2, 3 rps = { (R, S, P):{R:D, S:D, P:D}, (R, S) :{R:W, S:L}, (S, P) :{S:W, P:L}, (R, P) :{P:W, R:L} } while True: hand = int(readline()) if hand == 0: break hands = [hand] + [int(readline()) for _...
s853927777
p00205
u567380442
1429020844
Python
Python3
py
Runtime Error
0
0
509
from sys import stdin readline = stdin.readline def main(): R, S, P = 1, 2, 3 W, L, D = 1, 2, 3 rps = { (R, S, P):{R:D, S:D, P:D}, (R, S) :{R:W, S:L}, (S, P) :{S:W, P:L}, (R, P) :{P:W, R:L} } while True: hand = int(readline()) if hand == 0: ...
s345566563
p00205
u567380442
1429020995
Python
Python3
py
Runtime Error
0
0
479
from sys import stdin readline = stdin.readline def main(): R, S, P = 1, 2, 3 W, L, D = 1, 2, 3 rps = { (R, S, P):{R:D, S:D, P:D}, (R, S) :{R:W, S:L}, (S, P) :{S:W, P:L}, (R, P) :{P:W, R:L} } while True: try: hands = [int(readline()) for _...
s462484664
p00205
u567380442
1429065866
Python
Python3
py
Runtime Error
0
0
467
from sys import stdin readline = stdin.readline from io import StringIO readline = StringIO('''1 2 3 2 1 1 2 2 2 1 0''').readline R, S, P = 1, 2, 3 # rock, scissors, paper W, L, D = 1, 2, 3 # win, lose, draw while True: hands = [] hands.append(int(readline())) if hands[0] == 0: break for _...
s181332284
p00205
u546285759
1486503591
Python
Python3
py
Runtime Error
0
0
428
while True: h1= int(input()) if h1== 0: break h2,h3,h4,h5= [int(input()) for _ in range(4)] l= [h1,h2,h3,h4,h5] if 1 and 2 and 3 in l: for _ in range(5): print("3") else: for i in range(5): if l[i]==1: print('1' if 2 in l '2') elif ...
s027372858
p00206
u104911888
1367120039
Python
Python
py
Runtime Error
0
0
238
while True: L=input() if L=0:break flag=True for i in range(1,13): M,N=map(int,raw_input().split()) L-=(M-N) if L<=0 and flag: print i flag=False else: print "NA"
s654791786
p00207
u266872031
1422088845
Python
Python
py
Runtime Error
0
0
1860
def tansaku(cl,nc,ok,goal): #currentlocation,nonchecked,ok,goal [clx,cly]=cl for i in range(clx-1,clx+2): for j in range(cly-1,cly+2): if [i,j] in nc: nc.remove([i,j]) ok.append([i,j]) tansaku([i,j],nc,ok,goal) while(1): [boardw,boardh]=[...
s956905537
p00207
u266872031
1422089150
Python
Python
py
Runtime Error
0
0
1860
def tansaku(cl,nc,ok,goal): #currentlocation,nonchecked,ok,goal [clx,cly]=cl for i in range(clx-1,clx+2): for j in range(cly-1,cly+2): if [i,j] in nc: nc.remove([i,j]) ok.append([i,j]) tansaku([i,j],nc,ok,goal) while(1): [boardw,boardh]=[...
s027564279
p00207
u266872031
1422089916
Python
Python
py
Runtime Error
0
0
1891
sys.setrecursionlimit(10000) def tansaku(cl,nc,ok,goal): #currentlocation,nonchecked,ok,goal [clx,cly]=cl for i in range(clx-1,clx+2): for j in range(cly-1,cly+2): if [i,j] in nc: nc.remove([i,j]) ok.append([i,j]) tansaku([i,j],nc,ok,goal) ...
s466309152
p00207
u266872031
1422200778
Python
Python
py
Runtime Error
0
0
1923
import sys sys.setrecursionlimit(10000) def tansaku(cl,nc,ok,goal): #currentlocation,nonchecked,ok,goal directions=[[-1,0],[1,0],[0,-1],[0,1]] [clx,cly]=cl for dd in directions: [i,j]=[clx+dd[0],cly+dd[1]] if [i,j] in nc: nc.remove([i,j]) ok.append([i,j]) ...
s707903039
p00207
u266872031
1422200896
Python
Python
py
Runtime Error
0
0
1924
import sys sys.setrecursionlimit(100000) def tansaku(cl,nc,ok,goal): #currentlocation,nonchecked,ok,goal directions=[[-1,0],[1,0],[0,-1],[0,1]] [clx,cly]=cl for dd in directions: [i,j]=[clx+dd[0],cly+dd[1]] if [i,j] in nc: nc.remove([i,j]) ok.append([i,j]) ...
s283491950
p00207
u685815919
1473655862
Python
Python
py
Runtime Error
0
0
1112
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 ...
s359050434
p00207
u755162050
1474357948
Python
Python3
py
Runtime Error
0
0
1793
def block(board, y, x, direction, color): # ??? if direction == 0: for i in range(2): for j in range(4): board[x + i][y + j] = color # ??± elif direction == 1: for i in range(2): for j in range(4): board[x + j][y + i] = color def ...
s176460558
p00207
u755162050
1474358116
Python
Python3
py
Runtime Error
0
0
1870
def block(board, y, x, direction, color): # ??? if direction == 0: for i in range(2): for j in range(4): board[x + i][y + j] = color # ??± elif direction == 1: for i in range(2): for j in range(4): board[x + j][y + i] = color def ...
s085144327
p00207
u755162050
1474358301
Python
Python3
py
Runtime Error
0
0
1878
def block(board, y, x, direction, color): # ??? if direction == 0: for i in range(2): for j in range(4): board[x + i][y + j] = color # ??± elif direction == 1: for i in range(2): for j in range(4): board[x + j][y + i] = color def ...
s340151461
p00207
u755162050
1474359222
Python
Python3
py
Runtime Error
0
0
1878
def block(board, y, x, direction, color): # ??? if direction == 0: for i in range(2): for j in range(4): board[x + i][y + j] = color # ??± elif direction == 1: for i in range(2): for j in range(4): board[x + j][y + i] = color def ...
s736452641
p00207
u755162050
1474371486
Python
Python3
py
Runtime Error
0
0
1823
""" Created by Jieyi on 9/20/16. """ def block(board, w, h, direction, color): # horizontal. if direction == 0: for i in range(2): for j in range(4): board[h + i][w + j] = color # vertical. elif direction == 1: for i in range(2): for j in range(4...
s560678933
p00207
u755162050
1474371672
Python
Python3
py
Runtime Error
0
0
1900
""" Created by Jieyi on 9/20/16. """ def block(board, w, h, direction, color): # horizontal. if direction == 0: for i in range(2): for j in range(4): board[h + i][w + j] = color # vertical. elif direction == 1: for i in range(2): for j in range(4...
s825320478
p00207
u227162786
1490017062
Python
Python3
py
Runtime Error
0
0
985
import numpy as np 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...
s057962999
p00207
u227162786
1490017352
Python
Python3
py
Runtime Error
0
0
994
import numpy as np 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...
s397279338
p00207
u227162786
1490017361
Python
Python3
py
Runtime Error
0
0
994
import numpy as np 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...
s963806860
p00207
u227162786
1490017757
Python
Python3
py
Runtime Error
0
0
993
import numpy as np 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...
s719740976
p00207
u227162786
1490018601
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...