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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
s132140557 | p00222 | u633068244 | 1399123833 | Python | Python | py | Runtime Error | 0 | 0 | 48 | while 1:
n = input()
if n == 0: break
print n |
s023287060 | p00222 | u633068244 | 1399123881 | Python | Python | py | Runtime Error | 0 | 0 | 49 | while 1:
n = input()
if n == 0: break
print(n) |
s188736605 | p00222 | u633068244 | 1400422175 | Python | Python | py | Runtime Error | 0 | 0 | 233 | r =10000001
p = [1]*r
p[0]= p[1] = 0
for i in range(int(r**0.5)):
if p[i]:
p[2*i::i] = [0 for j in range(2*i,r,i)]
while 1:
n = input()
if n == 0: break
n -= 1-n%2
while any(not p[n-i] for i in [0,2,6,8]):
n -= 2
print n |
s747637393 | p00223 | u319725914 | 1535894637 | Python | Python3 | py | Runtime Error | 0 | 0 | 1884 | from line_profiler import LineProfiler
from collections import deque
def main():
while(True):
W, H = map(int, input().split())
# print(W,H)
if not W: break
tx,ty = map(int, input().split())
kx,ky = map(int, input().split())
ma = [[False]*(W+2) for _ in range(H+2)]
... |
s707834581 | p00223 | u319725914 | 1535895877 | Python | Python3 | py | Runtime Error | 0 | 0 | 1252 | # from line_profiler import LineProfiler
from collections import deque
from sys import stdin
def main():
while(True):
W, H = map(int, sys.stdin().split())
if not W: break
tx,ty = map(int, sys.stdin().split())
kx,ky = map(int, sys.stdin().split())
ma = [[False]*(W+2) for _ in... |
s669080304 | p00223 | u319725914 | 1535896094 | Python | Python3 | py | Runtime Error | 0 | 0 | 1273 | from line_profiler import LineProfiler
from collections import deque
from sys import stdin
def main():
while(True):
W, H = map(int, stdin.readline().split())
if not W: break
tx,ty = map(int, stdin.readline().split())
kx,ky = map(int, stdin.readline().split())
ma = [[False]*(... |
s604727891 | p00223 | u319725914 | 1535896715 | Python | Python3 | py | Runtime Error | 0 | 0 | 1299 | from line_profiler import LineProfiler
from collections import deque
from sys import stdin
def main():
while(True):
W, H = map(int, stdin.readline().split())
if not W: break
tx,ty = map(int, stdin.readline().split())
kx,ky = map(int, stdin.readline().split())
ma = [[False]*(... |
s052862371 | p00223 | u766477342 | 1419778453 | Python | Python3 | py | Runtime Error | 0 | 0 | 1663 | direc = ((1,0),(-1,0),(0,1),(0,-1))
#d = [[[[0 for i in range(Y+1)] for i in range(X+1)] for i in range(Y+1)] for i in range(X+1)]
#d[1][1][2][2]=3
# print(d)
while 1:
X, Y = list(map(int,input().split()))
if X == 0: break
ftx, fty = list(map(lambda x: x-1, map(int, input().split())))
fkx, fky = list... |
s872824467 | p00224 | u811434779 | 1438695705 | Python | Python | py | Runtime Error | 0 | 0 | 1602 | import Queue
INF = 1 << 29
class Edge:
def __init__(self, _v, _cost):
self.v = _v
self.cost = _cost
def parse(s, m, n):
if(s[0]=="C"): return int(s.translate(None, "C")) - 1
elif(s[0]=="L"): return int(s.translate(None, "L")) - 1 + m
elif(s[0]=="H"): return m + n
else: return m + n ... |
s484103854 | p00224 | u811434779 | 1438696218 | Python | Python | py | Runtime Error | 0 | 0 | 1590 | import Queue
INF = 1 << 29
class Edge:
def __init__(self, _v, _cost):
self.v = _v
self.cost = _cost
def parse(s, m, n):
if(s[0]=="C"): return int(s.translate(None, "C")) - 1
elif(s[0]=="L"): return int(s.translate(None, "L")) - 1 + m
elif(s[0]=="H"): return m + n
else: return m + n ... |
s309301895 | p00224 | u811434779 | 1438697216 | Python | Python | py | Runtime Error | 39870 | 5384 | 1588 | import Queue
INF = 1 << 29
class Edge:
def __init__(self, _v, _cost):
self.v = _v
self.cost = _cost
def parse(s, m, n):
if(s[0]=="C"): return int(s.translate(None, "C")) - 1
elif(s[0]=="L"): return int(s.translate(None, "L")) - 1 + m
elif(s[0]=="H"): return m + n
else: return m + n ... |
s247479102 | p00224 | u352394527 | 1530035047 | Python | Python3 | py | Runtime Error | 0 | 0 | 2122 | from itertools import combinations
from heapq import heappop, heappush
INF = 10 ** 20
def convert(s, m, n):
if s == "H":
return 0
if s == "D":
return 1
if s[0] == "C":
return int(s[1]) + 1
if s[0] == "L":
return int(s[1]) + m + 1
def get_cost(start, m, n, edges):
cost = [INF] * (m + n + 2)
... |
s746751127 | p00224 | u352394527 | 1530035110 | Python | Python3 | py | Runtime Error | 0 | 0 | 2164 | from itertools import combinations
from heapq import heappop, heappush
import sys
sys.setrecursionlimit(1000000)
INF = 10 ** 20
def convert(s, m, n):
if s == "H":
return 0
if s == "D":
return 1
if s[0] == "C":
return int(s[1]) + 1
if s[0] == "L":
return int(s[1]) + m + 1
def get_cost(start, m,... |
s063425437 | p00224 | u352394527 | 1530036198 | Python | Python3 | py | Runtime Error | 0 | 0 | 2186 | from itertools import combinations
from heapq import heappop, heappush
import sys
sys.setrecursionlimit(1000000)
INF = 10 ** 20
def convert(s, m, n):
if s == "H":
return 0
if s == "D":
return 1
if s[0] == "C":
return int(s[1]) + 1
if s[0] == "L":
return int(s[1]) + m + 1
def get_cost(start, m,... |
s615590780 | p00224 | u352394527 | 1530036224 | Python | Python3 | py | Runtime Error | 0 | 0 | 2194 | from itertools import combinations
from heapq import heappop, heappush
import sys
sys.setrecursionlimit(1000000)
INF = 10 ** 20
def convert(s, m, n):
if s == "H":
return 0
if s == "D":
return 1
if s[0] == "C":
return int(s[1]) + 1
if s[0] == "L":
return int(s[1]) + m + 1
def get_cost(start, m,... |
s471459494 | p00225 | u779627195 | 1355233095 | Python | Python | py | Runtime Error | 0 | 0 | 935 | import sys
R = lambda:map(int,raw_input().split())
def eulerPath(graph):
odd = [x for x in graph.keys() if len(graph[x])&1]
if len(odd) > 2: return -1
stack = [graph.keys()[0]]
path = []
while stack:
#print stack
v = stack[-1]
if graph[v]:
u = graph[v].pop(0)... |
s009510059 | p00225 | u104911888 | 1369314986 | Python | Python | py | Runtime Error | 0 | 0 | 274 | from collections import defaultdict
while True:
n=input()
if n==0:break
dic=defaultdict(int)
for i in range(n):
w=raw_input()
dic[w[0]]+=1
dic[w[-1]]+=1
if len(set(dic.values()))==1:
print "OK"
else:
print "NG" |
s005456132 | p00225 | u104911888 | 1369315096 | Python | Python | py | Runtime Error | 0 | 0 | 324 | from collections import defaultdict
while True:
try:
n=input()
except SyntaxError:
pass
if n==0:break
dic=defaultdict(int)
for i in range(n):
w=raw_input()
dic[w[0]]+=1
dic[w[-1]]+=1
if len(set(dic.values()))==1:
print "OK"
else:
print ... |
s867449336 | p00225 | u794549850 | 1372093840 | Python | Python | py | Runtime Error | 0 | 0 | 1676 | alphabets = {}
alphabets_num = {}
vartexs = []
fail_check = {}
class Vartex():
def __init__(self, string):
global alphabets
self.ID = string
self.link = []
self.arrival = 0
alphabets[string[0]].append(self)
alphabets_num[string[0]] += 1
return
def regist... |
s717453326 | p00225 | u794549850 | 1372094044 | Python | Python | py | Runtime Error | 0 | 0 | 1677 | alphabets = {}
alphabets_num = {}
vartexs = []
fail_check = {}
class Vartex():
def __init__(self, string):
global alphabets
self.ID = string
self.link = []
self.arrival = 0
alphabets[string[0]].append(self)
alphabets_num[string[0]] += 1
return
def regist... |
s691385727 | p00225 | u104911888 | 1372169288 | Python | Python | py | Runtime Error | 0 | 0 | 319 | while True:
n=input()
if n==0:break
inWd=[0]*26
outWd=[0]*26
for i in range(n):
s=raw_input()
inWd[ord(s[0])-ord("a")]+=1
outWd[ord(s[-1])-ord("a")]+=1
for i in range(26):
if inWd[i]!=outWd[i]:
print "NG"
break
else:
print "OK" |
s668386026 | p00225 | u104911888 | 1375079105 | Python | Python | py | Runtime Error | 0 | 0 | 727 | def dfs(u):
visited[u]=True
for v in range(26):
if (not visited[v]) and G[u][v]:
dfs(v)
def getNComponent():
nc=0
for i in range(26):
if head[i]==0 and tail[i]==0:
continue
if not visited[i]:
nc+=1
dfs(i)
return nc
while True:... |
s685326134 | p00225 | u104911888 | 1375080904 | Python | Python | py | Runtime Error | 0 | 0 | 667 | def dfs(u):
visited[u]=True
f=False
for v in range(26):
if G[u][v]:
f=True
if not visited[v]:
dfs(v)
return f
def getNComponent():
nc=0
for i in range(26):
if (not visited[i]) and dfs(i):
nc+=1
return nc
while True:
... |
s885828355 | p00225 | u104911888 | 1385220428 | Python | Python | py | Runtime Error | 0 | 0 | 1127 | def dfs(current_node):
for next_node in range(26):
if L[current_node][next_node]:
L[current_node][next_node] = 0
visited[current_node] = True
dfs(next_node)
def getNComponent():
count = 0
for i in range(26):
if inWd[i]==0 and outWd[i]==0:
cont... |
s857163919 | p00225 | u104911888 | 1385221579 | Python | Python | py | Runtime Error | 0 | 0 | 1012 | def check():
for i in range(26):
if inWd[i] != outWd[i]:
return False
return True
def dfs(current_node):
visited[current_node] = True
for next_node in range(26):
if not visited[next_node] and L[current_node][next_node]:
dfs(next_node)
def getNComponent():
nc... |
s856247717 | p00225 | u104911888 | 1385221735 | Python | Python | py | Runtime Error | 0 | 0 | 947 | def check():
for i in range(26):
if inWd[i] != outWd[i]:
return False
return True
def dfs(current_node):
visited[current_node] = True
for next_node in range(26):
if not visited[next_node] and L[current_node][next_node]:
dfs(next_node)
def getNComponent():
nc... |
s329244365 | p00225 | u633068244 | 1397003831 | Python | Python | py | Runtime Error | 0 | 0 | 312 | while 1:
n=input()
if n==0: break
ini,end={},{}
for i in range(n):
word=raw_input()
try:ini[word[0]]+=1
except:ini[word[0]]=1
try:end[word[-1]]+=1
except:end[word[-1]]=1
for k,v in ini.items():
if k not in end or end[k]!=v:
print "NG"
break
else:
print "OK" |
s344996129 | p00225 | u633068244 | 1397003874 | Python | Python | py | Runtime Error | 0 | 0 | 314 | while 1:
n=input()
if n==0: break
ini,end={},{}
for i in range(n):
word=raw_input()
try:ini[word[0]]+=1
except:ini[word[0]]=1
try:end[word[-1]]+=1
except:end[word[-1]]=1
for k,v in ini.items():
if k not in end or end[k]!=v:
print "NG"
break
else:
print "OK" |
s255080505 | p00225 | u633068244 | 1397003951 | Python | Python | py | Runtime Error | 0 | 0 | 283 | while 1:
n=input()
if n==0: break
ini,end={},{}
for i in range(n):
word=raw_input()
try:ini[word[0]]+=1
except:ini[word[0]]=1
try:end[word[-1]]+=1
except:end[word[-1]]=1
for k,v in ini.items():
if k not in end or end[k]!=v:
print "NG"
break
else:
print "OK" |
s611647651 | p00225 | u633068244 | 1397004519 | Python | Python | py | Runtime Error | 0 | 0 | 340 | while 1:
n=input()
if n==0: break
ini,end={},{}
for i in range(n):
word=raw_input()
if word[0]==word[-1]:
continue
try:ini[word[0]]+=1
except:ini[word[0]]=1
try:end[word[-1]]+=1
except:end[word[-1]]=1
for k,v in ini.items():
if k not in end or end[k]!=v:
print "NG"
break
... |
s530566176 | p00225 | u633068244 | 1397004557 | Python | Python | py | Runtime Error | 0 | 0 | 380 | while 1:
try:
n=input()
if n==0: break
ini,end={},{}
for i in range(n):
word=raw_input()
if word[0]==word[-1]:
continue
try:ini[word[0]]+=1
except:ini[word[0]]=1
try:end[word[-1]]+=1
except:end[word[-1]]=1
for k,v in ini.items():
if k not in end or end[k]!=v:
print "NG"
... |
s209450030 | p00226 | u873482706 | 1437728665 | Python | Python | py | Runtime Error | 0 | 0 | 287 | while True:
r, a = raw_input().split()
if r == a == 0: break
h = 0
_r = []
_a = []
for i in range(4):
if a[i] == r[i]:
h += 1
else:
_r.append(r[i])
_a.append(a[i])
else:
print h, len(set(_r)&set(_a)) |
s606870645 | p00226 | u546285759 | 1484201427 | Python | Python3 | py | Runtime Error | 0 | 0 | 184 | while True:
r, a= input().split()
if r==a==0: break
print(sum(1 for i, j in zip(r, a) if i==j), sum(1 for i in range(len(r)) for j in range(len(a)) if r[i]==a[j] and i!=j)) |
s799176987 | p00226 | u071693485 | 1509107452 | Python | Python3 | py | Runtime Error | 0 | 0 | 421 | for q in range(12000):
a = tuple(map(int, input().split()))
b = input()
if a[0] == 0 and b[0] == '0':
break
hit = 0
for i in range(4):
if a[i] == int(b[i]):
hit = hit + 1
blow = 0
for j in range(4):
for i in range(4):
if (int(b[j]) == a[i]) a... |
s107172751 | p00226 | u460331583 | 1346528889 | Python | Python | py | Runtime Error | 0 | 0 | 341 | while True:
aw=[]
ar = raw_input()
if ar[0] ==0 and ar[1] ==0 and ar[2] ==0: break
else:
hit=0
blo=0
for t in range(5,9):
aw.append(ar[t])
for t in range(0,4):
if ar[t] == aw[t]: hit+=1
for t in range(0,4):
for y in range(0,4):
if ar[t] == aw[y]:
if t == y: break
else: bl... |
s217644249 | p00226 | u350508326 | 1382632159 | Python | Python | py | Runtime Error | 0 | 0 | 442 | if __name__ == '__main__':
while True:
a,b = map(str,raw_input().split(' '))
if a == 0 and b == 0:
break
a = list(a)
b = list(b)
# print a
br = 0
hit = 0
for i,data in enumerate(b):
if data in a:
... |
s254109919 | p00227 | u766477342 | 1414673959 | Python | Python3 | py | Runtime Error | 0 | 0 | 340 | while True:
n,m = list(map(int,input().split()))
if n == 0 and m == 0:
break
amari = n % m
yasai = list(map(int,input().split()))
yasai.sort()
s = 0
if amari > 0:
s = sum(yasai[0:amari])
i = 0
for y in yasai[amari:]:
if i % m > 0:
s += y
... |
s440319197 | p00227 | u766477342 | 1414674172 | Python | Python3 | py | Runtime Error | 0 | 0 | 299 | while True:
n,m = list(map(int,input().split()))
if n == 0 and m == 0:
break
amari = n % m
yasai = list(map(int,input().split()))
yasai.sort()
s = 0
if amari > 0:
s = sum(yasai[0:amari])
i = 0
for y in yasai[amari:]:
pass
print(s) |
s788391393 | p00227 | u766477342 | 1414674288 | Python | Python3 | py | Runtime Error | 0 | 0 | 358 | while True:
n,m = list(map(int,input().split()))
if n == 0 and m == 0:
break
amari = int(n % m)
yasai = list(map(int,input().split()))
yasai.sort()
s = 0
if amari > 0:
s = sum(yasai[0:amari])
i = 0
for y in yasai[amari:]:
pass
if i % m > 0:
... |
s494687397 | p00227 | u766477342 | 1414674346 | Python | Python3 | py | Runtime Error | 0 | 0 | 177 | while True:
n,m = list(map(int,input().split()))
if n == 0 and m == 0:
break
amari = int(n % m)
yasai = list(map(int,input().split()))
print(amari) |
s460424976 | p00227 | u766477342 | 1414674397 | Python | Python3 | py | Runtime Error | 0 | 0 | 69 | while True:
n,m = list(map(int,input().split()))
print(amari) |
s416311223 | p00227 | u766477342 | 1414674531 | Python | Python3 | py | Runtime Error | 0 | 0 | 177 | while True:
#n,m = list(map(int,input().split()))
spam = input().split()
n = int(spam[0])
m = int(spam[1])
if n == 0 and m == 0:
break
print(1) |
s551817601 | p00227 | u766477342 | 1414674597 | Python | Python3 | py | Runtime Error | 0 | 0 | 95 | while True:
#n,m = list(map(int,input().split()))
spam = input().split()
print(1) |
s355205329 | p00227 | u766477342 | 1414674673 | Python | Python3 | py | Runtime Error | 0 | 0 | 87 | while True:
#n,m = list(map(int,input().split()))
spam = input()
print(1) |
s954737843 | p00227 | u766477342 | 1414675077 | Python | Python | py | Runtime Error | 0 | 0 | 335 | while True:
n,m = map(int,raw_input().split())
if n == 0 and m == 0:
break
amari = n % m
yasai = map(int,raw_input().split())
yasai.sort()
s = 0
if amari > 0:
s = sum(yasai[0:amari])
i = 0
for y in yasai[amari:]:
if i % m > 0:
s += y
i+=... |
s619657621 | p00227 | u766477342 | 1414675094 | Python | Python3 | py | Runtime Error | 0 | 0 | 335 | while True:
n,m = map(int,raw_input().split())
if n == 0 and m == 0:
break
amari = n % m
yasai = map(int,raw_input().split())
yasai.sort()
s = 0
if amari > 0:
s = sum(yasai[0:amari])
i = 0
for y in yasai[amari:]:
if i % m > 0:
s += y
i+=... |
s385523379 | p00227 | u766477342 | 1414675158 | Python | Python3 | py | Runtime Error | 0 | 0 | 54 | while True:
n,m = map(int,raw_input().split())
|
s194227838 | p00227 | u766477342 | 1414675183 | Python | Python | py | Runtime Error | 0 | 0 | 53 | while True:
n,m = map(int,raw_input().split(' ')) |
s005069079 | p00227 | u766477342 | 1414675337 | Python | Python | py | Runtime Error | 0 | 0 | 45 | while True:
a = raw_input()
print 'a' |
s103292306 | p00227 | u766477342 | 1414675394 | Python | Python3 | py | Runtime Error | 0 | 0 | 42 | while True:
a = input()
print('a') |
s177266676 | p00227 | u766477342 | 1414675449 | Python | Python | py | Runtime Error | 0 | 0 | 43 |
while True:
a = input()
print('a') |
s204162965 | p00227 | u104911888 | 1368319849 | Python | Python | py | Runtime Error | 0 | 0 | 177 | while True:
n,m=map(int,raw_input().split())
if n==m==0:break
L=sorted(map(int,raw_input().split()),reverse=True)
print sum(L[i] for i in range(n) if (i+1)%m<>0) |
s389234039 | p00227 | u104911888 | 1368319949 | Python | Python | py | Runtime Error | 0 | 0 | 226 | while True:
try:
n,m=map(int,raw_input().split())
except ValueError:
pass
if n==m==0:break
L=sorted(map(int,raw_input().split()),reverse=True)
print sum(L[i] for i in range(n) if (i+1)%m<>0) |
s764113418 | p00227 | u104911888 | 1368320041 | Python | Python | py | Runtime Error | 0 | 0 | 193 | while True:
A=map(int,raw_input().split())
n,m=A[0],A[1]
if n==m==0:break
L=sorted(map(int,raw_input().split()),reverse=True)
print sum(L[i] for i in range(n) if (i+1)%m<>0) |
s455721485 | p00227 | u104911888 | 1368320194 | Python | Python | py | Runtime Error | 0 | 0 | 164 | while True:
n,m=input(),input()
if n==m==0:break
L=sorted(map(int,raw_input().split()),reverse=True)
print sum(L[i] for i in range(n) if (i+1)%m<>0) |
s991901228 | p00227 | u260980560 | 1384356845 | Python | Python | py | Runtime Error | 0 | 0 | 205 | while 1:
n,m = map(int, raw_input().split())
if n==m==0: break
s = 0
p = map(int, raw_input().split())
p.sort(reverse=True)
s = sum([p[i] for i in range(n) if i%m!=m-1])
print s |
s398909532 | p00227 | u260980560 | 1384357169 | Python | Python | py | Runtime Error | 0 | 0 | 221 | while 1:
n,m = map(int, raw_input().split())
if n==m==0: break
p = map(int, raw_input().split())
p.sort(reverse=True)
s = 0
for i in range(n):
if i%m!=m-1:
s += p[i]
print s |
s123756566 | p00227 | u260980560 | 1384357259 | Python | Python | py | Runtime Error | 0 | 0 | 234 | while 1:
n,m = map(int, raw_input().split())
if n==m==0: break
p = map(int, raw_input().split())
p.sort(reverse=True)
s = 0
for i in range(n):
if i%m!=m-1:
s += p[i]
del p[:]
print s |
s147867888 | p00227 | u647766105 | 1388619306 | Python | Python | py | Runtime Error | 0 | 0 | 169 | while True:
n, m = map(int, raw_input().split())
if n|m == 0:
break
p = sorted(map(int, raw_input().split()))[::-1]
print sum(p) - sum(p[m-1::m]) |
s942655342 | p00227 | u647766105 | 1388619398 | Python | Python | py | Runtime Error | 0 | 0 | 186 | while True:
n, m = map(int, raw_input().split())
if n|m == 0:
break
p = sorted(map(int, raw_input().split()))[::-1]
print sum(p) - sum(p[m-1::m]) if n >= m else 0 |
s653479535 | p00227 | u647766105 | 1388619510 | Python | Python | py | Runtime Error | 0 | 0 | 186 | while True:
n, m = map(int, raw_input().split())
if n == 0:
break
p = sorted(map(int, raw_input().split()))[::-1]
print sum(p) - (sum(p[m-1::m]) if n >= m else 0) |
s130028557 | p00227 | u350508326 | 1392480128 | Python | Python | py | Runtime Error | 0 | 0 | 330 | while True:
n = map(int, raw_input().split())
if n[0] == 0 and n[1] == 0:
break
# print(n)
data = sorted(map(int, raw_input().split()), reverse = True)
# print(data)
sum = 0
for i in xrange(n[0]):
if (i + 1) % n[1] != 0:
sum += data[i]
# print(i)
... |
s975531439 | p00227 | u350508326 | 1392480247 | Python | Python | py | Runtime Error | 0 | 0 | 275 | while True:
n = map(int, raw_input().split())
if n[0] == 0 and n[1] == 0:
break
data = sorted(map(int, raw_input().split()), reverse = True)
sum = 0
for i in xrange(n[0]):
if (i + 1) % n[1] != 0:
sum += data[i]
print(sum) |
s749110384 | p00227 | u350508326 | 1392480402 | Python | Python | py | Runtime Error | 0 | 0 | 329 | while True:
n = map(int, raw_input().split())
if n[0] == 0 and n[1] == 0:
break
# print(n)
data = sorted(map(int, raw_input().split()), reverse = True)
# print(data)
sum = 0
for i in range(n[0]):
if (i + 1) % n[1] != 0:
sum += data[i]
# print(i)
p... |
s758750575 | p00227 | u350508326 | 1392480996 | Python | Python | py | Runtime Error | 0 | 0 | 459 | def main():
while True:
n = map(int, raw_input().split())
if n[0] == 0 and n[1] == 0:
break
# print(n)
data = sorted(map(int, raw_input().split()), reverse = True)
# print(data)
sum = 0
for i in range(len(data)):
if ... |
s678720799 | p00227 | u633068244 | 1396279625 | Python | Python | py | Runtime Error | 0 | 0 | 321 | def signal(a,e):
s=""
for i in range(7):
s+="0" if a[i]==e[i] else "1"
return s
ref=["0111111","0000110","1011011","1001111","1100110","1101101","1111101","0100111","1111111","1101111"]
while 1:
n=int(raw_input())
if n==-1:break
e="0000000"
for i in range(n):
a=ref[int(raw_input())]
print signal(a,e)
e=... |
s303140216 | p00227 | u633068244 | 1396284009 | Python | Python | py | Runtime Error | 0 | 0 | 161 | while 1:
n,m=map(int, raw_input().split())
if n==0:break
c=sorted(map(int,raw_input().split()))[::-1]
c[m-1::m] = [0 for i in range(m-1,n,m)]
print sum(c)
|
s265989563 | p00227 | u633068244 | 1396284109 | Python | Python | py | Runtime Error | 0 | 0 | 196 | while 1:
n,m=map(int, raw_input().split())
if n==0:break
c=sorted(map(int,raw_input().split()))[::-1]
if m > n:
print sum(c)
else:
c[m-1::m] = [0 for i in range(m-1,n,m)]
print sum(c)
|
s086260804 | p00227 | u633068244 | 1396284160 | Python | Python | py | Runtime Error | 0 | 0 | 202 | while 1:
n,m=map(int, raw_input().split())
if n==0:break
# c=sorted(map(int,raw_input().split()))[::-1]
# if m > n:
# print sum(c)
# else:
# c[m-1::m] = [0 for i in range(m-1,n,m)]
# print sum(c)
|
s324898080 | p00227 | u633068244 | 1396284175 | Python | Python | py | Runtime Error | 0 | 0 | 205 | while True:
n,m=map(int, raw_input().split())
if n==0:break
# c=sorted(map(int,raw_input().split()))[::-1]
# if m > n:
# print sum(c)
# else:
# c[m-1::m] = [0 for i in range(m-1,n,m)]
# print sum(c)
|
s885584542 | p00227 | u633068244 | 1396284208 | Python | Python | py | Runtime Error | 0 | 0 | 204 | while True:
n,m=map(int, raw_input().split())
if n==0:break
c=sorted(map(int,raw_input().split()))[::-1]
# if m > n:
# print sum(c)
# else:
# c[m-1::m] = [0 for i in range(m-1,n,m)]
# print sum(c)
|
s543493715 | p00227 | u633068244 | 1396284314 | Python | Python | py | Runtime Error | 0 | 0 | 228 | while 1:
n=map(int, raw_input().split())
if n[0]==0:break
# c=sorted(map(int,raw_input().split()))[::-1]
# if m > n:
# print sum(c)
# else:
# c[m-1::m] = [0 for i in range(m-1,n,m)]
# print sum(c) |
s333649595 | p00227 | u633068244 | 1396719686 | Python | Python | py | Runtime Error | 0 | 0 | 152 | while 1:
n,m=map(int,raw_input().split())
if n==0:break
v=sorted(map(int,raw_input().split()))[::-1]
for i in range(m-1,n,m):
v[i]=0
print sum(v) |
s885249519 | p00227 | u759949288 | 1398140430 | Python | Python | py | Runtime Error | 0 | 0 | 210 | while True:
n, m = (int(x) for x in raw_input().split(" "))
if n == 0 and m == 0: break
p = [int(x) for x in raw_input().split(" ")]
s = sum(p)
p.sort(reverse=True)
for x in p[m - 1::m]:
s -= x
print s |
s958954438 | p00227 | u759949288 | 1398140461 | Python | Python | py | Runtime Error | 0 | 0 | 204 | while True:
n, m = (int(x) for x in raw_input().split())
if n == 0 and m == 0: break
p = [int(x) for x in raw_input().split()]
s = sum(p)
p.sort(reverse=True)
for x in p[m - 1::m]:
s -= x
print s |
s007878210 | p00227 | u759949288 | 1398140597 | Python | Python | py | Runtime Error | 0 | 0 | 220 | while True:
n, m = (int(x.strip()) for x in raw_input().split())
if n == 0 and m == 0: break
p = [int(x.strip()) for x in raw_input().split()]
s = sum(p)
p.sort(reverse=True)
for x in p[m - 1::m]:
s -= x
print s |
s820969147 | p00227 | u772196646 | 1400298832 | Python | Python | py | Runtime Error | 0 | 0 | 269 | while 1:
nm = map(int, raw_input().split())
if nm == [0, 0]:
break
n = nm[0]
m = nm[1]
p = map(int, raw_input().split())
p_sorted = sorted(p)
sum = 0
for i in range(n):
if (i+1) % m != 0:
sum += p_sorted[-1-i]
print sum |
s379066907 | p00227 | u772196646 | 1400299998 | Python | Python | py | Runtime Error | 0 | 0 | 283 | while 1:
nm = map(int, raw_input().split())
if nm == [0, 0]:
break
n = nm[0]
m = nm[1]
p = map(int, raw_input().split())
p_sorted = sorted(p)
sum = 0
for i in range(n):
if (i+1) % m != 0:
sum += p_sorted[-1-i]
print sum |
s352384406 | p00228 | u104911888 | 1367759647 | Python | Python | py | Runtime Error | 0 | 0 | 309 | L=[
"0111111",
"0000110",
"1011011",
"1001111",
"1100110",
"1101101",
"1111101",
"0100111",
"1111111",
"1111110"]
while True:
n=input()
if n==-1:break
t="0000000"
for i in range(n):
a=input()
print "".join("1" if L[a][i]<>t[i] else "0" for i in range(len(L[a])))
t=L[a] |
s684161431 | p00228 | u104911888 | 1367759839 | Python | Python | py | Runtime Error | 0 | 0 | 297 | L=[
"0111111",
"0000110",
"1011011",
"1001111",
"1100110",
"1101101",
"1111101",
"0100111",
"1111111",
"1111110"]
while True:
n=input()
if n==-1:break
t="0000000"
for i in range(n):
a=input()
print "".join("1" if i<>j else "0" for i,j in zip(L[a],t))
t=L[a] |
s995084822 | p00228 | u104911888 | 1367760691 | Python | Python | py | Runtime Error | 0 | 0 | 395 | L=[
"0111111",
"0000110",
"1011011",
"1001111",
"1100110",
"1101101",
"1111101",
"0100111",
"1111111",
"1111110"]
while True:
n=input()
if n==-1:break
t="0000000"
for i in range(n):
a=input()
# print "".join("1" if i<>j else "0" for i,j in zip(L[a],t))
f=""
for j,k in zip(... |
s863228657 | p00228 | u104911888 | 1367760868 | Python | Python | py | Runtime Error | 0 | 0 | 289 | L=["0111111","0000110","1011011","1001111","1100110","1101101","1111101","0100111","1111111","1111110"]
while True:
n=input()
if n==-1:break
t="0000000"
for i in range(n):
a=input()
print "".join(["1" if i<>j else "0" for i,j in zip(L[a],t)])
t=L[a] |
s850300572 | p00228 | u104911888 | 1367761028 | Python | Python | py | Runtime Error | 0 | 0 | 330 | D={0: '0111111', 1: '0000110', 2: '1011011', 3: '1001111', 4: '1100110', 5: '1101101', 6: '1111101', 7: '0100111', 8: '1111111\
', 9: '1111110'}
while True:
n=input()
if n==-1:break
t="0000000"
for i in range(n):
a=input()
print "".join(["1" if i<>j else "0" for i,j in zip(D[a],t)])
... |
s345629500 | p00228 | u260980560 | 1384360097 | Python | Python | py | Runtime Error | 0 | 0 | 430 | dig = ["0111111","0000110","1011011","1001111","1100110","1101101","1111101","0100111","1111111","1101111"]
dc = [ ["".join(str(int(dig[i][k])^int(dig[j][k])) for k in range(7)) for j in range(10)] for i in range(10)]
while 1:
n = input()
if n==-1: break
buf = -1
for i in range(n):
num = input()... |
s276288875 | p00228 | u633068244 | 1396279356 | Python | Python | py | Runtime Error | 0 | 0 | 315 | def signal(a,e):
s=""
for i in range(7):
s+="0" if a[i]==e[i] else "1"
return s
ref=["0111111","0000110","1011011","1001111","1100110","1101101","1111101","0100111","1111111","1101111"]
while 1:
n=input()
if n==-1:break
e="0000000"
for i in range(n):
a=ref[int(raw_input())]
print signal(a,e)
e=a |
s640766719 | p00228 | u633068244 | 1396279409 | Python | Python | py | Runtime Error | 0 | 0 | 315 | def signal(a,e):
s=""
for i in range(7):
s+="0" if a[i]==e[i] else "1"
return s
ref=["0111111","0000110","1011011","1001111","1100110","1101101","1111101","0100111","1111111","1101111"]
while 1:
n=input()
if n==-1:break
e="0000000"
for i in range(n):
a=ref[int(raw_input())]
print signal(a,e)
e=a |
s844740018 | p00228 | u633068244 | 1396279638 | Python | Python | py | Runtime Error | 0 | 0 | 321 | def signal(a,e):
s=""
for i in range(7):
s+="0" if a[i]==e[i] else "1"
return s
ref=["0111111","0000110","1011011","1001111","1100110","1101101","1111101","0100111","1111111","1101111"]
while 1:
n=int(raw_input())
if n==-1:break
e="0000000"
for i in range(n):
a=ref[int(raw_input())]
print signal(a,e)
e=... |
s353463796 | p00228 | u633068244 | 1396280491 | Python | Python | py | Runtime Error | 0 | 0 | 161 | ref=[63,6,91,79,102,109,125,39,127,111]
while 1:
n=input()
if n==-1:break
e=0
for i in range(n):
a=ref[int(raw_input())]
print "{:07b}".format(a^e)
e=a |
s200628801 | p00228 | u633068244 | 1396280792 | Python | Python | py | Runtime Error | 0 | 0 | 165 | ref=[63,6,91,79,102,109,125,39,127,111]
while 1:
n=input()
if n==-1:break
e=0
#for i in range(n):
# a=ref[int(raw_input())]
# print "{:07b}".format(a^e)
# e=a |
s713732193 | p00228 | u633068244 | 1396280838 | Python | Python | py | Runtime Error | 0 | 0 | 174 | ref=[63,6,91,79,102,109,125,39,127,111]
while 1:
n=int(raw_input())
if n==-1:break
e=0
#for i in range(n):
# a=ref[int(raw_input())]
# print "{:07b}".format(a^e)
# e=a |
s990154099 | p00228 | u633068244 | 1396280917 | Python | Python | py | Runtime Error | 0 | 0 | 174 | ref=[63,6,91,79,102,109,125,39,127,111]
while 1:
n=int(raw_input())
if n==10:break
e=0
#for i in range(n):
# a=ref[int(raw_input())]
# print "{:07b}".format(a^e)
# e=a |
s600838689 | p00228 | u633068244 | 1396280937 | Python | Python | py | Runtime Error | 0 | 0 | 172 | ref=[63,6,91,79,102,109,125,39,127,111]
while 1:
n=int(raw_input())
if n<0:break
e=0
#for i in range(n):
# a=ref[int(raw_input())]
# print "{:07b}".format(a^e)
# e=a |
s982625473 | p00228 | u633068244 | 1396281042 | Python | Python | py | Runtime Error | 0 | 0 | 174 | ref=[63,6,91,79,102,109,125,39,127,111]
while 1:
n=int(raw_input())
if n==-1:break
e=0
#for i in range(n):
# a=ref[int(raw_input())]
# print "{:07b}".format(a^e)
# e=a |
s800629757 | p00228 | u633068244 | 1396281074 | Python | Python | py | Runtime Error | 0 | 0 | 175 | ref=[63,6,91,79,102,109,125,39,127,111]
while 1:
n=int(raw_input())
if n+1==0:break
e=0
#for i in range(n):
# a=ref[int(raw_input())]
# print "{:07b}".format(a^e)
# e=a |
s321486791 | p00228 | u633068244 | 1396281157 | Python | Python | py | Runtime Error | 0 | 0 | 169 | ref=[63,6,91,79,102,109,125,39,127,111]
while 1:
n=int(raw_input())
if n==0:break
e=0
for i in range(n):
a=ref[int(raw_input())]
print "{:07b}".format(a^e)
e=a |
s077928784 | p00228 | u633068244 | 1396281172 | Python | Python | py | Runtime Error | 0 | 0 | 169 | ref=[63,6,91,79,102,109,125,39,127,111]
while 1:
n=int(raw_input())
if n<=0:break
e=0
for i in range(n):
a=ref[int(raw_input())]
print "{:07b}".format(a^e)
e=a |
s580933026 | p00228 | u633068244 | 1396281389 | Python | Python | py | Runtime Error | 0 | 0 | 43 | loop do
n =gets.to_i
break if n==-1
end |
s763557903 | p00228 | u633068244 | 1396281446 | Python | Python | py | Runtime Error | 0 | 0 | 175 | ref=[63,6,91,79,102,109,125,39,127,111]
while 1:
n=int(raw_input())
if n==-1:
break
e=0
for i in range(n):
a=ref[int(raw_input())]
print ("{:07b}".format(a^e))
e=a |
s675588476 | p00228 | u633068244 | 1396283097 | Python | Python | py | Runtime Error | 0 | 0 | 170 | ref=[63,6,91,79,102,109,125,39,127,111]
while 1:
n=int(raw_input())
if n==-1:break
e=0
for i in range(n):
a=ref[int(raw_input())]
print "{:07b}".format(a^e)
e=a |
s212889432 | p00228 | u633068244 | 1396443490 | Python | Python | py | Runtime Error | 0 | 0 | 170 | ref=[63,6,91,79,102,109,125,39,127,111]
while 1:
n=int(raw_input())
if n==-1:break
e=0
for i in range(n):
a=ref[int(raw_input())]
print "{:07b}".format(a^e)
e=a |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.