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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
s701460795 | p01088 | u339921062 | 1499237013 | Python | Python | py | Runtime Error | 0 | 0 | 858 | while 1:
n = input()
if n == 0:
break
dp = [[None]*2001 for i in xrange(n+1)]
dp[0][0] = (0, 0)
for i in xrange(n):
cost = int(raw_input())
dost = cost % 1000
for j in xrange(2001):
if dp[i][j] is None:
continue
c, s = dp[i][j]
... |
s747885339 | p01088 | u339921062 | 1499237069 | Python | Python | py | Runtime Error | 0 | 0 | 860 | while 1:
n = input()
if n == 0:
break
dp = [[None]*10001 for i in xrange(n+1)]
dp[0][0] = (0, 0)
for i in xrange(n):
cost = int(raw_input())
dost = cost % 1000
for j in xrange(10001):
if dp[i][j] is None:
continue
c, s = dp[i][j... |
s013891867 | p01088 | u339921062 | 1499237564 | Python | Python | py | Runtime Error | 40000 | 193872 | 862 | while 1:
n = input()
if n == 0:
break
dp = [[None]*100001 for i in xrange(n+1)]
dp[0][0] = (0, 0)
for i in xrange(n):
cost = int(raw_input())
dost = cost % 1000
for j in xrange(100001):
if dp[i][j] is None:
continue
c, s = dp[i]... |
s620419307 | p01089 | u260980560 | 1499251330 | Python | Python | py | Runtime Error | 40000 | 9072 | 758 | while 1:
n = input()
if n == 0:
break
s = raw_input()
lock = 0
P = set()
for c in s:
if c is 'u':
lock = 0
else:
P.add((lock, 1 << int(c)))
lock |= 1 << int(c)
while 1:
Q = set()
for lock1, c1 in P:
for l... |
s125765327 | p01089 | u260980560 | 1499251614 | Python | Python | py | Runtime Error | 40000 | 8260 | 819 | while 1:
n = input()
if n == 0:
break
s = raw_input()
lock = 0
P = set()
for c in s:
if c is 'u':
lock = 0
else:
P.add((lock, 1 << int(c)))
lock |= 1 << int(c)
while 1:
Q = set()
for lock1, c1 in P:
for l... |
s860278814 | p01089 | u260980560 | 1499251906 | Python | Python | py | Runtime Error | 40000 | 468092 | 807 | while 1:
n = input()
if n == 0:
break
s = raw_input()
lock = 0
P = []
for c in s:
if c is 'u':
lock = 0
else:
P.append((lock, 1 << int(c)))
lock |= 1 << int(c)
Q = set()
i = 0
while i < len(P):
lock1, t1 = P[i]
... |
s797200585 | p01089 | u260980560 | 1499252091 | Python | Python | py | Runtime Error | 40000 | 468200 | 704 | while 1:
n = input()
if n == 0:
break
s = raw_input()
lock = 0
P = []
for c in s:
if c is 'u':
lock = 0
else:
P.append((lock, 1 << int(c)))
lock |= 1 << int(c)
Q = set()
i = 0; ok = 1
while i < len(P) and ok:
lock1, ... |
s895497682 | p01089 | u260980560 | 1499252279 | Python | Python | py | Runtime Error | 40000 | 7044 | 772 | while 1:
n = input()
if n == 0:
break
s = raw_input()
Q = set()
lock = 0
P = []
for c in s:
if c is 'u':
lock = 0
else:
v = (lock, 1 << int(c))
P.append(v)
Q.add(v)
lock |= 1 << int(c)
i = 0; ok = 1
w... |
s133907467 | p01093 | u777299405 | 1480060950 | Python | Python3 | py | Runtime Error | 0 | 0 | 234 | while True:
n = int(input())
a = sorted(list(map(int, input().split())))
if n == 0:
break
ans = 1000
for i in range(n - 1):
j = a[i + 1] - a[i]
if j < ans:
ans = j
print(ans) |
s767639648 | p01093 | u284260266 | 1526900845 | Python | Python3 | py | Runtime Error | 0 | 0 | 236 | while True:
n = int(input())
if n == 0:
break
a = list(map(int, input().split()))
l = []
for i in range(1, len(a)):
for j in range(i+1,len(a)):
l.append(abs(a[i]-a[j]))
print(min(l))
|
s667027367 | p01093 | u284260266 | 1526900944 | Python | Python3 | py | Runtime Error | 0 | 0 | 236 | while True:
n = int(input())
if n == 0:
break
a = list(map(int, input().split()))
l = []
for i in range(1, len(a)):
for j in range(i+1,len(a)):
l.append(abs(a[i]-a[j]))
print(min(l))
|
s213841414 | p01093 | u284260266 | 1526901170 | Python | Python3 | py | Runtime Error | 0 | 0 | 238 | while True:
n = int(input())
if n == 0:
break
a = list(map(int, input().split()))
l = []
for i in range(1, len(a)-1):
for j in range(i+1,len(a)):
l.append(abs(a[i]-a[j]))
print(min(l))
|
s850642771 | p01093 | u284260266 | 1526902123 | Python | Python3 | py | Runtime Error | 0 | 0 | 228 | while True:
n = int(input())
if n == 0:
break
a = list(map(int, input().split()))
l = []
for i in range(1, n-1):
for j in range(i+1,n):
l.append(abs(a[i]-a[j]))
print(min(l))
|
s526466677 | p01093 | u284260266 | 1526982829 | Python | Python3 | py | Runtime Error | 0 | 0 | 262 | while True:
n = int(input())
a = list(map(int, input().split()))
l = list()
for i in range(1, n-1):
for j in range(i+1,n):
l.append(abs(a[i]-a[j]))
if l = []:
break
if n == 0:
break
print(min(l))
|
s600872361 | p01093 | u951968562 | 1526986328 | Python | Python3 | py | Runtime Error | 0 | 0 | 350 | while True:
n,m = map(int,input().split())
if n == 0 and m == 0:
break
a = list(map(int,input().split()))
a.sort()
list1 = []
for i in range(n):
for j in range(i + 1, n):
price1 = a[i] + a[j]
list1.append(price1)
list1.sort()
list2 = list(filter(lambda p: m >= p, list1))
if list2:
print(max(li... |
s953547515 | p01093 | u284260266 | 1527049504 | Python | Python3 | py | Runtime Error | 0 | 0 | 266 | while True:
n = int(input())
a = list(map(int, input().split()))
l = list()
for i in range(1, n-1):
for j in range(i+1,n):
l.append(abs(a[i]-a[j]))
if l == []:
continue
if n == 0:
break
print(min(l))
|
s987877818 | p01093 | u284260266 | 1527053496 | Python | Python3 | py | Runtime Error | 0 | 0 | 326 | flg = True
while flg:
n = int(input())
if n == 0:
flg = False
a = list(map(int, input().split()))
l = list()
for i in range(0, n):
for j in range(0,n):
if i == j:
continue
l.append(abs(a[i]-a[j]))
if l == []:
continue
print(min... |
s984575841 | p01095 | u847467233 | 1531446110 | Python | Python3 | py | Runtime Error | 0 | 0 | 302 | # AOJ 1610: Bamboo Blossoms
# Python3 2018.7.13 bal4u
MAX = 7368792
cno = 0
tbl = [0]*MAX
while True:
m, n = map(int, input().split())
if m == 0: break
cno += 1
for i in range(n):
for j in range(m, MAX, m): tbl[j] = cno;
for j in range(m, MAX):
if tbl[j] != cno: break
m += 1
print(m)
|
s205726612 | p01095 | u847467233 | 1531446292 | Python | Python3 | py | Runtime Error | 0 | 0 | 306 | # AOJ 1610: Bamboo Blossoms
# Python3 2018.7.13 bal4u
MAX = 7368792
cno = 0
tbl = [0]*(MAX+2)
while True:
m, n = map(int, input().split())
if m == 0: break
cno += 1
for i in range(n):
for j in range(m, MAX, m): tbl[j] = cno;
for j in range(m, MAX):
if tbl[j] != cno: break
m += 1
print(m)
|
s766713576 | p01095 | u847467233 | 1531446921 | Python | Python3 | py | Runtime Error | 0 | 0 | 327 | # AOJ 1610: Bamboo Blossoms
# Python3 2018.7.13 bal4u
MAX = 7368792
cno = 0
tbl = [0]*(MAX+2)
while True:
m, n = map(int, input().split())
if m == 0: break
tbl = [0] * (MAX+1)
for i in range(n):
for j in range(m, MAX, m): tbl[j] = 1
k = m
for j in range(m, MAX):
if not tbl[j]: break
k += 1
m = k
pri... |
s216514586 | p01095 | u260980560 | 1482767311 | Python | Python | py | Runtime Error | 40000 | 162372 | 329 | while 1:
m, n = map(int, raw_input().split())
if m == 0:
break
MAX = 10**7
p= [0]*(MAX+1)
i = m
cnt = 0
while 1:
if not p[i]:
if cnt == n:
break
for j in xrange(i, MAX, i):
p[j] = 1
cnt += 1
i += 1
... |
s622334924 | p01095 | u260980560 | 1482767560 | Python | Python | py | Runtime Error | 40000 | 84448 | 340 | MAX = 10**7
p = [0]*(MAX+1)
t = 1
while 1:
m, n = map(int, raw_input().split())
if m == 0:
break
i = m
cnt = 0
while 1:
if p[i] != t:
if cnt == n:
break
for j in xrange(i, MAX, i):
p[j] = t
cnt += 1
i += 1
... |
s402507140 | p01095 | u260980560 | 1482768650 | Python | Python | py | Runtime Error | 0 | 0 | 756 | import math
MAX = 7400000
prime = [1]*MAX
prime[0] = prime[1] = 0
res = []
sq = int(math.sqrt(MAX))
for i in xrange(2, sq+1):
q = len(res)
if prime[i]:
res.append(i)
for j in xrange(i*i, MAX, i):
prime[j] = 0
prime[i] = q
for i in xrange(sq+1, MAX):
q = len(res)
if prime[... |
s304227547 | p01095 | u260980560 | 1482769086 | Python | Python | py | Runtime Error | 40000 | 84316 | 368 | MAX = 10**7
p = [0]*(MAX+1)
t = 1
while 1:
m, n = map(int, raw_input().split())
if m == 0:
break
i = m
cnt = 0
while 1:
if p[i] != t:
if cnt == n:
break
j = i
while j < MAX:
p[j] = t
j += i
... |
s463498969 | p01095 | u078042885 | 1483690624 | Python | Python3 | py | Runtime Error | 40000 | 122688 | 281 | while 1:
m,n=map(int,input().split())
if n==0:break
a=[0]*7368792
b,c=m,0
while c!=n:
if a[b]==0:
i=1
c+=1
while i*b<7368792:
a[i*b]=1
i+=1
b+=1
while a[b]:b+=1
print(b) |
s681865966 | p01095 | u078042885 | 1483690938 | Python | Python3 | py | Runtime Error | 40000 | 122652 | 281 | while 1:
m,n=map(int,input().split())
if m==0:break
a=[0]*7368792
b,c=m,0
while c!=n:
if a[b]==0:
i=1
c+=1
while i*b<7368792:
a[i*b]=1
i+=1
b+=1
while a[b]:b+=1
print(b) |
s360718062 | p01095 | u078042885 | 1483691007 | Python | Python3 | py | Runtime Error | 40000 | 122672 | 284 | while 1:
m,n=map(int,input().split())
if m==n==0:break
a=[0]*7368792
b,c=m,0
while c!=n:
if a[b]==0:
i=1
c+=1
while i*b<7368792:
a[i*b]=1
i+=1
b+=1
while a[b]:b+=1
print(b) |
s179609452 | p01095 | u078042885 | 1483691188 | Python | Python3 | py | Runtime Error | 40000 | 294560 | 285 | while 1:
m,n=map(int,input().split())
if m==n==0:break
a=[0]*18368792
b,c=m,0
while c!=n:
if a[b]==0:
i=1
c+=1
while i*b<7368792:
a[i*b]=1
i+=1
b+=1
while a[b]:b+=1
print(b) |
s561124578 | p01095 | u078042885 | 1483692610 | Python | Python3 | py | Runtime Error | 40000 | 122764 | 282 | while 1:
m,n=map(int,input().split())
if m==0:break
a=[0]*7368792
b=m
while 1:
if not a[b]:
if n==0:
print(b)
break
n-=1
for i in range(b,7368792,b):
a[i]=1
b+=1 |
s935009943 | p01095 | u078042885 | 1483693762 | Python | Python3 | py | Runtime Error | 40000 | 123320 | 263 | while 1:
m,n=map(int,input().split())
if m==0:break
a=[0]*7400000
b=m
while 1:
if 0==a[b]:
if n==0:
print(b)
break
n-=1
for i in range(b,7368792,b):a[i]=1
b+=1 |
s538086341 | p01095 | u078042885 | 1483801061 | Python | Python3 | py | Runtime Error | 40000 | 123236 | 261 | while 1:
m,n=map(int,input().split())
if m==0:break
a=[True]*7400000
while 1:
if a[m]:
if n==0:
print(m)
break
n-=1
for i in range(m*2,7368792,m):a[i]=False
m+=1 |
s264343171 | p01095 | u078042885 | 1484579425 | Python | Python3 | py | Runtime Error | 40000 | 123236 | 215 | while 1:
m,n=map(int,input().split())
if n==0:break
a=[False]*7400000
while n:
while a[m]:m+=1
n-=1
for i in range(m,7368792,m):a[i]=True
while a[m]:m+=1
print(m) |
s793450632 | p01095 | u078042885 | 1484579639 | Python | Python3 | py | Runtime Error | 40000 | 123156 | 218 | while 1:
m,n=map(int,input().split())
if n==m==0:break
a=[False]*7400000
while n:
while a[m]:m+=1
n-=1
for i in range(m,7368792,m):a[i]=True
while a[m]:m+=1
print(m) |
s729632731 | p01095 | u408260374 | 1493397915 | Python | Python3 | py | Runtime Error | 40000 | 122764 | 416 | while True:
M, N = map(int, input().split())
if M == N == 0:
break
INF = 7368791
P = [False] * (INF + 1)
cnt = 0
for i in range(M, INF + 1):
if cnt >= N:
break
if not P[i]:
for j in range(i, INF + 1, i):
P[j] = True
cnt ... |
s094907007 | p01095 | u408260374 | 1493398093 | Python | Python3 | py | Runtime Error | 40000 | 555476 | 558 | memo = dict()
while True:
M, N = map(int, input().split())
if M == N == 0:
break
if (M, N) in memo:
print(memo[(M, N)])
continue
INF = 7368791
P = [False] * (INF + 1)
cnt = 0
for i in range(M, INF + 1):
if cnt >= N:
break
if not P[i]:
... |
s526846216 | p01095 | u408260374 | 1493398194 | Python | Python | py | Runtime Error | 40000 | 744472 | 632 | import sys
if sys.version[0] == '2':
range, input = xrange, raw_input
memo = dict()
while True:
M, N = map(int, input().split())
if M == N == 0:
break
if (M, N) in memo:
print(memo[(M, N)])
continue
INF = 7368791
P = [False] * (INF + 1)
cnt = 0
for i in range(M, I... |
s778795368 | p01095 | u408260374 | 1493398357 | Python | Python3 | py | Runtime Error | 40000 | 432020 | 674 | import sys
if sys.version[0] == '2':
range, input = xrange, raw_input
memo = dict()
INF = 7368791
P = [False] * (INF + 1)
while True:
M, N = map(int, input().split())
if M == N == 0:
break
if (M, N) in memo:
print(memo[(M, N)])
continue
for i in range(INF + 1):
P[i] =... |
s311452541 | p01095 | u408260374 | 1493398411 | Python | Python | py | Runtime Error | 40000 | 477004 | 674 | import sys
if sys.version[0] == '2':
range, input = xrange, raw_input
memo = dict()
INF = 7368791
P = [False] * (INF + 1)
while True:
M, N = map(int, input().split())
if M == N == 0:
break
if (M, N) in memo:
print(memo[(M, N)])
continue
for i in range(INF + 1):
P[i] =... |
s121273934 | p01095 | u506554532 | 1514541539 | Python | Python3 | py | Runtime Error | 0 | 0 | 376 | MAX = 7368800
while True:
M,N = map(int,input().split())
if M == 0: break
sieve = [0,0] + [1]*MAX
m = M
cnt = 0
while True:
if sieve[m]:
if cnt < N:
cnt += 1
for n in range(2*m,MAX+1,m):
sieve[n] = 0
else:
... |
s727504191 | p01095 | u506554532 | 1514551383 | Python | Python3 | py | Runtime Error | 0 | 0 | 556 | MAX = 7368800
src = [[] for i in range(101)]
i = 0
while True:
m,n = map(int,input().split())
if m == 0: break
src[m].append((n,i))
i += 1
Q = i
ans = [None] * Q
for m,qs in enumerate(src):
if len(qs) == 0: continue
qs.sort()
sieve = [0,0] + [1]*MAX
maxn = qs[-1][0]
tmp = []
n ... |
s707051112 | p01095 | u506554532 | 1514551585 | Python | Python3 | py | Runtime Error | 0 | 0 | 569 | MAX = 7368800
src = [[] for i in range(101)]
i = 0
while True:
m,n = map(int,input().split())
if m == 0: break
src[m].append((n,i))
i += 1
Q = i
ans = [None] * Q
for m,qs in enumerate(src):
if len(qs) == 0: continue
qs.sort()
sieve = [0,0] + [1]*MAX
maxn = qs[-1][0]
tmp = []
n ... |
s929453667 | p01095 | u269391636 | 1523370470 | Python | Python3 | py | Runtime Error | 0 | 0 | 230 | while(True):
a = list(map(int, input().split()))
m , n = a[0], a[1]
if m == 0:
break
lis = [i for i in range(m,n * 16)]
for i in range(n):
lis = [i for i in lis if i % lis[0]]
print(lis[0])
|
s277780564 | p01095 | u269391636 | 1523376465 | Python | Python3 | py | Runtime Error | 0 | 0 | 528 | def main():
a = list(map(int, input().split()))
m , n = a[0], a[1]
if m == 0:
return 1
print(sieve(m,n)[0])
return 0
def mark(s, x):
for i in range(x, len(s), x):
s[i] = False
def sieve(m,n):
s = [False] * m + [True] * 16 * n
count = 0
for x in range(m,n * 16):
... |
s060387343 | p01095 | u269391636 | 1523376595 | Python | Python3 | py | Runtime Error | 0 | 0 | 527 | def main():
a = list(map(int, input().split()))
m , n = a[0], a[1]
if m == 0:
return 1
print(sieve(m,n)[0])
return 0
def mark(s, x):
for i in range(x, len(s), x):
s[i] = False
def sieve(m,n):
s = [False] * m + [True] * 16 * n
count = 0
for x in range(m,n * 8):
... |
s752960040 | p01095 | u269391636 | 1523376762 | Python | Python3 | py | Runtime Error | 0 | 0 | 528 | def main():
a = list(map(int, input().split()))
m , n = a[0], a[1]
if m == 0:
return 1
print(sieve(m,n)[0])
return 0
def mark(s, x):
for i in range(x, len(s), x):
s[i] = False
def sieve(m,n):
s = [False] * m + [True] * 16 * n
count = 0
for x in range(m,n * 16):
... |
s190001670 | p01095 | u269391636 | 1523376870 | Python | Python | py | Runtime Error | 0 | 0 | 528 | def main():
a = list(map(int, input().split()))
m , n = a[0], a[1]
if m == 0:
return 1
print(sieve(m,n)[0])
return 0
def mark(s, x):
for i in range(x, len(s), x):
s[i] = False
def sieve(m,n):
s = [False] * m + [True] * 16 * n
count = 0
for x in range(m,n * 16):
... |
s169063043 | p01095 | u269391636 | 1523376889 | Python | Python3 | py | Runtime Error | 0 | 0 | 528 | def main():
a = list(map(int, input().split()))
m , n = a[0], a[1]
if m == 0:
return 1
print(sieve(m,n)[0])
return 0
def mark(s, x):
for i in range(x, len(s), x):
s[i] = False
def sieve(m,n):
s = [False] * m + [True] * 16 * n
count = 0
for x in range(m,n * 16):
... |
s457611758 | p01095 | u269391636 | 1523377054 | Python | Python3 | py | Runtime Error | 0 | 0 | 470 | def mark(s, x):
for i in range(x, len(s), x):
s[i] = False
def sieve(m,n):
s = [False] * m + [True] * 16 * n
count = 0
for x in range(m,n * 16):
if s[x]:
mark(s, x)
count += 1
if count == n:
break
return [i for i in range(len(s)) i... |
s049190757 | p01095 | u269391636 | 1523377302 | Python | Python3 | py | Runtime Error | 0 | 0 | 518 | def mark(s, x):
for i in range(x, len(s), x):
s[i] = False
def sieve(m,n):
s = [False] * m + [True] * 16 * n
count = 0
for x in range(m,n * 16):
if s[x]:
mark(s, x)
count += 1
if count == n:
break
return [i for i in range(len(s)) i... |
s373325765 | p01095 | u011621222 | 1526636874 | Python | Python3 | py | Runtime Error | 0 | 0 | 471 | import sys
sys.setrecursionlimit(10000)
def f(start, goal):
global C
for i in range(start, goal):
for j in range(m, (i//2)+1):
if (i%j == 0):
C += 1
f(i+1, C)
while 1:
m, n = map(int, input().split())
if (m == 0 and n == 0):
break;
if (n < m):
print(m + n)
elif (n == m):
print(m + n + 1)
... |
s133708705 | p01095 | u509278866 | 1528185186 | Python | Python3 | py | Runtime Error | 0 | 0 | 1016 | import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools
sys.setrecursionlimit(10**7)
inf = 10**20
eps = 1.0 / 10**10
mod = 998244353
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF... |
s786971577 | p01095 | u509278866 | 1528186389 | Python | Python3 | py | Runtime Error | 0 | 0 | 960 | import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools
sys.setrecursionlimit(10**7)
inf = 10**20
eps = 1.0 / 10**10
mod = 998244353
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF... |
s290890615 | p01095 | u509278866 | 1528186671 | Python | Python3 | py | Runtime Error | 0 | 0 | 970 | import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools
sys.setrecursionlimit(10**7)
inf = 10**20
eps = 1.0 / 10**10
mod = 998244353
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF... |
s950475272 | p01095 | u509278866 | 1528186757 | Python | Python3 | py | Runtime Error | 0 | 0 | 960 | import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools
sys.setrecursionlimit(10**7)
inf = 10**20
eps = 1.0 / 10**10
mod = 998244353
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF... |
s261075656 | p01095 | u284260266 | 1529038218 | Python | Python3 | py | Runtime Error | 0 | 0 | 356 | while True:
m, n = map(int,input().split())
if m == 0 and n == 0:
break
den = [m]
for i in range(m+1, 1000000, 1):
den.append(i)
for j in range(0, len(den)-1, 1):
if i%den[j] == 0:
den.remove(i)
break
if len(den) > n:
... |
s409084010 | p01095 | u531592024 | 1529656813 | Python | Python3 | py | Runtime Error | 0 | 0 | 433 | while True:
(n, m) = list(map(int, input().split()))
if n == 0:
break
arr = [n]
app = arr.append
arrsize = 1
i = n + 1
while True:
ge = True
for e in arr:
if i % e == 0:
ge = False
break
if ge:
app(i)
... |
s186776166 | p01095 | u284260266 | 1529820855 | Python | Python3 | py | Runtime Error | 0 | 0 | 464 | while True:
m, n = map(int,input().split())
if m == 0 and n == 0:
break
sea = []
pri = []
for i in range(m, 7368792):
sea.append(True)
for i in range(0, m):
sea[i] = False
for i in range(m, len(sea)):
if sea[i] == True:
pri.append(i)
if... |
s721795918 | p01095 | u284260266 | 1529820980 | Python | Python3 | py | Runtime Error | 0 | 0 | 491 | while True:
m, n = map(int,input().split())
if m == 0 and n == 0:
break
sea = list()
pri = list()
for i in range(m, 7368792):
sea.append(True)
#print(sea)
for i in range(0, m):
sea[i] = False
for i in range(m, len(sea)):
if sea[i] == True:
... |
s526095847 | p01095 | u284260266 | 1529821777 | Python | Python3 | py | Runtime Error | 0 | 0 | 1525 | while True:
m, n = map(int,input().split())
if m == 0 and n == 0:
break
sea = []
pri = []
for i in range(0, 7368792):
sea.append(True)
#print(sea)
"""くそ長すぎて笑える
for i in range(0, 7368792-m):
pri.append(sea[i])
print(sea[i], i,"in")
for i in range(0,... |
s173148869 | p01095 | u284260266 | 1529822493 | Python | Python3 | py | Runtime Error | 0 | 0 | 483 | while True:
m, n = map(int,input().split())
if m == 0 and n == 0:
break
sea = []
pri = []
for i in range(0, 7368792):
sea.append(True)
#print(sea)
for i in range(0, m):
sea[i] = False
for i in range(m, len(sea)):
if sea[i] == True:
pri.appe... |
s460192466 | p01095 | u284260266 | 1529823607 | Python | Python3 | py | Runtime Error | 0 | 0 | 503 | while True:
m, n = map(int,input().split())
if m == 0 and n == 0:
break
sea = []
#pri = []
co = 0
for i in range(0, 7368792):
sea.append(True)
for i in range(0, m):
sea[i] = False
for i in range(m, len(sea)):
if sea[i] == True:
co = co + 1
... |
s363386788 | p01095 | u284260266 | 1529824946 | Python | Python3 | py | Runtime Error | 0 | 0 | 458 | while True:
m, n = map(int,input().split())
if m == 0 and n == 0:
break
sea = []
#pri = []
co = 0
for i in range(m, 7368792):
sea.append(True)
for i in range(0, len(sea)):
if sea[i] == True:
co = co + 1
#pri.append(i)
if co > n:
... |
s118576174 | p01095 | u284260266 | 1530088061 | Python | Python3 | py | Runtime Error | 0 | 0 | 430 | while True:
m, n = map(int,input().split())
if m == 0 and n == 0:
break
sea = []
#pri = []
co = 0
sea = [True]*(7368792-m)
for i in range(0, len(sea)):
if sea[i] == True:
co = co + 1
#pri.append(i)
if co > n:
print(sea.index... |
s895266960 | p01095 | u284260266 | 1530090613 | Python | Python3 | py | Runtime Error | 0 | 0 | 364 | while True:
m, n = map(int,input().split())
if m == 0 and n == 0:
break
sea = [True]*(7368792-m)
co = 0
for i in range(0, len(sea)):
if sea[i] == True:
co = co + 1
if co > n:
break
for j in range(i, len(sea), i+m):
s... |
s445116206 | p01095 | u284260266 | 1530150221 | Python | Python3 | py | Runtime Error | 0 | 0 | 364 | while True:
m, n = map(int,input().split())
if m == 0 and n == 0:
break
sea = [True]*(7368792-m)
co = 0
for i in range(0, len(sea)):
if sea[i] == True:
co = co + 1
if co > n:
break
for j in range(i, len(sea), i+m):
s... |
s627146919 | p01095 | u284260266 | 1530170958 | Python | Python3 | py | Runtime Error | 0 | 0 | 364 | while True:
m, n = map(int,input().split())
if m == 0 and n == 0:
break
sea = [True]*(7368792-m)
co = 0
for i in range(0, len(sea)):
if sea[i] == True:
co = co + 1
if co > n:
break
for j in range(i, len(sea), i+m):
s... |
s960042212 | p01095 | u284260266 | 1530172336 | Python | Python3 | py | Runtime Error | 0 | 0 | 453 | a = 0
while True:
m, n = map(int,input().split())
if m == 0 and n == 0 and a == 0:
a = a+1
continue
elif m == 0 and n == 0 and a == 1:
break
sea = [True]*(7368792-m)
co = 0
for i in range(0, len(sea)):
if sea[i] == True:
co = co + 1
if co >... |
s748788803 | p01095 | u284260266 | 1530172443 | Python | Python3 | py | Runtime Error | 0 | 0 | 353 | while True:
m, n = map(int,input().split())
if m == 0:
break
sea = [True]*(7368792-m)
co = 0
for i in range(0, len(sea)):
if sea[i] == True:
co = co + 1
if co > n:
break
for j in range(i, len(sea), i+m):
sea[j] = Fal... |
s477768220 | p01095 | u284260266 | 1530172568 | Python | Python3 | py | Runtime Error | 0 | 0 | 353 | while True:
m, n = map(int,input().split())
if m == 0:
break
sea = [True]*(7500111-m)
co = 0
for i in range(0, len(sea)):
if sea[i] == True:
co = co + 1
if co > n:
break
for j in range(i, len(sea), i+m):
sea[j] = Fal... |
s976131361 | p01095 | u284260266 | 1530181060 | Python | Python3 | py | Runtime Error | 0 | 0 | 364 | while True:
m, n = map(int,input().split())
if m == 0 and n == 0:
break
sea = [True]*(7368792-m)
co = 0
for i in range(0, len(sea)):
if sea[i] == True:
co = co + 1
if co > n:
break
for j in range(i, len(sea), i+m):
s... |
s653917404 | p01095 | u012868265 | 1530181545 | Python | Python3 | py | Runtime Error | 0 | 0 | 376 | while True:
m, n = map(int,input().split())
if m == 0 and n == 0:
break
sea = [True]*(7368792-m)
co = 0
for i in range(0, len(sea)):
if sea[i] == True:
co = co + 1
if co > n:
break
for j in range(i, len(sea), i+m):
... |
s218562894 | p01095 | u012868265 | 1530181578 | Python | Python | py | Runtime Error | 0 | 0 | 376 | while True:
m, n = map(int,input().split())
if m == 0 and n == 0:
break
sea = [True]*(7368792-m)
co = 0
for i in range(0, len(sea)):
if sea[i] == True:
co = co + 1
if co > n:
break
for j in range(i, len(sea), i+m):
... |
s154876218 | p01095 | u012868265 | 1530181731 | Python | Python | py | Runtime Error | 0 | 0 | 385 | while True:
m, n = map(int,input().split())
if m == 0 and n == 0:
break
sea = 8000000 #[True]*(7368792-m)
co = 0
for i in range(0, len(sea)):
if sea[i] == True:
co = co + 1
if co > n:
break
for j in range(i, len(sea), i+m... |
s535437423 | p01095 | u012868265 | 1530181751 | Python | Python | py | Runtime Error | 0 | 0 | 392 | while True:
m, n = map(int,input().split())
if m == 0 and n == 0:
break
sea = [True]*8000000 #[True]*(7368792-m)
co = 0
for i in range(0, len(sea)):
if sea[i] == True:
co = co + 1
if co > n:
break
for j in range(i, len(se... |
s869909357 | p01095 | u012868265 | 1530181760 | Python | Python | py | Runtime Error | 0 | 0 | 372 | while True:
m, n = map(int,input().split())
if m == 0 and n == 0:
break
sea = [True]*8000000
co = 0
for i in range(0, len(sea)):
if sea[i] == True:
co = co + 1
if co > n:
break
for j in range(i, len(sea), i+m):
... |
s099581370 | p01095 | u012868265 | 1530181769 | Python | Python3 | py | Runtime Error | 0 | 0 | 372 | while True:
m, n = map(int,input().split())
if m == 0 and n == 0:
break
sea = [True]*8000000
co = 0
for i in range(0, len(sea)):
if sea[i] == True:
co = co + 1
if co > n:
break
for j in range(i, len(sea), i+m):
... |
s337696279 | p01095 | u012868265 | 1530182276 | Python | Python3 | py | Runtime Error | 0 | 0 | 364 | while True:
m, n = map(int,input().split())
if m == 0 and n == 0:
break
sea = [True]*(7368792-m)
co = 0
for i in range(0, len(sea)):
if sea[i] == True:
co = co + 1
if co > n:
break
for j in range(i, len(sea), i+m):
s... |
s446664490 | p01095 | u012868265 | 1530184183 | Python | Python3 | py | Runtime Error | 0 | 0 | 370 | while True:
m, n = list(map(int,input().split()))
if m == 0 and n == 0:
break
sea = [True]*(7368792-m)
co = 0
for i in range(0, len(sea)):
if sea[i] == True:
co = co + 1
if co > n:
break
for j in range(i, len(sea), i+m):
... |
s982432252 | p01095 | u284260266 | 1530184200 | Python | Python3 | py | Runtime Error | 0 | 0 | 477 | while True:
m, n = map(int,input().split())
if m == 0 and n == 0:
break
sea = [True]*(7368792-m)
co = 0
for i in range(0, len(sea)):
if sea[i] == True:
co = co + 1
if co > n:
break
for j in range(i, len(sea), i+m):
s... |
s957325362 | p01095 | u012868265 | 1530185310 | Python | Python3 | py | Runtime Error | 0 | 0 | 373 | while True:
m, n = [int(i) for i in input().split()]
if m == 0 and n == 0:
break
sea = [True]*(7368792-m)
co = 0
for i in range(0, len(sea)):
if sea[i] == True:
co = co + 1
if co > n:
break
for j in range(i, len(sea), i+m):
... |
s253069351 | p01095 | u012868265 | 1530185575 | Python | Python3 | py | Runtime Error | 0 | 0 | 408 | while True:
m, n = [int(i) for i in input().split()]
if m == 0 and n == 0:
break
sea = [True for i in range(0,7368792-m)]#[True]*(7368792-m)
co = 0
for i in range(0, len(sea)):
if sea[i] == True:
co = co + 1
if co > n:
break
for j i... |
s331555246 | p01095 | u012868265 | 1530185801 | Python | Python3 | py | Runtime Error | 0 | 0 | 501 | while True:
m, n = [int(i) for i in input().split()]
if m == 0 and n == 0:
break
sea = [True for i in range(0,7368792-m)]#[True]*(7368792-m)
co = 0
for i in range(0, len(sea)):
if sea[i] == True:
co = co + 1
if co > n:
break
for j i... |
s428545267 | p01095 | u855199458 | 1530256460 | Python | Python3 | py | Runtime Error | 0 | 0 | 355 | def inpl(): return list(map(int, input().split()))
M, N = inpl()
lim = 7368791 + 1
while N:
years = [False]*(lim)
for i in range(M, lim):
if years[i] == False:
if N == 0:
print(i)
break
for j in range(i, lim, i):
years[j] = True
... |
s268746049 | p01096 | u808689778 | 1535692617 | Python | Python3 | py | Runtime Error | 0 | 0 | 610 | n = int(input())
if n == 0:
break
w = list(map(int, input().split()))
dp = [[-1 for j in range(n + 1)] for i in range(n + 1)]
def rec(l, r):
# 既に計算済み?
if dp[l][r] != -1:
return dp[l][r]
# これ以上取り除けない?
if abs(l - r) <= 1:
return 0
res = 0
# パターン1.
if abs(w[l] - w[r - 1]... |
s069161768 | p01096 | u408260374 | 1493641783 | Python | Python3 | py | Runtime Error | 40000 | 9108 | 572 | while True:
N = int(input())
if not N:
break
W = [int(x) for x in input().split()]
dp = [[0] * N for _ in range(N)]
for w in range(2, N + 1):
for left in range(N - w + 1):
# [left, right]
right = left + w - 1
for mid in range(left + 1, right):
... |
s278654131 | p01096 | u408260374 | 1493641896 | Python | Python3 | py | Runtime Error | 40000 | 9140 | 597 | while True:
N = int(input())
if not N:
break
W = [int(x) for x in input().split()]
dp = [[0] * N for _ in range(N)]
for w in range(2, N + 1):
for left in range(N - w + 1):
# [left, right]
right = left + w - 1
if right - left - 1 == dp[left + 1][rig... |
s629616152 | p01096 | u408260374 | 1493641938 | Python | Python | py | Runtime Error | 40000 | 7728 | 671 | import sys
if sys.version[0] == '2':
range, input = xrange, raw_input
while True:
N = int(input())
if not N:
break
W = [int(x) for x in input().split()]
dp = [[0] * N for _ in range(N)]
for w in range(2, N + 1):
for left in range(N - w + 1):
# [left, right]
... |
s432813408 | p01096 | u408260374 | 1493642473 | Python | Python | py | Runtime Error | 40000 | 7732 | 807 | import sys
if sys.version[0] == '2':
range, input = xrange, raw_input
while True:
N = int(input())
if not N:
break
W = [int(x) for x in input().split()]
dp = [[0] * N for _ in range(N)]
for i in range(N-1):
if abs(W[i] - W[i + 1]) <= 1:
dp[i][i + 1] = 2
for w in r... |
s743607675 | p01096 | u408260374 | 1493643617 | Python | Python | py | Runtime Error | 0 | 0 | 956 | import sys
if sys.version[0] == '2':
range, input = xrange, raw_input
ans = []
idx = [x for x in reversed(range(300))]
for i in range(299):
idx[i + 1] += idx[i]
def dec(l, r):
return idx[l] + r - l
while True:
N = int(input())
if not N:
break
W = [int(x) for x in input().split()]
d... |
s566194934 | p01096 | u667806071 | 1496732499 | Python | Python3 | py | Runtime Error | 0 | 0 | 674 | def shot(i, daruma):
if i >= len(daruma):
results.append(n - len(daruma))
return
string = "_".join(map(str, daruma))
if dp[i].get(string):
return
dp[i][string] = True
shot(i + 1, daruma[:])
if abs(daruma[i - 1] - daruma[i]) <= 1:
del daruma[i]
del daruma... |
s527730074 | p01096 | u766926358 | 1526645568 | Python | Python3 | py | Runtime Error | 0 | 0 | 512 | def f(daruma):
global flag, min
if (flag):
return
length = len(daruma)
if (daruma == 0 or daruma == 1):
print(n - length)
flag = true
return
for i in range(length-1):
diff = abs(daruma[i] - daruma[i+1])
if (diff < 2):
kari_daruma = daruma[:i] + daruma[i+2:]
f(kari_daruma)
else:
min = (min if... |
s044055955 | p01096 | u766926358 | 1526645712 | Python | Python3 | py | Runtime Error | 0 | 0 | 552 | import sys
sys.setrecursionlimit(10000)
def f(daruma):
global flag, min
if (flag):
return
length = len(daruma)
if (daruma == 0 or daruma == 1):
print(n - length)
flag = true
return
for i in range(length-1):
diff = abs(daruma[i] - daruma[i+1])
if (diff < 2):
kari_daruma = daruma[:i] + daruma[i+2:]
... |
s018241908 | p01096 | u766926358 | 1526646185 | Python | Python3 | py | Runtime Error | 0 | 0 | 553 | import sys
sys.setrecursionlimit(10000)
def f(daruma):
global flag, min
if (flag):
return
length = len(daruma)
if (daruma == 0 or daruma == 1):
print(n - length)
flag = true
return
for i in range(length-1):
diff = abs(daruma[i] - daruma[i+1])
if (diff < 2):
kari_daruma = daruma[:i] + daruma[i+2:]... |
s904457969 | p01096 | u766926358 | 1526646248 | Python | Python3 | py | Runtime Error | 0 | 0 | 553 | import sys
sys.setrecursionlimit(10000)
def f(daruma):
global flag, min
if (flag):
return
length = len(daruma)
if (daruma == 0 or daruma == 1):
print(n - length)
flag = true
return
for i in range(length-1):
diff = abs(daruma[i] - daruma[i+1])
if (diff < 2):
kari_daruma = daruma[:i] + daruma[i+2:]... |
s987518138 | p01097 | u260980560 | 1482762240 | Python | Python | py | Runtime Error | 0 | 0 | 2724 | from collections import deque
while 1:
n, k, s = map(int, raw_input().split())
if n==0:
break
ps = [map(int, raw_input().split()) for i in xrange(n)]
G = [[] for i in xrange(n)]
for i in xrange(n):
xi, yi, zi = ps[i]
for j in xrange(i, n):
if i==j: continue
... |
s547854722 | p01097 | u260980560 | 1482762379 | Python | Python | py | Runtime Error | 0 | 0 | 2791 | from collections import deque
def ipt():
while 1:
try:
return raw_input()
except:pass
while 1:
n, k, s = map(int, ipt().split())
if n==0:break
ps = [map(int, ipt().split()) for i in xrange(n)]
G = [[] for i in xrange(n)]
for i in xrange(n):
xi, yi, zi = ps[i]... |
s335048086 | p01097 | u408260374 | 1495152573 | Python | Python3 | py | Runtime Error | 0 | 0 | 3717 | class Cube:
def __init__(self, x, y, z, s):
self.x, self.y, self.z = x, y, z
self.s = s
def is_in_cube(self, x, y, z):
return self.x <= x <= self.x + self.s and self.y <= y <= self.y + self.s and self.z <= z <= self.z + self.s
def intersect(self, C):
dxyz = [(0, 0, 0),
... |
s194927511 | p01097 | u260980560 | 1499912738 | Python | Python | py | Runtime Error | 0 | 0 | 2538 | from collections import deque
while 1:
n, k, s = map(int, raw_input().split())
if n==0:break
ps = [map(int, raw_input().split()) for i in xrange(n)]
G = [[] for i in xrange(n)]
for i in xrange(n):
xi, yi, zi = ps[i]
for j in xrange(i+1, n):
if i==j: continue
... |
s885597924 | p01101 | u866872417 | 1530964195 | Python | Python3 | py | Runtime Error | 0 | 0 | 371 | while(True):
n,m=map(int,input().split(" "))
if(n==0):
break
things = map(int,input().split(" "))
_max=0
for i in range(len(things)):
for j in range(i+1,len(things)):
ifthings[ i]+things[j] <= m:
_max = max(things[i]+things[j],_max):
if _max != None:
... |
s717113790 | p01101 | u595788415 | 1555901613 | Python | Python | py | Runtime Error | 0 | 0 | 442 | while True:
n, m = map(int, input().split())
if n == 0:
break
a = sorted(map(int, input().split()))
index = bisect.bisect_left(a, m) - 1
if index <= 0:
print("NONE")
continue
ans = 0
for i in range(index, 0, -1):
for j in range(i-1, -1, -1):
if a[i... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.