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
s714944906
p04012
u023229441
1551237589
Python
Python (3.4.3)
py
Runtime Error
18
2940
96
s=input() s=list(s) for i in s: if s.count(s[i])%2==1: print("No") exit() print("Yes")
s105399236
p04012
u952130512
1550487885
Python
Python (3.4.3)
py
Runtime Error
18
2940
181
w=input() s=[0]*123 for i in len(w): s[ord(w[i-1])]+=1 c=1 for i in range(97,97+26): if s[i]%2==1: c=0 break if c==1: print("Yes") else: print("No")
s973379677
p04012
u952130512
1550487225
Python
Python (3.4.3)
py
Runtime Error
17
2940
246
w=input() s=[0]*123 while len(w)==0: for i in range(97,97+26): if chr(i)==w[0]: s[i]+=1 w=w[1:] c=1 for i in range(97,97+26): if s[i]%2!=0: c=0 break if c==1: print("Yes") else: print("No")
s643497576
p04012
u952130512
1550487153
Python
Python (3.4.3)
py
Runtime Error
17
2940
272
w=input() s=[0]*123 while len(w)==0: for i in range(97,97+26): if chr(i)==w[0]: s[i]+=1 w=w[1:] c=1 for i in range(97,97+26): if s[i]%2==0: continue else: c=0 break if c=1: print("Yes") else: print("No")
s015845746
p04012
u952130512
1550487090
Python
Python (3.4.3)
py
Runtime Error
17
2940
273
w=input() s=[0]*123 while(len(w)==0): for i in range(97,97+26): if chr(i)==w[0]: s[i]+=1 w=w[1:] c=1 for i in range(97,97+26): if s[i]%2==0: continue else: c=0 break if c=1: print("Yes") else: print("No")
s035876876
p04012
u518064858
1550383497
Python
Python (3.4.3)
py
Runtime Error
18
2940
150
s=input() p=list(set(list(s))) a=[] for i in p: a.append(s.count(i)) for x in a: if x%2!==0: print("No") exit() print("Yes")
s842754421
p04012
u518064858
1550383448
Python
Python (3.4.3)
py
Runtime Error
17
2940
148
s=input() p=list(set(list(s))) a=[] for i in p a.append(s.count(i)) for x in a: if x%2!==0: print("No") exit() print("Yes")
s248515623
p04012
u367130284
1549828729
Python
Python (3.4.3)
py
Runtime Error
18
2940
85
d={c:list(input()) for c in "abc"} s="a" while d[s]: s=d[s].pop(0) print(s.upper())
s563909811
p04012
u089032001
1546369176
Python
Python (3.4.3)
py
Runtime Error
18
2940
137
from collection import Counter S = Counter(list(input())) for k, v in S.items(): if v % 2 == 1: print("No") exit() print("Yes")
s815643729
p04012
u762420987
1545619198
Python
Python (3.4.3)
py
Runtime Error
18
3060
480
//https://atcoder.jp/contests/abc044/tasks/abc044_b //044-BをC++でといてみる #include<iostream> #include<algorithm> #include<string> #include<map> using namespace std; int main(void){ string w; cin >> w; map<char,int> mp; int i; for (i = 0; i < w.size(); i++){ mp[w[i]] += 1; } for (pair<char,...
s665057068
p04012
u782098901
1545496668
Python
Python (3.4.3)
py
Runtime Error
17
2940
369
#include <iostream> #include <map> #include <string> using namespace std; int main() { string w; cin >> w; map<char, int> count; for (auto s : w) { count[s] += 1; } for (auto itr = count.begin(); itr != count.end(); itr++) { if (itr->second % 2 == 1) { cout << "No" << endl; return 0; ...
s649604466
p04012
u284854859
1545419652
Python
Python (3.4.3)
py
Runtime Error
19
3064
685
n,a = map(int,input().split()) x = list(map(int,input().split())) #dp[j][k][s] = (x0...xj からk枚選んでxiの合計をsにするような選び方の総数) dp = [[[0 for s in range(a*n+1) ] for k in range(n+1) ] for j in range(n)] for j in range(n): dp[j][0][0]=1 if x[0]<= a*n: dp[j][1][x[0]] = 1 for j in range(n-1): for k in range(n...
s526178871
p04012
u397531548
1541557884
Python
Python (3.4.3)
py
Runtime Error
17
2940
136
from collections import Counter num=Counter(input()) ans="YES" for X in num.values(): if X%2!=0: ans="NO" print(ans)
s442940448
p04012
u432805419
1541474219
Python
Python (3.4.3)
py
Runtime Error
17
2940
135
a = list(input()) b = list(set(a)) for i in range(b): if a.count(b[i]) % 2 != 0: print("No") break else: print("Yes")
s656426363
p04012
u657913472
1537906390
Python
Python (3.4.3)
py
Runtime Error
17
2940
90
s=input();c=[f=0]*26 for i in s:c[ord(i)-97]+=1 for i in c:f+=i%2 print("YNeos"[(f>0)::2])
s163787253
p04012
u657913472
1537906369
Python
Python (3.4.3)
py
Runtime Error
17
2940
88
s=input();c=[f=0]*26 for i in s:c[ord(i)-97]+=1 for i in c:f+=i%2 print("YNeos"[!!f::2])
s802251633
p04012
u787562674
1536535893
Python
Python (3.4.3)
py
Runtime Error
17
2940
114
w = input()) for s in set(w): if w.count(s) % 2 != 0: print('No') break else: print('Yes')
s824817002
p04012
u409064224
1530229110
Python
Python (3.4.3)
py
Runtime Error
17
3060
328
s = input() #l = [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0] l = [] roll = ord('z')-ord('a') for i in range(roll): l.append(0) for i in range(len(s)): num = ord(s[i]) l[num-97] += 1 #print(num) for i in range(roll): if l[i]%2 != 0: print("No") break else: print...
s745936581
p04012
u409064224
1530228978
Python
Python (3.4.3)
py
Runtime Error
17
3064
328
s = input() #l = [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0] l = [] roll = ord('z')-ord('a') for i in range(roll): l.append(0) for i in range(len(s)): num = ord(s[i]) l[num-97] += 1 #print(num) for i in range(roll): if l[i]%2 != 0: print("No") exit() else: prin...
s678137372
p04012
u894440853
1528375448
Python
Python (3.4.3)
py
Runtime Error
17
2940
80
S = input() print("Yes" if all([S.count(e) % 2 == 0 for e in set(S)] else "No"))
s611582427
p04012
u894440853
1528375139
Python
Python (3.4.3)
py
Runtime Error
18
2940
118
S = input() S_elements = set(s) for e in S_elements: if S.count(e) % 2 != 0: print("No") exit() print("Yes")
s064906723
p04012
u573970531
1524631005
Python
Python (3.4.3)
py
Runtime Error
17
3060
169
in1 = list(input()) in1.sort() i = 1 flg = True while i <= len(in1): if in1[i] != in1[i-1]: flg = False break i+=2 if flg: print("Yes") else: print("No")
s969827905
p04012
u027622859
1522515216
Python
Python (3.4.3)
py
Runtime Error
17
2940
5
hthth
s165707929
p04012
u773981351
1521245115
Python
Python (3.4.3)
py
Runtime Error
17
2940
157
from collections import Counter word = input() c = Counter(word) counts = c.values() if all(map(lambda x: x % 2 == 0, counts)) print('Yes') else print('No')
s518824699
p04012
u419874471
1492287179
Python
Python (3.4.3)
py
Runtime Error
17
2940
148
w = input() m = Map() for t in w: m[t] = m.get(t, 0) + 1 for c, cnt in m: if cnt % 2 == 1: print("No") exit() print("Yes")
s776198063
p04012
u419874471
1491932838
Python
Python (3.4.3)
py
Runtime Error
17
3060
333
#!/usr/bin/env python #coding:utf-8 def input_strs(): return input().split(" ") def input_nums(): return [int(i) for i in input_strs()] w = input() ok = True h = Map() for c in w: p = 0 for k in w: if c == k: p += 1 ok = ok and (p % 2 == 0) if ok: print("Yes") else: ...
s398708205
p04012
u419874471
1491932463
Python
Python (3.4.3)
py
Runtime Error
17
3060
315
#!/usr/bin/env python #coding:utf-8 def input_strs(): return input().split(" ") def input_nums(): return [int(i) for i in input_strs()] w = input() ok = True h = Map() for i in w: h[i] = h.get(i, 0) + 1 for key in h: ok = ok and (h[key] % 2 == 0) if ok: print("Yes") else: print("No")
s602689309
p04012
u312012633
1484982105
Python
Python (3.4.3)
py
Runtime Error
26
3316
256
from collections import defaultdict def is_beautiful(s): d = defaultdict(int) for c in input(): d[c] += 1 for v in d.values(): if v % 2: return False return True print("YES" if is_beautiful(input()) else "NO")
s942463303
p04012
u830390742
1481430684
Python
Python (2.7.6)
py
Runtime Error
16
2568
112
from collections import Counter print 'Yes' if all(v % 2 == 0 for v in Counter(raw_input()).values())) else 'No'
s411379669
p04012
u831695469
1478720103
Python
Python (3.4.3)
py
Runtime Error
23
3064
310
w = input() l = list(w) l.sort() ans = "Yes" for i in range(len(l)/2): if l[2*i] != l[2*i+1]: ans = "No" break print(ans)
s835231184
p04012
u831695469
1478720051
Python
Python (3.4.3)
py
Runtime Error
22
3064
308
w = input() l = list(w) l.sort() ans = "Yes" for i in range(len(l)): if l[2*i] != l[2*i+1]: ans = "No" break print(ans)
s747029221
p04012
u133038626
1475362430
Python
Python (3.4.3)
py
Runtime Error
23
3064
102
o = "Yes" for v in collections.Counter(input().strip()).values(): if v % 2 != 0: o = "No" print(o)
s354551257
p04012
u514826602
1473172197
Python
Python (3.4.3)
py
Runtime Error
39
3064
193
w = list(input()) w.sort() isBeautiful = True length = len(w) for i in range(0, length, 2): if w[i] is not w[i + 1]: isBeautiful = False break print('Yes' if isBeautiful else 'No')
s544757469
p04012
u914627967
1473109242
Python
Python (3.4.3)
py
Runtime Error
40
3188
389
a,b,c,d,e,f,g,h,i,j,k=0,1,2,3,4,5,6,7,8,9,10 l,m,n,o,p,q,r,s,t,u,v,w,x,y,z=11,12,13,14,15,16,17,18,19,20,21,22,23,24,25 W=input() W=list(W) L=len(W) lis=[0 for s in range(25)] if L%2!=0: print("No")#奇数個の場合はあり得ない else: for s in range(L): temp=W[s] lis[eval(temp)]+=1 for s in range(26): if lis[s]%2!=0: print...
s262205650
p04012
u030110634
1472759137
Python
Python (3.4.3)
py
Runtime Error
61
4084
155
import string import sys w = raw_input() for c in string.ascii_lowercase: if w.count(c) % 2 == 1: print("No") sys.exit() print("Yes")
s894699935
p04012
u732844340
1472433260
Python
Python (3.4.3)
py
Runtime Error
41
3064
161
flag = 0 counter = Counter(w) for word, cnt in counter.most_common(): if cnt % 2 != 0: flag = 1 print("NO") if flag == 0: print("YES")
s505928963
p04013
u806976856
1600484271
Python
PyPy3 (7.3.0)
py
Runtime Error
212
135596
449
n,a=map(int,input().split()) x=list(map(int,input().split())) A=max(x) x.insert(0,-1) dp=[[[0]*(n+1) for _ in range(n*A+1)] for i in range(n+1)] dp[1][x[1]][1]=1 dp[1][0][0]=1 for i in range(1,n): q=x[i+1] for s in range(n*A+1): for k in range(i+1): if s+q<=n*A: dp[i+1][s+q]...
s913984672
p04013
u381585104
1600071300
Python
Python (3.8.2)
py
Runtime Error
2208
82816
1098
class Combination: def __init__(self, n, mod): self.n = n self.mod = mod self.fac = [1 for i in range(self.n + 1)] self.finv = [1 for i in range(self.n + 1)] for i in range(2, self.n+1): self.fac[i] = (self.fac[i - 1] * i) % self.mod self.finv[i] = (se...
s848248834
p04013
u350093546
1599327066
Python
PyPy3 (7.3.0)
py
Runtime Error
152
119960
363
n,a=map(int,input().split()) lst=list(map(int,input().split())) z=len(lst) dp=[[[0]*2501 for i in range(51)] for j in range(z+1)] dp[0][0][0]=1 for i in range(z): x=lst[i] for j in range(i+1): for k in range((i+1)*50): dp[i+1][j][k]+=dp[i][j][k] dp[i+1][j+1][k+x]+=dp[i][j][k] ans=0 for i in rang...
s691407182
p04013
u161134623
1599029949
Python
Python (3.8.2)
py
Runtime Error
25
9156
561
def function(b, n): if n < b: return n else: return function(b, n//b) + n % b from math import sqrt def divs(n): d=[] for x in range(1,int(sqrt(n))+1): if n%x==0: d.extend([x,n//x]) d=list(set(d)) d.sort() return d def main(): n = int(input()) s = int(input()) i...
s414464503
p04013
u787059958
1598625113
Python
Python (3.8.2)
py
Runtime Error
1942
71596
574
N, A = map(int, input().split()) X = [0] + list(map(int, input().split())) max_X = max(X) dp = [[[0 for k in range((N + 1) * max_X)] for j in range(N + 1)] for i in range(N + 1)] for i in range(N + 1): dp[i][0][0] = 1 for j in range(1, N + 1): for k in range(1, j + 1): for s in range((N + 1) * ...
s684639795
p04013
u787059958
1598624807
Python
Python (3.8.2)
py
Runtime Error
1953
71604
560
N, A = map(int, input().split()) X = [0] + list(map(int, input().split())) dp = [[[0 for k in range((N + 1) * max(X))] for j in range(N + 1)] for i in range(N + 1)] for i in range(N + 1): dp[i][0][0] = 1 for j in range(1, N + 1): for k in range(1, j + 1): for s in range((N + 1) * max(X)): ...
s547682933
p04013
u191874006
1598024434
Python
PyPy3 (7.3.0)
py
Runtime Error
102
79760
950
#!/usr/bin/env python3 import sys import math from bisect import bisect_right as br from bisect import bisect_left as bl sys.setrecursionlimit(2147483647) from heapq import heappush, heappop,heappushpop from collections import defaultdict from itertools import accumulate from collections import Counter from collection...
s104264882
p04013
u489959379
1597463106
Python
PyPy3 (7.3.0)
py
Runtime Error
188
118220
666
import sys sys.setrecursionlimit(10 ** 7) f_inf = float('inf') mod = 10 ** 9 + 7 def resolve(): n, a = map(int, input().split()) X = list(map(int, input().split())) MAX = sum(X) + 1 dp = [[[0] * MAX for _ in range(n + 1)] for _ in range(n + 1)] dp[0][0][0] = 1 for i in range(1, n + 1): ...
s385643419
p04013
u188745744
1596085813
Python
Python (3.8.2)
py
Runtime Error
2207
60904
504
N,A= list(map(int,input().split())) l=list(map(int,input().split())) max_l=max(l) DP=[[[0]*(max_l*N+1) for _ in range(N+1)] for j in range(N+1)] DP[0][0][0]=1 for i in range(0,N+1):#カード全体の枚数 for j in range(0,N+1): for k in range(0,N*max_l+1): if i >= 1 and k<l[i-1]: DP[i][j][k]=DP[i-1][j][...
s555936601
p04013
u311379832
1595994453
Python
Python (3.8.2)
py
Runtime Error
1023
71404
477
N, A = map(int, input().split()) x = list(map(int, input().split())) maxX = max(x) dp = [[[0 for _ in range(N * maxX + 1)] for _ in range(N + 1)] for _ in range(N + 1)] dp[0][0][0] = 1 for i in range(N): for j in range(N + 1): for k in range(N * A + 1): if dp[i][j][k] == 0: continue ...
s236517936
p04013
u551857719
1595868597
Python
Python (3.8.2)
py
Runtime Error
25
9376
1687
#!/usr/bin/python # -*- coding: UTF-8 -*- from collections import defaultdict from operator import mul from functools import reduce def combinations_count(n, r): r = min(r, n - r) numer = reduce(mul, range(n, n - r, -1), 1) denom = reduce(mul, range(1, r + 1), 1) return numer // denom def subset_su...
s510981029
p04013
u758815106
1595718126
Python
Python (3.8.2)
py
Runtime Error
1760
69196
515
N, A = map(int, input().split()) x = list(map(int, input().split())) maxint = 50 * max(x) dp = [[[0] * (maxint + 1) for _ in range(N + 1)] for _ in range(N + 1)] dp[0][0][0] = 1 for xi, xe in enumerate(x, 1): for j in range(xi+1): for k in range(maxint + 1): dp[xi][j][k] = dp[xi - 1][j][k] ...
s805199471
p04013
u968166680
1595070787
Python
PyPy3 (7.3.0)
py
Runtime Error
89
75160
591
import sys read = sys.stdin.read readline = sys.stdin.readline readlines = sys.stdin.readlines sys.setrecursionlimit(10 ** 9) INF = 1 << 60 MOD = 1000000007 def main(): N, A, *X = map(int, read().split()) M = sum(X) dp = [[0] * (M + 1) for j in range(N + 1)] dp[0][0] = 1 for i in range(N): ...
s503799018
p04013
u968166680
1595070690
Python
PyPy3 (7.3.0)
py
Runtime Error
377
80420
582
import sys read = sys.stdin.read readline = sys.stdin.readline readlines = sys.stdin.readlines sys.setrecursionlimit(10 ** 9) INF = 1 << 60 MOD = 1000000007 def main(): N, A, *X = map(int, read().split()) M = sum(X) dp = [[0] * (M + 1) for j in range(N + 1)] dp[0][0] = 1 for i in range(N): ...
s092859440
p04013
u968166680
1595070346
Python
PyPy3 (7.3.0)
py
Runtime Error
373
75540
582
import sys read = sys.stdin.read readline = sys.stdin.readline readlines = sys.stdin.readlines sys.setrecursionlimit(10 ** 9) INF = 1 << 60 MOD = 1000000007 def main(): N, A, *X = map(int, read().split()) M = sum(X) dp = [[0] * (M + 1) for j in range(N + 1)] dp[0][0] = 1 for i in range(N): ...
s039290245
p04013
u968166680
1595070158
Python
PyPy3 (7.3.0)
py
Runtime Error
93
75352
577
import sys read = sys.stdin.read readline = sys.stdin.readline readlines = sys.stdin.readlines sys.setrecursionlimit(10 ** 9) INF = 1 << 60 MOD = 1000000007 def main(): N, A, *X = map(int, read().split()) M = sum(X) dp = [[0] * (M + 1) for j in range(N + 1)] dp[0][0] = 1 for i in range(N): ...
s204940097
p04013
u786020649
1594355047
Python
Python (3.8.2)
py
Runtime Error
2205
9312
958
from collections import deque n,a=map(int,input().split()) cards=list(map(int,input().split())) noz=[x-a for x in cards].count(0) pl=[x-a for x in cards if x-a>0] nl=[a-x for x in cards if x-a<0] sl=[pl,nl][len(nl)<=len(pl)] ll=[pl,nl][len(pl)<len(nl)] sl.sort() ll.sort() sumfunc = lambda n, l: sum([l[x]*((n>>x)&1...
s542843230
p04013
u786020649
1594349814
Python
Python (3.8.2)
py
Runtime Error
2206
24484
758
from collections import deque n,a=map(int,input().split()) cards=list(map(int,input().split())) noz=[x-a for x in cards].count(0) pl=[x-a for x in cards if x-a>0] nl=[a-x for x in cards if x-a<0] sl=[pl,nl][len(nl)<=len(pl)] ll=[pl,nl][len(pl)<len(nl)] sl.sort() ll.sort() sumfunc = lambda n, l: sum([l[x]*((n>>x)&1...
s586679958
p04013
u786020649
1594344638
Python
Python (3.8.2)
py
Runtime Error
2206
18568
643
from collections import deque n,a=map(int,input().split()) cards=list(map(int,input().split())) noz=[x-a for x in cards].count(0) pl=[x-a for x in cards if x-a>0] nl=[a-x for x in cards if x-a<0] sl=[pl,nl][len(nl)<=len(pl)] ll=[pl,nl][len(pl)<len(nl)] sl.sort() ll.sort() sumfunc = lambda n, l: sum([l[x]*((n>>x)&1...
s102200702
p04013
u786020649
1594341091
Python
Python (3.8.2)
py
Runtime Error
2206
18416
645
from collections import deque n,a=map(int,input().split()) cards=list(map(int,input().split())) noz=[x-a for x in cards].count(0) pl=[x-a for x in cards if x-a>0] nl=[a-x for x in cards if x-a<0] sl=[pl,nl][len(nl)<=len(pl)] ll=[pl,nl][len(pl)<len(nl)] sl.sort() ll.sort() nsl=len(sl) nll=len(ll) sumsl=[sum([sl[x]...
s599348131
p04013
u786020649
1594340323
Python
Python (3.8.2)
py
Runtime Error
2206
18588
647
from collections import deque n,a=map(int,input().split()) cards=list(map(int,input().split())) noz=[x-a for x in cards].count(0) pl=[x-a for x in cards if x-a>0] nl=[a-x for x in cards if x-a<0] sl=[pl,nl][len(nl)<=len(pl)] ll=[pl,nl][len(pl)<len(nl)] sl.sort() ll.sort() nsl=len(sl) nll=len(ll) sumsl=[sum([sl[x]...
s067379302
p04013
u786020649
1594338534
Python
Python (3.8.2)
py
Runtime Error
2206
18600
691
from collections import deque n,a=map(int,input().split()) cards=list(map(int,input().split())) def is2power(n): if n==1: return True if n%1==1: return False else: is2power(n//2) noz=[x-a for x in cards].count(0) pl=[x-a for x in cards if x-a>0] nl=[a-x for x in cards if x-a<0] s...
s633721625
p04013
u786020649
1594338183
Python
Python (3.8.2)
py
Runtime Error
2206
18260
711
from collections import deque n,a=map(int,input().split()) cards=list(map(int,input().split())) def is2power(n): if n==1: return True if n%1==1: return False else: is2power(n//2) noz=[x-a for x in cards].count(0) pl=[x-a for x in cards if x-a>0] nl=[a-x for x in cards if x-a<0] s...
s626843540
p04013
u391589398
1594261191
Python
Python (3.8.2)
py
Runtime Error
981
69196
668
n, a = map(int, input().split()) X = tuple(map(int, input().split())) dp = [[[0] * (n*max(X)+1) for _ in range(n+1)] for _ in range(n+1)] dp[0][0][0] = 1 for i in range(n): # i枚目までで for j in range(n): # j枚のカードを選んで for s in range(n*max(X)+1): # 合計がsになるパターン if dp[i][j][s] =...
s093729951
p04013
u793430793
1593294870
Python
Python (3.8.2)
py
Runtime Error
2208
62408
457
#ABC044C #重要 N,A=map(int,input().split()) a=list(map(int,input().split())) dp=[] dp=[[[0 for k in range(N*A)] for j in range(A+1)]for i in range(N+1)] dp[0][0][0]=1 for i in range(len(a)): for j in range(len(a)): for k in range(N*A): if k>=a[i]: dp[i+1][j+1][k]+=dp[i][j][k...
s476986325
p04013
u793430793
1593294606
Python
Python (3.8.2)
py
Runtime Error
1717
306476
518
#ABC044C #重要 N,A=map(int,input().split()) a=list(map(int,input().split())) dp=[] dp=[[[0 for i in range(111)] for j in range(111)]for k in range(N*A)] dp[0][0][0]=1 for i in range(N): for j in range(len(a)): for k in range(N*A): if k>=a[i]: #i+1番目の数字a[i]を足せるかも dp[i+1][j+1][...
s078700779
p04013
u249372595
1592774868
Python
Python (3.8.2)
py
Runtime Error
430
89616
482
N,A=list(map(int,input().split())) x = list(map(int,input().split())) dp=[[[0 for _ in range(55)] for _ in range(55)] for _ in range(2555)] dp[0][0][0]=1 for j in range(N):#x1~xjのカードから for k in range(N):#k枚選び for s in range(A*N):#xの合計をsになるようにしたい if dp[j][k][s] == 0: continue dp[j+1][k][s] += d...
s158909362
p04013
u249372595
1592774583
Python
Python (3.8.2)
py
Runtime Error
432
89668
460
N,A=list(map(int,input().split())) x = list(map(int,input().split())) dp=[[[0 for _ in range(55)] for _ in range(55)] for _ in range(2555)] dp[0][0][0]=1 for j in range(N):#x1~xjのカードから for k in range(N):#k枚選び for s in range(A*N):#xの合計をsになるようにしたい dp[j+1][k][s] += dp[j][k][s] if s >= x[j]: dp[j+...
s060642815
p04013
u102367647
1592400422
Python
Python (3.4.3)
py
Runtime Error
307
22428
1645
import sys import numpy as np import random from decimal import Decimal import itertools import re import bisect from collections import deque, Counter from functools import lru_cache sys.setrecursionlimit(10**9) INF = 10**13 def LI(): return list(map(int, sys.stdin.buffer.readline().split())) def I(): return int(sys....
s920431845
p04013
u811436126
1591419884
Python
Python (3.4.3)
py
Runtime Error
2062
69524
385
n, a = map(int, input().split()) x = list(map(int, input().split())) dp = [[[0] * 3000 for _ in range(50)] for _ in range(50)] dp[0][0][0] = 1 for i in range(n): for j in range(n): for k in range(n * a): dp[i + 1][j][k] += dp[i][j][k] dp[i + 1][j + 1][k + x[i]] += dp[i][j][k] ans ...
s565876696
p04013
u987170100
1591408279
Python
Python (3.4.3)
py
Runtime Error
19
3064
273
N, A = map(int, input().split()) lst = [int(x) - A for x in input().split()] dp = [[0] * (2 * N + 1) for _ in range(N + 1)] dp[0][1 * N] = 1 for i in range(N): for j in range(1, 2 * N + 1 - 1): dp[i + 1][j] = dp[i][j] + dp[i][j - lst[i]] print(dp[N][1 * N] - 1)
s456838979
p04013
u987170100
1591408255
Python
Python (3.4.3)
py
Runtime Error
21
3064
284
N, A = map(int, input().split()) lst = [int(x) - A for x in input().split()] dp = [[0] * (2 * N + 1) for _ in range(N + 1)] dp[0][1 * N] = 1 for i in range(N): for j in range(1, 2 * N + 1 - 1): dp[i + 1][j] = dp[i][j] + dp[i][j - lst[i]] print(dp[N][1 * N] - 1) print(dp)
s967561733
p04013
u086503932
1591059296
Python
Python (3.4.3)
py
Runtime Error
2107
57460
656
#!/usr/bin/env python3 def main(): N, A = map(int, input().split()) x = list(map(int, input().split())) X = max(x) dp = [[[0]*(N*X +1) for _ in range(N+1)] for _ in range(N+1)] dp[0][0][0] = 1 for j in range(1,N+1): for k in range(N+1): for s in range(N*X+1): ...
s394042000
p04013
u225388820
1590477166
Python
PyPy3 (2.4.0)
py
Runtime Error
402
93404
508
n,a=map(int,input().split()) x=list(map(int,input().split())) # dp[j][k][s]=(x1,...,xjからk枚選んでx[i]の合計をsにするような選び方の総数) dp=[[[0]*2500 for i in range(51)] for j in range(51)] dp[0][0][0]=1 for i in range(n): for j in range(n+1): for k in range(2500): if k<x[i]: dp[i+1][j][k]=dp[i][j][...
s492688158
p04013
u054556734
1589946327
Python
Python (3.4.3)
py
Runtime Error
279
20496
964
import numpy as np import scipy.sparse as sps import scipy.misc as spm import collections as col import functools as func import itertools as ite import fractions as frac import math as ma import copy as cp import sys def sinput(): return sys.stdin.readline() def iinput(): return int(sinput()) def imap(): return map(in...
s322854469
p04013
u054556734
1589916808
Python
Python (3.4.3)
py
Runtime Error
753
15988
1003
import numpy as np import scipy.sparse as sps import scipy.misc as spm import collections as col import functools as func import itertools as ite import fractions as frac import math as ma import copy as cp import sys def sinput(): return sys.stdin.readline() def iinput(): return int(sinput()) def imap(): return map(in...
s298347476
p04013
u054556734
1589914801
Python
Python (3.4.3)
py
Runtime Error
743
15988
961
import numpy as np import scipy.sparse as sps import scipy.misc as spm import collections as col import functools as func import itertools as ite import fractions as frac import math as ma import copy as cp import sys def sinput(): return sys.stdin.readline() def iinput(): return int(sinput()) def imap(): return map(in...
s217342301
p04013
u054556734
1589914768
Python
Python (3.4.3)
py
Runtime Error
739
20668
962
import numpy as np import scipy.sparse as sps import scipy.misc as spm import collections as col import functools as func import itertools as ite import fractions as frac import math as ma import copy as cp import sys def sinput(): return sys.stdin.readline() def iinput(): return int(sinput()) def imap(): return map(in...
s819566144
p04013
u054556734
1589914736
Python
Python (3.4.3)
py
Runtime Error
935
19256
981
import numpy as np import scipy.sparse as sps import scipy.misc as spm import collections as col import functools as func import itertools as ite import fractions as frac import math as ma import copy as cp import sys def sinput(): return sys.stdin.readline() def iinput(): return int(sinput()) def imap(): return map(in...
s408105487
p04013
u054556734
1589914692
Python
Python (3.4.3)
py
Runtime Error
941
18456
1005
import numpy as np import scipy.sparse as sps import scipy.misc as spm import collections as col import functools as func import itertools as ite import fractions as frac import math as ma import copy as cp import sys def sinput(): return sys.stdin.readline() def iinput(): return int(sinput()) def imap(): return map(in...
s937711662
p04013
u054556734
1589891447
Python
Python (3.4.3)
py
Runtime Error
307
19400
821
import numpy as np import scipy.sparse as sps import scipy.misc as spm import collections as col import functools as func import itertools as ite import fractions as frac import math as ma import copy as cp import sys def sinput(): return sys.stdin.readline() def iinput(): return int(sinput()) def imap(): return map(in...
s843456675
p04013
u835534360
1589746941
Python
Python (3.4.3)
py
Runtime Error
2109
63560
440
import numpy as np n,avea=tuple(map(lambda x:int(x),input().split())) x=np.array(list(map(lambda x:int(x),input().split()))) dp=np.zeros((n+1,n+1,max(x)*n+1), dtype=int) dp[:,0,0]=1 c=0 for i in range(n): for j in range(i): for k in range(max(x)*(i+1)): if k-x[i]>=0: dp[i+1,j,k]=...
s320316782
p04013
u867848444
1589686695
Python
PyPy3 (2.4.0)
py
Runtime Error
319
101980
803
n, a = map(int,input().split()) x = list(map(int,input().split())) dp = [[[0] * n for i in range(n * a + 1)] for i in range(n)] for i in range(n): for j in range(n * a + 1): for k in range(n): if i == 0 and x[0] < n * a + 1: dp[0][x[0]][0] = 1 break e...
s519067629
p04013
u867848444
1589686628
Python
PyPy3 (2.4.0)
py
Runtime Error
311
101852
782
n, a = map(int,input().split()) x = list(map(int,input().split())) dp = [[[0] * n for i in range(n * a + 1)] for i in range(n)] for i in range(n): for j in range(n * a + 1): for k in range(n): if i == 0: dp[0][x[0]][0] = 1 break else: ...
s676228810
p04013
u867848444
1589685250
Python
PyPy3 (2.4.0)
py
Runtime Error
892
124252
800
n, a = map(int,input().split()) x = list(map(int,input().split())) dp = [[[0] * n for i in range(n * a + 1)] for i in range(n)] #print(*dp, sep='\n') for i in range(n): for j in range(n * a + 1): for k in range(n): if i == 0: dp[0][x[0]][0] = 1 else: ...
s952465052
p04013
u480300350
1589659906
Python
PyPy3 (2.4.0)
py
Runtime Error
2112
138556
4716
#!/usr/bin/env python3 import sys # import math # from string import ascii_lowercase, ascii_uppercase, ascii_letters, digits, hexdigits # import re # re.compile(pattern) => ptn obj; p.search(s), p.match(s), p.finditer(s) => match obj; p.sub(after, s) # from operator import itemgetter...
s490142856
p04013
u102126195
1588878637
Python
PyPy3 (2.4.0)
py
Runtime Error
491
98524
647
n, a = map(int, input().split()) x = list(map(int, input().split())) x = [0] + x dp = [[[0 for _ in range(max(x)*n+1)] for _ in range(n+1)] for _ in range(n+1)] x.sort() for j in range(n+1): for k in range(n+1): for s in range(max(x)*n+1): if j == 0 and k == 0 and s == 0: dp[j][k...
s875611874
p04013
u097317219
1588877622
Python
PyPy3 (2.4.0)
py
Runtime Error
405
92636
497
n,a = map(int,input().split()) x = list(map(int,input().split())) max_x = max(x) dp = [[[0]*(n*max_x+1) for i in range(n+1)] for j in range(n+1)] dp[0][0][0] = 1 for i in range(n+1): for j in range(n+1): for k in range(n*max_x+1): if i>=1 and k < x[i-1]: dp[i][j][k] = dp[i-1][j][k] elif i>=1 a...
s195172899
p04013
u934868410
1588708527
Python
Python (3.4.3)
py
Runtime Error
73
4980
218
n,a = map(int,input().split()) x = list(map(int,input().split())) t = [[0]*5001 for _ in range(n+1)] ans = 0 for i in range(1, n+1): for y in x: for z in t[i-1]: t[i][z+y-a] += 1 ans += t[i][0] print(ans)
s760745230
p04013
u934868410
1588708503
Python
Python (3.4.3)
py
Runtime Error
21
4980
215
n,a = map(int,input().split()) x = list(map(int,input().split())) t = [[0]*5001 for _ in range(n+1)] ans = 0 for i in range(1, n+1): for y in x: for z in t[i-1]: t[z+y-a] += 1 ans += t[i][0] print(ans)
s289049759
p04013
u614875193
1588615992
Python
Python (3.4.3)
py
Runtime Error
17
2940
1109
#include <bits/stdc++.h> using namespace std; const long long INF = 1LL << 60; int MOD = 1000000007; double PI = 3.14159265358979323846; template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; } template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0...
s734216641
p04013
u106797249
1588520069
Python
Python (3.4.3)
py
Runtime Error
17
2940
360
def resolve(): N, A = list(map(int, input().split())) X = sorted(list(map(int, input().split()))) cnt = 0 for bits in range(1, 1<<N): flags = list(bin(bits)[2:].zfill(N)) _X = [x for i, x in enumerate(X) if flags[i]=="1"] cnt += 1 if sum(_X)/len(_X) == A print(cnt) if...
s917901271
p04013
u308918401
1588449635
Python
Python (3.4.3)
py
Runtime Error
21
3064
476
n,a=map(int,input().split()) x=list(map(int,input().split())) t=[[[0]*(n*a+1)]*(n+1)]*(n+1) ans=0 for j in range(n+1): for k in range(n+1): if k>j: break for s in range((n+1)*a+1): if s==0 and k==0 and j==0: t[j][k][s]=1 elif j>=1 and x[j-1]>s: t[j][k][s]=t[j-1][k][s] e...
s458332743
p04013
u308918401
1588447031
Python
Python (3.4.3)
py
Runtime Error
72
12276
474
n,a=map(int,input().split()) x=list(map(int,input().split())) t=[[[0 for s in range(k*a+1)]for k in range(j+1)]for j in range(n+1)] for j in range(n+1): for k in range(j+1): for s in range(k*a+1): if s==0 and k==0 and j==0: t[j][k][s]=0 elif j>=1 and x[j+1]<s: t[j][k][s]=t[j-1][k][s] ...
s266379086
p04013
u915647268
1587812210
Python
Python (3.4.3)
py
Runtime Error
216
5108
378
n, a = [int(i) for i in input().split()] x = [int(i)-a for i in input().split()] max = max(x) dp = [[0 for _ in range(2*n*max+1)] for _ in range(n+1)] dp[0][n*max] = 1 for i in range(1, n+1): for j in range(2*n*max+1): if j - x[i-1] < 0 or j - x[i-1] > 2*n*max: dp[i][j] = dp[i-1][j] else: dp[i][j] = d...
s819337404
p04013
u915647268
1587811808
Python
Python (3.4.3)
py
Runtime Error
194
5108
566
n, a = [int(i) for i in input().split()] x = [int(i)-a for i in input().split()] max = max(x) dp = [[0 for _ in range(2*n*max+1)] for _ in range(n+1)] dp[0][n*max] = 1 for i in range(1, n+1): for j in range(2*n*max+1): if j - x[i-1] < 0 or j - x[i-1] > 2*n*max: dp[i][j] = dp[i-1][j] else: dp[i][j] = d...
s640040742
p04013
u915647268
1587810763
Python
Python (3.4.3)
py
Runtime Error
195
5108
577
n, a = [int(i) for i in input().split()] x = [int(i)-a for i in input().split()] max = max(x) dp = [[0 for _ in range(2*n*max)] for _ in range(n)] dp[0][n*max+x[0]] = 1 dp[0][n*max] = 1 for i in range(1, n): for j in range(2*n*max): if j - x[i] < 0 or j - x[i] >= 2*n*max: dp[i][j] = dp[i-1][j] else: d...
s445335537
p04013
u622045059
1587320520
Python
Python (3.4.3)
py
Runtime Error
2107
58920
2583
# python3.4.2用 import math import fractions import bisect import collections import itertools import heapq import string import sys import copy from decimal import * from collections import deque sys.setrecursionlimit(10**7) MOD = 10**9+7 INF = float('inf') #無限大 def gcd(a,b):return fractions.gcd(a,b) #最大公約数 def lcm(a,b...
s597504873
p04013
u423665486
1587252362
Python
Python (3.4.3)
py
Runtime Error
18
3064
362
def resolve(): modu = 1000000007 n, m = map(int, input().split()) a = [False]*n for _ in range(m): a[int(input())] = True dp = [0]*(n+1) dp[0], dp[1] = 1, 1 for i in range(2, n+1): if a[i]: continue multi = [] if not a[i-1]: multi.append(dp[i-1]) if not a[i-2]: multi.append(dp[i-2]) dp[i] = ...
s433071657
p04013
u114233208
1586745315
Python
Python (3.4.3)
py
Runtime Error
2104
4188
967
import math def nCr(n,r): f = math.factorial return f(n) / f(r) / f(n-r) N, A = list(map(int, input().split())) X = sorted(list(map(int, input().split()))) numbers = [0 for i in range((N*A)+1)] for each in X: numbers[each] += 1 g = numbers.copy() def ways(a, k, arr, g): global numbers f = g.copy(...
s048703228
p04013
u254871849
1586715129
Python
Python (3.4.3)
py
Runtime Error
291
21484
431
import sys import numpy as np n, a, *x = map(int, sys.stdin.read().split()) def main(): m = max(n, a) * max(x) dp = np.zeros((n + 1, m + 1), dtype=np.int64) dp[0, 0] = 1 for i in range(n): ndp = np.copy(dp) for j in range(1, n + 1): ndp[j][x[i]:] += dp[j-1][:m-x[i]+1] ...
s332872127
p04013
u426572476
1586672212
Python
Python (3.4.3)
py
Runtime Error
17
3192
3409
import sys import heapq import re from itertools import permutations from bisect import bisect_left, bisect_right from collections import Counter, deque from fractions import gcd from math import factorial, sqrt from functools import lru_cache, reduce INF = 1 << 60 mod = 1000000007 sys.setrecursionlimit(10 ** 7) # Uni...
s214543673
p04013
u411203878
1586630548
Python
PyPy3 (2.4.0)
py
Runtime Error
172
38896
671
import math import collections def comb(n, k): return math.factorial(n) // math.factorial(k) // math.factorial(n - k) n,a = map(int,input().split()) t = list(map(int,input().split())) memo = [0]*51 for i in t: memo[i] += 1 typecount = [] ans = 0 for i in t: if i != a: typecount.append(i) fo...
s361954215
p04013
u411203878
1586630307
Python
Python (3.4.3)
py
Runtime Error
21
3316
685
import math def combination(n, k): return math.factorial(n) // math.factorial(k) // math.factorial(n - k) import collections n,a = map(int,input().split()) t = list(map(int,input().split())) memo = [0]*51 for i in t: memo[i] += 1 typecount = [] ans = 0 for i in t: if i != a: typecount.append...