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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
s665737030 | p03699 | u523130469 | 1588466081 | Python | PyPy3 (2.4.0) | py | Runtime Error | 176 | 39408 | 300 | from itertools import product as prod
n = int(input().strip())
s = [int(input()) for _ in range(n)]
ans = 0
for elem in (prod([0, 1], repeat=10)):
rep = 0
for i in range(n):
if elem[i]:
rep += s[i]
if rep % 10 == 0:
rep = 0
ans = max(ans, rep)
print(ans)
|
s926490661 | p03699 | u640922335 | 1588436174 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 189 | N=int(input())
S=list(int(input()) for _ range(N))
S=sorted(S)
ans=0
if sun(S)%10!=0:
ans=sum(S)
for i in range(N):
if (sum(S)-S[i])%10!=0:
ans=sum(S)-S[i]
break
print(ans) |
s232050972 | p03699 | u062881897 | 1588014858 | Python | PyPy3 (2.4.0) | py | Runtime Error | 167 | 38384 | 186 | N = int(input())
List = [int(input()) for i in range(N)]
x = len(List)
while sum(List) % 10 == 0:
List.remove(min(List))
if len(List) == 0:
print(0)
stop
print(sum(List)) |
s975803031 | p03699 | u062881897 | 1588014732 | Python | PyPy3 (2.4.0) | py | Runtime Error | 169 | 38384 | 143 | N = int(input())
List = [int(input()) for i in range(N)]
x = len(List)
while sum(List) % 10 == 0:
List.remove(min(List))
print(sum(List)) |
s066433082 | p03699 | u858670323 | 1587899202 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 185 | n = int(input())
a=list()
sum=0
for i in range(n):
x = int(input())
sum+=x
if(x%10!=0):
a.append(x)
if(sum%10==0):
sum-=min(a)
if(sum%10==0):
print(0)
else:
print(sum) |
s212742529 | p03699 | u652656291 | 1587697266 | Python | Python (3.4.3) | py | Runtime Error | 18 | 2940 | 216 | n = int(input())
s =[int(input()) for i in range(n)]
s.sort()
s_sum =sum(s)
if s_sum % 10 != 0:
print(s_sum)
i = 0
else:
while True:
if s[i] % 10 != 0:
s[i] = 0
break
i += 1
print(s_sum) |
s480178497 | p03699 | u652656291 | 1587697214 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 219 | n = int(input())
s =[int(input()) for i in range(n)]
s.sort()
s_sum =sum(s)
if s_sum % 10 != 0:
print(s_sum)
a = 1
i = 0
else:
while a:
if s[i] % 10 != 0:
s[i] = 0
a = 0
i += 1
print(s_sum) |
s001474904 | p03699 | u106181248 | 1587662614 | Python | PyPy3 (2.4.0) | py | Runtime Error | 164 | 38256 | 337 | n = int(input())
s = [int(input()) for i in range(n)]
s.sort()
x = 0
y = 0
if sum(s)%10 != 0:
print(sum(s))
else:
while y == 0:
if s[x]%10 != 0:
s.pop(x)
y = 1
break
else:
x += 1
if x == len(s)-1:
print(0)
exit()
... |
s159034764 | p03699 | u373047809 | 1587521979 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 105 | _, s = map(int, open(0))
S = sum(s)
t = [i for i in s if i%10]
print(S if S%10 else S-min(t) if t else 0) |
s337351432 | p03699 | u163874353 | 1587349770 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 311 | n = int(input())
l = [int(input()) for i in range(n)]
wa = sum(l)
cnt = 0
for i in l:
if i % 10:
cnt += 10
if cnt == n:
print(0)
exit()
if wa % 10 != 0:
print(wa)
else:
l.sort()
for i in l:
if i % 10 != 0:
ex = i
break
print(wa - ex) |
s082251855 | p03699 | u163874353 | 1587349697 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3060 | 306 | n = int(input())
l = [int(input()) for i in range(n)]
wa = sum(l)
cnt = 0
for i in l:
if i % 10:
cnt += 10
if cnt == n:
print(0)
exit()
if wa % 10:
print(wa)
else:
l.sort()
for i in l:
if i % 10 != 0:
ex = i
break
print(wa - ex) |
s354580492 | p03699 | u686036872 | 1587202757 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 277 | N = input()
A=[]
for i in range(N):
A.append(i)
B = []
for i in range(2**N):
gokei = 0
for j in range(N):
if ((i >> j) & 1):
gokei += A[j]
gokei.append(B)
B.sort(reverse=True)
for i in B:
if i%10 != 0:
print(i)
exit() |
s560177525 | p03699 | u735008991 | 1586720435 | Python | PyPy3 (2.4.0) | py | Runtime Error | 173 | 38256 | 202 | N = int(input())
S = sorted([int(input()) for _ in range(N)])
s = sum(S)
if s % 10 != 0:
print(s)
exit()
for si in range(S):
if si % 10 != 0:
print(s - si)
exit()
print(0)
|
s346184968 | p03699 | u230717961 | 1586706767 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3060 | 345 | def solve(n, s_list):
max_score = sum(s_list)
if max_score % 10 != 0:
return max_score
else:
for i in tmp:
if (max_score - i) % 10 != 0:
return max_score - i
if __name__ == "__main__":
n = int(input())
s_list = sorted([int(input()) for i in range(n)])
... |
s430392078 | p03699 | u230717961 | 1586706638 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3060 | 342 | def solve(n, s_list):
max_score = sum(tmp)
if max_score % 10 != 0:
return max_score
else:
for i in tmp:
if (max_score - i) % 10 != 0:
return max_score - i
if __name__ == "__main__":
n = int(input())
s_list = sorted([int(input()) for i in range(n)])
p... |
s649038177 | p03699 | u489124637 | 1586655455 | Python | PyPy3 (2.4.0) | py | Runtime Error | 177 | 38512 | 289 | N = int(input())
L = [0] * N
for i in range(N):
L[i] = int(input())
ten = []
non = []
for i in L:
if i % 10 == 0:
ten.append(i)
else:
non.append(i)
if (sum(ten) + sum(non))%10 != 0:
print(sum(ten) + sum(non))
else:
print((sum(ten) + sum(non))-min(non)) |
s304812212 | p03699 | u293198424 | 1586655115 | Python | PyPy3 (2.4.0) | py | Runtime Error | 2106 | 43068 | 312 | N = int(input())
s = []
ans = []
for _ in range(N):
inp = int(input())
s.append(inp)
mx = 0
for bit in range(1<<N):
sums = 0
for i in range(N):
mask = 1<<i
if mask&bit:
sums += s[i]
if mx < sums:
if sums%10!=0:
mx = sums
print(answer) |
s507130848 | p03699 | u803617136 | 1586653853 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3060 | 182 | n, m = map(int, input().split())
l = 1
r = 10 ** 5
for _ in range(m):
li, ri = map(int, input().split())
l = max(l, li)
r = min(r, ri)
print(r - l + 1 if r >= l else 0)
|
s818667999 | p03699 | u852790844 | 1586575557 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 212 | import sys
n = int(input())
s = [int(input()) for i in range(n)]
s.sort()
p = np.sum(s)
if p%10 != 0:
print(p)
sys.exit()
for i in s:
if i % 10 != 0:
print(p - i)
sys.exit()
print(0) |
s116910550 | p03699 | u641406334 | 1586182164 | Python | Python (3.4.3) | py | Runtime Error | 18 | 2940 | 157 | N = int(input())
h = [int(input()) for _ in range(N)]
ans = sum(h)
if ans%10!=0:
print(ans)
else:
s = [i for i in s if s%10]
print(ans - min(s))
|
s523811574 | p03699 | u992910889 | 1585961462 | Python | PyPy3 (2.4.0) | py | Runtime Error | 2108 | 192140 | 519 | from itertools import accumulate, permutations, combinations, combinations_with_replacement, groupby, product
# import math
# import numpy as np
# from operator import xor
import sys
sys.setrecursionlimit(10 ** 5 + 10)
# input = sys.stdin.readline
def resolve():
N=int(input())
S=[int(input()) for i in range(N)... |
s879334517 | p03699 | u396266329 | 1585788784 | Python | Python (3.4.3) | py | Runtime Error | 19 | 3064 | 379 | n,a,b = map(int,input().split())
c = a - b
h = []
maxValue = 0
minValue = 1000000000
for i in range(n):
temp = int(input())
h.append(temp)
maxValue = max(maxValue, temp)
minValue = min(minValue, temp)
for i in range(int(minValue/a), int(maxValue/b)+1):
cnt = 0
for m in range(n):
if h[m] - i*b > 0:
... |
s851239531 | p03699 | u396266329 | 1585788741 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 380 | n,a,b = map(int,input().split())
c = a - b
h = []
maxValue = 0
minValue = 1000000000
for i in range(n):
temp = int(input())
h.append(temp)
maxValue = max(maxValue, temp)
minValue = min(minValue, temp)
for i in range(int(minValue/a)a, int(maxValue/b)+1):
cnt = 0
for m in range(n):
if h[m] - i*b > 0:
... |
s471857965 | p03699 | u089142196 | 1585181060 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 443 | N=int(input())
s=[0]*N
for i in range(N):
s[i] = int(input())
s.sort()
s_sum=sum(s)
if s_sum%10 !=0:
ans = s_sum
else:
for num in s:
if (s_sum-num)%10 !=0:
maxi_1 = s_sum-num
#print(num,maxi_1)
break
else:
maxi_1=0
tmp=0
for num in s:
tmp += num
if (s_sum-tmp)%10 !=0:
... |
s408953609 | p03699 | u072717685 | 1584923157 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 334 | def main():
n = int(input())
s = [int(input()) for _ in range(n)]
s.sort()
s_sum = sum(s)
if s_sum % 10 != 0:
print(s_sum)
exit()
for es in s:
s_sum -= es
if s_sum % 10 != 0:
print(s_sum)
exit()
else:
print(0)
if __name__ == '__main_... |
s156658911 | p03699 | u072717685 | 1584922378 | Python | Python (3.4.3) | py | Runtime Error | 2119 | 235288 | 361 | def main():
n = int(input())
s = [int(input()) for _ in range(n)]
s_sum = []
def dfs(i, sum):
if i == n:
s_sum.append(sum)
else:
dfs(i + 1, sum + s[i])
dfs(i + 1, sum)
dfs(0, 0)
s_sum_c = [s for s in s_sum if s % 10 != 0]
print(max(s_sum_c)... |
s203686193 | p03699 | u728120584 | 1583529029 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 170 | N = int(input())
s = [int(input()) for i in range(N)]
ans = sum(s)
for i in s:
if ans % 10 == 0:
ans -= i
continue
print(ans)
exit(1)
print(0) |
s742945714 | p03699 | u063073794 | 1581394970 | Python | Python (3.4.3) | py | Runtime Error | 22 | 3188 | 71 | 全部10の倍数ならNG
一番小さい10お倍数以外を引く |
s202727463 | p03699 | u843722521 | 1580071675 | Python | PyPy3 (2.4.0) | py | Runtime Error | 172 | 38384 | 188 | n=int(input())
s=[int(input()) for _ in range(n)]
x=sum(s)
if x%10:
print(x)
else:
a=[]
for i in s:
if i%10:
a.appned(i)
if a:
print(x-min(a))
else:
print(0)
|
s591895167 | p03699 | u083960235 | 1579743334 | Python | Python (3.4.3) | py | Runtime Error | 40 | 5180 | 946 | import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_upper... |
s025300914 | p03699 | u879574571 | 1577934929 | Python | Python (3.4.3) | py | Runtime Error | 16 | 3064 | 354 | N = int(input())
inputs = [int(input()) for i in range(N)]
points = [int(s) for s in inputs]
points_sorted = sorted(points)
get_point = sum(points)
idx = 0
if get_point % 10 != 0:
print(get_point)
else:
while points_sorted[idx] % 10 == 0:
idx += 1
if idx == N - 1:
print(0)
pri... |
s285312872 | p03699 | u879574571 | 1577934827 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 350 | N = int(input())
inputs = [int(input()) for i in range(N)]
points = [int(s) for s in inputs]
points_sorted = sorted(points)
get_point = sum(points)
idx = 0
if get_point % 10 != 0:
print(get_point)
else:
while points_sorted[idx] % 10 == 0:
idx += 1
if idx == N:
print(0)
print(g... |
s777747168 | p03699 | u879574571 | 1577934351 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 425 | N = int(input())
inputs = [int(input()) for i in range(N)]
points = [int(s) for s in inputs]
points_sorted = sorted(points)
get_point = sum(points)
if get_point % 10 != 0:
print(get_point)
else:
cand1 = get_point - points_sorted[0]
cand2 = get_point - points_sorted[1]
if (cand1 > cand2) and (cand1 % 1... |
s194883898 | p03699 | u879574571 | 1577932335 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 220 | inputs = list(input().split())
n = inputs[0]
points = [int(s) for s in inputs[1:]]
get_point = sum(points)
while get_point % 10 == 0:
get_point -= min(points)
if get_point <= 0:
break
print(get_point) |
s997280115 | p03699 | u581187895 | 1577922849 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 214 | import numpy as np
N = int(input())
A = np.array([int(input()) for _ in range(N)])
total = A.sum()
if total%10 == 0:
if np.any(A%10 != 0):
total -= A[A%10 != 0].min():
else:
total = 0
print(total) |
s101297874 | p03699 | u348868667 | 1576185649 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 181 | if sum(s)%10 != 0:
print(sum(s))
else:
for i in range(N):
if s[i]%10 != 0:
print(sum(s)-s[i])
break
if i == N-1:
print(0) |
s199934966 | p03699 | u348868667 | 1576185640 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 181 | if sum(s)%10 != 0:
print(sum(s))
else:
for i in range(N):
if s[i]%10 != 0:
print(sum(s)-s[i])
break
if i == N-1:
print(0) |
s524668206 | p03699 | u987164499 | 1574881827 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 163 |
for i in lin:
i = list(i)
lis = list(accumulate(i))[::-1]
for i in lis:
if i % 10 == 0:
continue
ma = max(ma,i)
print(ma)
|
s539152000 | p03699 | u736524428 | 1574824063 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 188 | N = int(input())
S = [int(input())for _ in range(N)]
S.sort()
S_all = sum(S)
if S_all % 10 != 0:
print(S_all)
exit()
i = 0
while S[i] % 10 == 0:
i += 1
print(S_all - S[i]) |
s612410174 | p03699 | u088552457 | 1574137345 | Python | Python (3.4.3) | py | Runtime Error | 2104 | 8968 | 372 | n = int(input())
a = []
b = ""
for i in range(n):
a.append(int(input()))
b += "1"
b_count = int(b, 2)
score_list = []
for i in range(b_count + 1):
score = 0
b_str = format(i, "0"+str(len(b))+"b")
for index, bi in enumerate(list(b_str)):
if bi == "1":
score += a[index]
if score % 10 != 0:
sco... |
s936955674 | p03699 | u088552457 | 1574137135 | Python | Python (3.4.3) | py | Runtime Error | 2104 | 23264 | 387 | n = int(input())
a = []
b = ""
for i in range(n):
a.append(int(input()))
b += "1"
b_count = int(b, 2)
score_list = []
for i in range(b_count + 1):
score = 0
b_str = format(i, "0"+str(len(b))+"b")
print(b_str)
for index, bi in enumerate(list(b_str)):
if bi == "1":
score += a[index]
if score % 1... |
s010118444 | p03699 | u088552457 | 1574135613 | Python | Python (3.4.3) | py | Runtime Error | 2108 | 10588 | 368 | n = int(input())
a = []
b = ""
for i in range(n):
a.append(int(input()))
b += "1"
b_count = int(b, 2)
score_list = []
for i in range(b_count):
score = 0
b_str = format(i, "0"+str(len(b))+"b")
for index, bi in enumerate(list(b_str)):
if bi == "1":
score += a[index]
if score % 10 != 0:
score_l... |
s590296402 | p03699 | u951480280 | 1574014147 | Python | Python (3.4.3) | py | Runtime Error | 18 | 2940 | 125 | n=int(input())
S=sorted([int(input()) for _ in range(n)])
ans=sum(S)
i=0
while ans%10 == 0:
ans-=S[i]
i+=1
print(ans) |
s410545369 | p03699 | u620755587 | 1573756818 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 126 | _,*s=map(int,[*open(0)])
a=[*filter(lambda x:x%10,sorted(s)),""]
b=sum(map(int,s))
print(b-[[0,a[0]],[b,b]][a==[""]][b%10==0]) |
s880407126 | p03699 | u172569352 | 1573138131 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 327 | def b(N, s):
v = sum(s)
for i in range(N, 0, -1):
if v % 10 == 0:
if s[i-1] % 10:
v -= s[i-1]
continue
else:
return a
return 0
N = int(input())
s = []
for _ in range(N):
s.append(int(input()))
s.sort(key=lambda x:-x)
print(b... |
s535507228 | p03699 | u172569352 | 1573138046 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3060 | 323 | def b(N, s):
v = sum(s)
for i in range(N, 0, -1):
if v % 10 == 0:
if s[i] % 10:
v -= s[i]
continue
else:
return a
return 0
N = int(input())
s = []
for _ in range(N):
s.append(int(input()))
s.sort(key=lambda x:-x)
print(b(N, ... |
s000104760 | p03699 | u254871849 | 1572718085 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 398 | import sys
input = sys.stdin.readline
from itertools import combinations
N = int(input().rstrip())
s = [int(input().rstrip()) for _ in range(N)]
s.sort(reverse=1)
for s in s:
if s % 10 != 0:
break
else:
print(0)
for i in range(N, 0, -1):
for c in combinations(s, i):
if sum(c) % 10 == 0:
... |
s966905026 | p03699 | u042802884 | 1572149434 | Python | PyPy3 (2.4.0) | py | Runtime Error | 167 | 38256 | 207 | N=int(input())
s=[]
for i in range(N):
s.append(int(input()))
ans=sum(s)
if ans%10==0:
s.sort()
for si in s:
if ans%10!=0:
ans-=si
break
if ans%10==0:
ans=0
print(ans) |
s138631397 | p03699 | u740284863 | 1571348381 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3060 | 248 | n = int(input())
s = [int(input()) for i in range(n)]
s.sort()
j = sum([ i % 10 for i in s ])
if j == 0:
ans = 0
else:
for i in range(n):
tmp = sum(s)-s[i]
if tmp % 10 != 0:
ans = tmp
break
print(ans) |
s978650237 | p03699 | u747602774 | 1571290169 | Python | Python (3.4.3) | py | Runtime Error | 22 | 3444 | 226 | import copy
N=int(input())
li=[]
for n in range(N):
li.append(int(input()))
li.sort()
li2=copy.copy(li)
S=sum(li)
for n in range(N):
if li[n]%10==0:
li2.pop(n)
while S%10==0 and li2!=[]:
S-=li2.pop(0)
print(S) |
s802877477 | p03699 | u886747123 | 1571245242 | Python | Python (3.4.3) | py | Runtime Error | 212 | 3944 | 475 | # C - Bugged
# DP Overkill
N = int(input())
s = [int(input()) for _ in range(N)]
dp = [0] + [-1]*sum(s)
while s:
x = s.pop()
for idx in reversed(range(len(dp))):
if dp[idx] != -1 and idx + x <= len(dp) - 1:
dp[idx+x] = dp[idx] + x
dp = set(dp)
dp.remove(-1)
dp = list(dp)
dp.s... |
s059608410 | p03699 | u740284863 | 1571205255 | Python | PyPy3 (2.4.0) | py | Runtime Error | 164 | 38512 | 205 | n = int(input())
pros = [ int(input()) for i in range(n)]
pros.sort()
tmp = sum(pros)
if tmp % 10 == 0:
ttmp = sum(pros[0:-1])
if ttmp % 10 == 0:
ans = 0
else:
ans = tmp
print(ans) |
s035653827 | p03699 | u740284863 | 1571204978 | Python | Python (3.4.3) | py | Runtime Error | 2104 | 3060 | 284 | n = int(input())
pros = [ int(input()) for i in range(n)]
k = set()
for i in range(1 << len(pros)):
output = []
for j in range(len(pros)):
if ((i >> j) & 1) == 1:
output.append(pros[j])
if sum(output) % 10 != 0:
k.add(sum(output))
print(max(k)) |
s187399396 | p03699 | u564902833 | 1571145778 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 302 | n = int(input())
s = []
for i in range(n):
tmp = int(input())
s.append(tmp)
sorted(s)
max_s = sum(s)
if max_s % 10 != 0:
print(max_s)
else:
for j in range(n):
if s[j] % 10 != 0:
print(max_s - s[j])
break
elif j == n-1:
assert False
|
s597416832 | p03699 | u564902833 | 1571145638 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 324 | ```
n = int(input())
s = []
for i in range(n):
tmp = int(input())
s.append(tmp)
sorted(s)
max_s = sum(s)
if max_s % 10 != 0:
print(max_s)
else:
for j in range(n):
if s[j] % 10 != 0:
print(max_s - s[j])
break
elif j == n-1:
assert "a"
prin... |
s482481575 | p03699 | u476124554 | 1571143404 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 278 | n = int(input())
s = []
for i in range(n):
tmp = int(input())
s.append(tmp)
sorted(s)
max_s = sum(s)
if max_s % 10 != 0:
print(max_s)
else:
for j in range(n):
if s[j] % 10 != 0:
print(max_s - s[j])
break
if j == n-1:
print(0) |
s412314165 | p03699 | u215743476 | 1569697667 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 203 | n = int(input())
s = [int(input()) for _ in range(n)]
s.sort()
s_max = sum(s)
if s_max % 10 != 0:
print(s_max)
else:
for i in s if i % 10 != 0:
print(s_max - i)
exit()
print(0) |
s905182049 | p03699 | u450904670 | 1569390730 | Python | PyPy3 (2.4.0) | py | Runtime Error | 175 | 38768 | 348 | n = int(input())
s = [ int(input()) for i in range(n)]
dp = [[0 for _ in range(n+1)] for _ in range(n) ]
for i in range(1, n + 1):
dp[0][i] = s[0]
for i in range(1, n):
for j in range(n + 1):
if (i == j):
dp[i][j] = dp[i - 1][j]
else:
dp[i][j] = dp[i - 1][j] + s[i]
print(max([it for it in dp... |
s828332737 | p03699 | u033606236 | 1569293695 | Python | Python (3.4.3) | py | Runtime Error | 287 | 11508 | 398 | n = int(input())
a = [int(input()) for _ in range(n)]
dp = [[] for _ in range(n+1)]
for i in range(n+1):
dp[i] += [-1 for _ in range(10010)]
dp[0][0] = 1
for i in range(n):
for j in range(10010):
if dp[i][j] == 1:
dp[i+1][j] = 1
dp[i+1][j+a[i]] = 1
for i in range(10010):
if ... |
s542646477 | p03699 | u777283665 | 1568926733 | Python | Python (3.4.3) | py | Runtime Error | 18 | 2940 | 509 | import java.util.Arrays;
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int[] s = new int[n];
int sum = 0;
for (int i = 0; i<n; i++) {
s[i] = sc.nextInt();
sum += s[i];
}
Arrays.sort(s);
if (sum%... |
s201803420 | p03699 | u155687575 | 1568284574 | Python | PyPy3 (2.4.0) | py | Runtime Error | 164 | 38256 | 447 | n = int(input())
slist = [int(input()) for _ in range(n)]
slist = sorted(slist)
max_ = 0
for i in range(n+1):
if i == 0:
val = sum(slist)
if val%10 != 0:
max_ = val
break
else:
for j in range(n-i):
tmp = slist.copy()
for k in range(j, j+i)... |
s253894919 | p03699 | u314050667 | 1568163686 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3060 | 227 | N=int(input())
A=sorted([int(input()) for _ in range(N)])
tot=sum(A)
if tot%10!=0:
print(tot)
sys.exit()
else:
for i in range(N):
if A[i]%10!=0:
print(tot-A[i])
sys.exit()
print(0)
|
s142178419 | p03699 | u027929618 | 1568032583 | Python | Python (3.4.3) | py | Runtime Error | 18 | 2940 | 139 | N = int(input())
S = [int(input()) for _ in range(N)]
S.sort(reverse=True)
ans = sum(S)
while (ans % 10) == 0:
ans -= S.pop(0)
print(ans) |
s133618906 | p03699 | u027929618 | 1568032529 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 128 | N = int(input())
S = [int(input()) for _ in range(N)]
S.sort()
ans = sum(S)
while (ans % 10) == 0:
ans -= S.pop(0)
print(ans) |
s137892164 | p03699 | u027929618 | 1568001681 | Python | Python (3.4.3) | py | Runtime Error | 18 | 2940 | 142 | N = int(input())
S = [int(input()) for _ in range(N)]
sorted(S, reverse=True)
ans = sum(S)
while (ans % 10) == 0:
ans -= S.pop(0)
print(ans) |
s204567796 | p03699 | u298297089 | 1566343181 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 270 | n = int(input())
ten = []
notten = []
for _ in range(n):
s = int(input())
if s % 10:
notten.append(s)
else:
ten.append(s)
ans = sum(notten) + sum(ten)
if sum(notten) % 10 == 0:
print(ans - min(notten))
elif ans % 10 == 0:
print(0)
else:
print(ans)
|
s122215889 | p03699 | u794250528 | 1565664238 | Python | PyPy3 (2.4.0) | py | Runtime Error | 197 | 59868 | 286 | n = int(input())
s = [int(input()) for _ in range(n)]
dp = [set() for _ in range(n + 1)]
for i in range(n):
dp[i + 1].update(dp[i])
for x in dp[i]:
dp[i + 1].add(x + s[i])
dp[i + 1].add(s[i])
ans = max((x for x in dp[i + 1] if x % 10 != 0), default=0)
print(ans)
|
s357355103 | p03699 | u952022797 | 1565127259 | Python | PyPy3 (2.4.0) | py | Runtime Error | 2106 | 45100 | 993 | # -*- coding: utf-8 -*-
import sys
import copy
import collections
from bisect import bisect_left
from bisect import bisect_right
from collections import defaultdict
from heapq import heappop, heappush
import math
import itertools
import random
# NO, PAY-PAY
#import numpy as np
#import statistics
#from statistics impo... |
s098468366 | p03699 | u736729525 | 1565041967 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 213 | # 2^100
N = int(input())
S = [None] * N
for i in range(N):
S[i] = int(input())
S.sorted(reverse=True)
total = sum(S)
for i in range(N):
if total % 10 != 0:
break
total -= S[i]
print(total)
|
s260490670 | p03699 | u665038048 | 1564588459 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 172 | n = int(input())
s =[]
for i in range(n):
s.append(int(input()))
max_s = sum(s)
s.sort()
while str(max_s)[-1] == '0':
max_s -= s[0]
s.remove(s[0])
print(max_s)
|
s630219070 | p03699 | u623687794 | 1560951345 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 241 | n=int(input())
q=[]
for i in range(n):
q.append(int(input()))
s=sum(q)
check=s%10
if check!=0:
print(s)
else:
r=max(q)
cnt=0
for i in q:
if i%10!=0 and i<r:
r=i
cnt+=1
if cnt=0:
print(0)
else:
print(q-r) |
s509764474 | p03699 | u463655976 | 1560633657 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 125 | N = int(input())
s =[int(input()) for _ in range(N)]
S = sum(s)
print(S-min([x for x in s if x % 10!=0]+[[0,S][(S%10)*1]]))
|
s338766270 | p03699 | u463655976 | 1560632776 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 131 | N = int(input())
s =[int(input()) for _ in range(N)]
if sum(s) % 10 != 0:
s -= min([for x in s if x % 10 == 0] + [s])
print(s)
|
s717775922 | p03699 | u463655976 | 1560632730 | Python | Python (3.4.3) | py | Runtime Error | 18 | 2940 | 131 | N = int(input())
s =[int(input()) for _ in range(N)]
if sum(s) % 10 != 0:
s -= min([for x in s if s % 10 == 0] + [s])
print(s)
|
s894601265 | p03699 | u463655976 | 1560628075 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 301 | N = int(input())
ssum = 0
not10min = -1
for si in map(int(input()) for _ in range(N)):
ssum += si
if si % 10 != 0:
if not10min < 0:
not10min = si
else:
not10min = min(not10min, si)
if ssum % 10 ==0:
if not10min >= 0:
ssum -= not10min
else:
ssum = 0
print(ssum)
|
s755837016 | p03699 | u722535636 | 1560327351 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 242 | n=int(input())
s=[int(input()) for i in range(n)]
ten=[]
p=[]
for x in s:
if x%10==0:ten.append(x)
else:p.append(x)
ten=sum(ten)
if len(p)==0:print(0)
else:
p=sorted(p)
Sum=sum(p)
print(Sum+ten-p[0] if Sum%10==0 else Sum+ten) |
s661813326 | p03699 | u902151549 | 1560165341 | Python | Python (3.4.3) | py | Runtime Error | 20 | 3184 | 396 | # coding: utf-8
import time
import re
import math
def main():
global N,A,memo
N=int(input())
A=[int(input()) for a in range(N)]
if sum(A)%10==0:
nm0=[]
for a in A:
if not a%10==0:
nm0.append(a)
if len(nm0)==0:
print(0)
else:
... |
s903733007 | p03699 | u960653324 | 1559148802 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 209 | N = int(input())
S = [int(input()) for i in range(N)]
ans = sum(S)
S.sort()
for s in S:
if ans%10 == 0 and s%10 != 0:
ans = ans - s
break
if ans%10 != 0:
print(ans)
else:
print(0)
|
s224607867 | p03699 | u211160392 | 1558996280 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3056 | 179 | N = int(input())
s = list(int(input().split())for i in range(N))
ans = sum(s)
if ans%10 == 0:
for i in s:
if i%10!=0:
ans -= i
break
print(ans) |
s246302863 | p03699 | u722189950 | 1557025341 | Python | Python (3.4.3) | py | Runtime Error | 19 | 3064 | 485 | #ABC063C
N = int(input())
s = [int(input()) for _ in range(N)]
ans = -1
s.sort()
for _ in range(N+1):
ans = sum(s)
if ans % 10 != 0:
break
elif len(s) == 0:
ans = 0
break
elif len(s) >= 2:
del_ok = False
for i in range(1, len(s)):
if (ans - s[0])%10 ==... |
s831113312 | p03699 | u722189950 | 1557025067 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 462 | #ABC063C
N = int(input())
s = [int(input()) for _ in range(N)]
ans = -1
s.sort()
for _ in range(N+1):
ans = sum(s)
if ans % 10 != 0:
break
elif len(s) == 0:
ans = 0
break
elif len(s) >= 2:
for i in range(1, len(s)):
if (ans - s[0])%10 == 0 and (ans - s[i])%10 ... |
s382536444 | p03699 | u722189950 | 1557023686 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 357 | #ABC063C
N = int(input())
s = [int(input()) for _ in range(N)]
ans = -1
s.sort()
for _ in range(N+1):
ans = sum(s)
if ans % 10 != 0:
ans = max(ans, sum(s))
break
else:
if (ans - s[0])%10 == 0:
s.pop(1)
else:
s.pop(0)
if len(s) == 0:
... |
s102501015 | p03699 | u091051505 | 1556635818 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 233 | n = int(input())
dp = [0] * (2**n)
s = []
for _ in range(n):
s.append(int(input()))
for i in range(n):
k = 2 ** i
for j in range(k):
dp[k+j] = dp[j] + s[i]
dp = [i if (i%10 != 0) else 0 for i in dp]
print(max(dp)) |
s686566422 | p03699 | u623819879 | 1555945854 | Python | PyPy3 (2.4.0) | py | Runtime Error | 172 | 38384 | 374 | n=int(input())
a=[]
b=[]
for i in range(n):
x=int(input())
c.append(x)
if x%10==0:
b.append(x)
else:
a.append(x)
a.sort()
ans=sum(a)+sum(b)
if ans%10==0:
if len(a)>0:
ans-=a[0]
else:
ans=0
dp=[0]
for i in range(n):
for v in dp:
dp.append(v+c[i])
#dp.sort()[::-1]
ans=0
for i in dp... |
s768743009 | p03699 | u885523920 | 1555369158 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 210 | T=int(input())
si=[]
sum=0
for i in range(T):
si.append(int(input()))
sum=sum+int(input())
sorted(si)
for j in range(T):
if si[j]%10!=0:
sum=sum-si[j]
break
else:
sum=sum-si[j]
print(sum)
|
s790703856 | p03699 | u619197965 | 1555288684 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 283 | n=int(input())
s=sorted([int(input()) for _ in range(n)])
ans=sum(s)
if ans%10==0:
tmp=ans
for i in range(n):
tmp-=s[i]
if tmp%10!=0:
break
num=ans
for i in s:
if i%10!=0:
num=i
break
print(max(tmp,ans-num)) |
s984043156 | p03699 | u512007680 | 1554834772 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 361 | n = int(input())
s = [0] * n
for i in range(0,n):
s[i] = int(input())
#print(s)
l0 = []
l1 = []
for i in range(0,n):
if s[i] % 10 == 0:
l1.append(s[i])
else:
l0.append(s[i])
#print(l)
w = sum(s)
if w % 10 != 0:
ans = w
elif l[0] == []:
ans = 0
else:
l0.sort
#prin... |
s400405968 | p03699 | u268516119 | 1554510227 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3060 | 189 | N=int(input())
Q=sorted([int(input()) for i in range(N)])
S=sum(Q)
mods=S%10
if mods!=0:
ans=S
else:
for i in Q:
if i%10!=0:
ans=S-i
break
print(ans) |
s015184134 | p03699 | u315485238 | 1554123690 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3060 | 177 | N=int(input())
S=[int(input()) for _ in range(N)]
if sum(S)%10:
print(sum(s))
exit()
min_s1=101
for s in S:
if s%10:
min_s1 = min(s, min_s1)
print(sum(S) - min_s1) |
s634129478 | p03699 | u151625340 | 1553791009 | Python | Python (3.4.3) | py | Runtime Error | 19 | 3060 | 213 | N = int(input())
s = list(map(int,input().split()))
ss = sum(s)
m = 101
for i in range(N):
if s[i] % 10 != 0 and s[i] < m:
m = s[i]
if m == 101: print(0)
elif ss % 10 == 0: print(ss-m)
else: print(ss)
|
s489738460 | p03699 | u151625340 | 1553790941 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3060 | 205 | N = int(input())
s = list(map(int,input().split()))
ss = sum(s)
m = 101
for i in range(N):
if s[i] % 10 != 0 and s[i] < m: m = s[i]
if m == 101: print(0)
elif ss % 10 == 0: print(ss-m)
else: print(ss)
|
s198598697 | p03699 | u620945921 | 1552876587 | Python | Python (3.4.3) | py | Runtime Error | 96 | 3316 | 310 | n=int(input())
s=[int(input()) for i in range(n)]
#print(n,s)
dp=[float('-inf') for i in range(10000+1)]
#print(dp)
dp[0]=0
k=0
for j in range(n):
k+=s[j]
for i in range(k):
dp[i+k]=dp[i]+s[j]
#print(dp)
for i in range(len(dp)):
if dp[i]%10==0:
dp[i]=0
print(max(dp))
|
s378133688 | p03699 | u807772568 | 1552426366 | Python | PyPy3 (2.4.0) | py | Runtime Error | 188 | 38640 | 196 | n = int(input())
a = []
b = []
for i in range(n):
k = int(input())
if k % 10 == 0:
a.append(k)
else:
b.append(k)
su = sum(a)
b.sort()
su += sum(b) - b[0]
print(su) |
s221706066 | p03699 | u185896732 | 1551902938 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 206 | import sys
n=int(input())
s=[]
for i in range(n):
s.append(int(input()))
s.sort()
sm=sum(s)
if sm%10!=0:
print(sm)
sys.exit()
while 1:
a=s.pop(0)
t=sum(s)
if t%10!=0:
print(t)
sys.exit() |
s856799621 | p03699 | u865413330 | 1551611034 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 175 | n = int(input())
l = [int(input()) for i in range(n)]
total = sum(l)
i = 0
while total % 10 == 0:
if i = n:
break
total = total - l[i]
i += 1
print(total)
|
s466867393 | p03699 | u652081898 | 1551336197 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 254 | n = int(input())
s_original = [int(input()) for _ in range(n)]
S = sorted(s_original)
SUM = sum(S)
ANS = []
if SUM%10 != 0:
ANS.append(SUM)
for i in range(n):
ans = SUM - S[i]
if ans%10 != 0:
ANS.append(SUM - S[i])
print(max(ANS)) |
s528682159 | p03699 | u371763408 | 1550163191 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3060 | 161 | n=int(input())
S=sorted([int(input()) for i in range(n)])
not_10=[i for i in S if i%10!=0]
sums=sum(S)
if sums%10!=0:
print(sums)
else:
print(sums-not_10[0]) |
s430714353 | p03699 | u219607170 | 1548900963 | Python | Python (3.4.3) | py | Runtime Error | 23 | 3060 | 230 | N = int(input())
p1, p2, p5 = 1, 1, 1
for _ in range(N):
s = int(input())
if s%10 == 0:
pass
elif s%5 == 0:
p5 *= s
elif s%2 == 0:
p2 *= s
else:
p1 *= s
print(p1 * (max(p2, p3))) |
s045622485 | p03699 | u281303342 | 1547607821 | Python | Python (3.4.3) | py | Runtime Error | 19 | 3060 | 248 | N = int(input())
S = [int(input()) for _ in range(N)]
r = []
ans = 0
for i in range(N):
ans += S[i]
if S[i]%10!=0:
r.append(S[i])
r.sort()
if ans%10==0:
if len(rr)>0:
ans -= r[0]
else:
ans = 0
print(ans)
|
s948129164 | p03699 | u281303342 | 1547607777 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3060 | 251 | N = int(input())
S = [int(input()) for _ in range(N)]
rr = []
ans = 0
for i in range(N):
ans += S[i]
if S[i]%10!=0:
rr.append(S[i])
rr.sort()
if ans%10==0:
if len(rr)>0:
ans -= r[0]
else:
ans = 0
print(ans)
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.