s_id
string
p_id
string
u_id
string
date
string
language
string
original_language
string
filename_ext
string
status
string
cpu_time
string
memory
string
code_size
string
code
string
error
string
stdout
string
s202958068
p04013
u950708010
1556204546
Python
Python (3.4.3)
py
Runtime Error
2107
57460
564
def solve(): n,a = (int(i) for i in input().split()) x = list(int(i) for i in input().split()) tp = max(x) dp = [[[0 for i in range(n*tp +1)] for j in range(n+1)] for k in range(n+1)] query = a*n dp[0][0][0] = 1 for i in range(1,n+1): for j in range(n+1): for k in range(n*tp +1): #選ばない ...
Traceback (most recent call last): File "/tmp/tmpfq71dmct/tmpio6km_ji.py", line 27, in <module> solve() File "/tmp/tmpfq71dmct/tmpio6km_ji.py", line 2, in solve n,a = (int(i) for i in input().split()) ^^^^^^^ EOFError: EOF when reading a line
s185093054
p04013
u619458041
1556069113
Python
Python (3.4.3)
py
Runtime Error
18
2940
160
import sys def main(): input = sys.stdin.readline n = int(input()) s = int(input()) return ans if __name__ == '__main__': print(main())
Traceback (most recent call last): File "/tmp/tmpxh5b9fe1/tmp877oxi9t.py", line 12, in <module> print(main()) ^^^^^^ File "/tmp/tmpxh5b9fe1/tmp877oxi9t.py", line 5, in main n = int(input()) ^^^^^^^^^^^^ ValueError: invalid literal for int() with base 10: ''
s882406396
p04013
u227082700
1555470657
Python
Python (3.4.3)
py
Runtime Error
2107
54004
395
n,a=map(int,input().split()) x=list(map(int,input().split())) X=sum(x) dp=[[[0]*(X+1)for j in range(n+1)]for i in range(n+1)] dp[0][0][0]=1 for i in range(1,n+1): xi=x[i-1] for j in range(n+1): for h in range(X+1): if h<xi:dp[i][j][h]=dp[i-1][j][h] if xi<=h and j>=1:dp[i][j][h]=dp[i-1][j][h]+d...
Traceback (most recent call last): File "/tmp/tmp94_qa0u4/tmprjcfkon3.py", line 1, in <module> n,a=map(int,input().split()) ^^^^^^^ EOFError: EOF when reading a line
s252634381
p04013
u268516119
1555008362
Python
Python (3.4.3)
py
Runtime Error
757
55028
664
#x枚目まででy枚選んで合計がzになる場合の数dp[x][y][z] N,A=map(int,input().split()) x=[int(i) for i in input().split()] dp=[[[0]*(A*N+1) for i in range(N+1)]for k in range(N+2)] ans=0 dp[0][0][0]=1 for made,i in enumerate(dp): if made>N:break for maisu,j in enumerate(i): for wa,k in enumerate(j): if k and made<...
Traceback (most recent call last): File "/tmp/tmp0k0n8pr_/tmpouti8hby.py", line 2, in <module> N,A=map(int,input().split()) ^^^^^^^ EOFError: EOF when reading a line
s809370876
p04013
u268516119
1555007625
Python
Python (3.4.3)
py
Runtime Error
754
56052
587
#x枚目まででy枚選んで合計がzになる場合の数dp[x][y][z] N,A=map(int,input().split()) x=[int(i) for i in input().split()] dp=[[[0]*(A*50) for i in range(N+2)]for k in range(N+2)] ans=0 dp[0][0][0]=1 for made,i in enumerate(dp): if made>N:break for maisu,j in enumerate(i): for wa,k in enumerate(j): if k:#made枚目までに...
Traceback (most recent call last): File "/tmp/tmpb0ei3pnu/tmp9ambiyxs.py", line 2, in <module> N,A=map(int,input().split()) ^^^^^^^ EOFError: EOF when reading a line
s039556758
p04013
u360090862
1554572838
Python
Python (3.4.3)
py
Runtime Error
2109
61672
497
import numpy as np N,A=map(lambda x:int(x),input().split()) x=[int(i) for i in input().split()] dp=np.zeros((N+1,N+1,sum(x)+1)) def solve(j,k,s): if k==0 and j==0 and s==0: return 1 elif j>=1 and s<x[j-1] : dp[j,k,s]=solve(j-1,k,s) return dp[j,k,s] elif j>=1 and k>=1 and s>=x[j-1]: dp[j,k,s]=sol...
Traceback (most recent call last): File "/tmp/tmp7kv81d0m/tmpm31rxc_y.py", line 2, in <module> N,A=map(lambda x:int(x),input().split()) ^^^^^^^ EOFError: EOF when reading a line
s996634679
p04013
u013408661
1554504330
Python
Python (3.4.3)
py
Runtime Error
21
3188
292
n,a=map(int,input().split()) x=list(map(int,input())) stack=[0]*5001 stack[2500-a]=1 ans=0 for i in x: i-=a for i in x: ans+=stack[2500-i+a] stack2=[i for i in stack] for j in range(5001): if 0<=j+i<=5000: stack2[j+i]+=stack[j] stack=[i for i in stack2] print(stack[2500])
Traceback (most recent call last): File "/tmp/tmpykh0_dmh/tmp4yj3en29.py", line 1, in <module> n,a=map(int,input().split()) ^^^^^^^ EOFError: EOF when reading a line
s825980711
p04013
u279493135
1554412627
Python
Python (3.4.3)
py
Runtime Error
245
5360
1068
from sys import stdin input = stdin.readline N, A = [int(x) for x in input().rstrip().split()] x = [int(x) for x in input().rstrip().split()] X = max(max(x), A) # dp = [[[0]*(N*X+1) for _ in range(N+1)] for _ in range(N+1)] # for j in range(N+1): # for k in range(N+1): # for s in range(N*X+1): # if j == 0 and k...
Traceback (most recent call last): File "/tmp/tmpmb64bf_g/tmpvo1shddj.py", line 4, in <module> N, A = [int(x) for x in input().rstrip().split()] ^^^^ ValueError: not enough values to unpack (expected 2, got 0)
s605302876
p04013
u315485238
1553974107
Python
Python (3.4.3)
py
Runtime Error
180
14328
361
import numpy as np N, A = list(map(int, input().split())) X = list(map(int, input().split())) dp = [np.array([[0]*(N*A+1) for _ in range(N+1)])] #dp[0]: [0, 0]~[N, N*A] for x in X: new_dp = dp[-1] new_dp[1:, x:] += dp[-1][0:N, 0:N*A+1-x] new_dp[1, x] += 1 dp.append(new_dp) #print(dp[-1]) print(sum([dp[...
Traceback (most recent call last): File "/tmp/tmp32_0scus/tmpg0jb5ddx.py", line 3, in <module> N, A = list(map(int, input().split())) ^^^^^^^ EOFError: EOF when reading a line
s413703386
p04013
u315485238
1553974044
Python
Python (3.4.3)
py
Runtime Error
181
14336
360
import numpy as np N, A = list(map(int, input().split())) X = list(map(int, input().split())) dp = [np.array([[0]*(N*A+1) for _ in range(N+1)])] #dp[0]: [0, 0]~[N, N*A] for x in X: new_dp = dp[-1] new_dp[1:, x:] += dp[-1][0:N, 0:N*A+1-x] new_dp[1, x] += 1 dp.append(new_dp) print(dp[-1]) print(sum([dp[-...
Traceback (most recent call last): File "/tmp/tmp25t39657/tmpx1o2ezno.py", line 3, in <module> N, A = list(map(int, input().split())) ^^^^^^^ EOFError: EOF when reading a line
s591536146
p04013
u315485238
1553973860
Python
Python (3.4.3)
py
Runtime Error
179
14328
361
import numpy as np N, A = list(map(int, input().split())) X = list(map(int, input().split())) dp = [np.array([[0]*(N*A+1) for _ in range(N+1)])] #dp[0]: [0, 0]~[N, N*A] for x in X: new_dp = dp[-1] new_dp[1:, x:] += dp[-1][0:N, 0:N*A+1-x] new_dp[1, x] += 1 dp.append(new_dp) #print(dp[-1]) print(sum([dp[...
Traceback (most recent call last): File "/tmp/tmph7c9j19g/tmpbdxu2li2.py", line 3, in <module> N, A = list(map(int, input().split())) ^^^^^^^ EOFError: EOF when reading a line
s797950516
p04013
u315485238
1553973078
Python
Python (3.4.3)
py
Runtime Error
1067
65468
396
import numpy as np from scipy.ndimage.interpolation import shift N, A = list(map(int, input().split())) X = list(map(int, input().split())) dp = [np.array([[0]*(N*A+1) for _ in range(N+1)])] #dp[0]: [0][0]~[N][N*A] for x in X: new_dp = dp[-1] + shift(dp[-1], [1, x], cval=0) new_dp[1][x] += 1 dp.append(new_d...
/tmp/tmp8b4quti9/tmp97ij6f94.py:2: DeprecationWarning: Please use `shift` from the `scipy.ndimage` namespace, the `scipy.ndimage.interpolation` namespace is deprecated. from scipy.ndimage.interpolation import shift Traceback (most recent call last): File "/tmp/tmp8b4quti9/tmp97ij6f94.py", line 4, in <module> N,...
s614258534
p04013
u315485238
1553972773
Python
Python (3.4.3)
py
Runtime Error
1040
64504
394
import numpy as np from scipy.ndimage.interpolation import shift N, A = list(map(int, input().split())) X = list(map(int, input().split())) dp = [np.array([[0]*(N*A+1) for _ in range(N)])] for i in range(N): new_dp = dp[-1]+ shift(dp[-1], [1, X[i]], cval=0) new_dp[0][X[i]]=new_dp[0][X[i]]+1 dp.append(new_dp...
/tmp/tmpl0s70a3t/tmpiulp1vi2.py:2: DeprecationWarning: Please use `shift` from the `scipy.ndimage` namespace, the `scipy.ndimage.interpolation` namespace is deprecated. from scipy.ndimage.interpolation import shift Traceback (most recent call last): File "/tmp/tmpl0s70a3t/tmpiulp1vi2.py", line 4, in <module> N,...
s161630694
p04013
u543954314
1553289471
Python
Python (3.4.3)
py
Runtime Error
21
3828
260
n,a = map(int,input().split()) dp = [[0]*2000 for _ in range(n+1)] dp[0][1000] = 1 x = list(map(int,input().split())) for i in range(n): x[i] -= a for i in range(1,n+1): for j in range(2001): dp[i][j] = dp[i-1][j] + dp[i-1][j-x[i-1]] print(dp[n][1000])
Traceback (most recent call last): File "/tmp/tmp649fp7bu/tmpyozpa8v0.py", line 1, in <module> n,a = map(int,input().split()) ^^^^^^^ EOFError: EOF when reading a line
s256183479
p04013
u185034753
1552795180
Python
Python (3.4.3)
py
Runtime Error
17
2940
670
#include<iostream> #include<vector> using namespace std; unsigned long long dp[51][51][2501]; int main(int argc, char const *argv[]) { int N, A; cin>>N>>A; vector<int> x(N+1); for(int i=0; i<N; i++) { cin >> x[i+1]; } dp[0][0][0] = 1; for(int j=1; j<=N; j++) { for(int k=...
File "/tmp/tmpw1dbblbp/tmp17waq6pu.py", line 4 using namespace std; ^^^^^^^^^ SyntaxError: invalid syntax
s832871118
p04013
u185034753
1552752694
Python
Python (3.4.3)
py
Runtime Error
2105
30688
817
def zeros(*dim): import copy if len(dim)==0: return 0 else: d = dim[0] a = zeros(*dim[1:]) return [copy.deepcopy(a) for _ in range(d)] def solve(a, A): a = sorted(a) N = len(a) S = sum(a) dp = zeros(N+1, N+1, S+1) a.insert(0, float("inf")) # add dummy ...
Traceback (most recent call last): File "/tmp/tmpkilygnr1/tmpsc94vr8b.py", line 39, in <module> main() File "/tmp/tmpkilygnr1/tmpsc94vr8b.py", line 33, in main N, A = map(int,input().split()) ^^^^^^^ EOFError: EOF when reading a line
s420912209
p04013
u030626972
1551591788
Python
Python (3.4.3)
py
Runtime Error
2107
56308
781
def main(): #入力 n, a = map(int,input().split()) x = [0] + list(map(int,input().split())) sum_max = (n)*(max(x))+1 #dp[i][j][k]:x1-xiからj枚選んで、合計をkにする選び方の数 dp = [[[0]*sum_max for _ in range(n+1)] for _ in range(n+1)] dp[0][0][0] = 1 for i in range(n+1): for j in range(n+1): ...
Traceback (most recent call last): File "/tmp/tmpfd_1ea49/tmppw_vstd4.py", line 31, in <module> main() File "/tmp/tmpfd_1ea49/tmppw_vstd4.py", line 3, in main n, a = map(int,input().split()) ^^^^^^^ EOFError: EOF when reading a line
s590085780
p04013
u887207211
1550980435
Python
Python (3.4.3)
py
Runtime Error
18
3064
302
N, A = map(int,input().split()) X = list(map(int,input().split())) X = [int(x) - A for x in input().split()] dp = [[0 for _ in range(100*N+1)] for _ in range(N+1)] dp[0][50*N] = 1 for i in range(N): for j in range(50, 100*N+1-50): dp[i+1][j] = dp[i][j] + dp[i][j - X[i]] print(dp[N][50*N] - 1)
Traceback (most recent call last): File "/tmp/tmplf1io9hg/tmprge2pldr.py", line 1, in <module> N, A = map(int,input().split()) ^^^^^^^ EOFError: EOF when reading a line
s614999193
p04013
u762955009
1550293688
Python
Python (3.4.3)
py
Runtime Error
131
5748
389
N, A = map(int, input().split()) x = list(map(int, input().split())) y = list(map(lambda n:n-A, x)) X = max(x) dp = [[0 for i in range(2*X*N + 1)] for j in range(N + 1)] for i in range(1, N + 1): dp[i][y[i - 1] + N*X] += 1 for j in range(len(dp[0])): dp[i][j] += dp[i - 1][j] if dp[i - 1][j] > ...
Traceback (most recent call last): File "/tmp/tmp26bmiajt/tmpgz0fjuwq.py", line 1, in <module> N, A = map(int, input().split()) ^^^^^^^ EOFError: EOF when reading a line
s554567361
p04013
u367130284
1549819723
Python
Python (3.4.3)
py
Runtime Error
22
3316
204
import collections as c n,a=map(int,input().split()) X=[int(x)-a for x in input().split()] C=c.Counter([0]) for x in X: itiji=Counter() for i,c in C.items(): itiji[i+x]+=c C+=itiji print(C[0]-1)
Traceback (most recent call last): File "/tmp/tmp540xy43u/tmpjm_gc4v4.py", line 2, in <module> n,a=map(int,input().split()) ^^^^^^^ EOFError: EOF when reading a line
s409891608
p04013
u690536347
1548774168
Python
PyPy3 (2.4.0)
py
Runtime Error
427
92764
510
n,a=map(int,input().split()) *x,=map(int,input().split()) b=max(x) dp=[[[0]*(n*b+1) for i in range(n+1)] for _ in range(n+1)] for i in range(n+1): for j in range(n+1): for k in range(n*b+1): if i==0 and j==0 and k==0: dp[i][j][k]=1 elif i and k<x[i-1]: ...
Traceback (most recent call last): File "/tmp/tmp5ha_b8tx/tmpm4rgu4xd.py", line 1, in <module> n,a=map(int,input().split()) ^^^^^^^ EOFError: EOF when reading a line
s083476123
p04013
u166696759
1548566635
Python
Python (3.4.3)
py
Runtime Error
18
2940
662
#include <bits/stdc++.h> using namespace std; int main(){ int N, A; cin >> N >> A; vector<int> cards(N); int maxX = -1*(1<<30); for(int i=0; i<N; ++i){ cin >> cards[i]; maxX = max(maxX, cards[i]); cards[i] -= A; } const int M = N * maxX; vector<vector<long long> >...
File "/tmp/tmpki0578oo/tmpim_iskvg.py", line 2 using namespace std; ^^^^^^^^^ SyntaxError: invalid syntax
s012863654
p04013
u171366497
1547692162
Python
Python (3.4.3)
py
Runtime Error
85
3976
1225
N,A=map(int,input().split()) x=input().split() for i in range(N): x[i]=int(x[i]) ans=0 y=[0 for i in range(N)] def check(ans,y): ave=0 for i in range(N): ave+=x[i]*y[i] if sum(y)!=0: ave=ave/sum(y) if sum(y)==0: ave=0 if ave==A:ans+=1 return ans def branch(ans,now,pr...
Traceback (most recent call last): File "/tmp/tmpghk_fq2g/tmpd7z3m_yp.py", line 1, in <module> N,A=map(int,input().split()) ^^^^^^^ EOFError: EOF when reading a line
s958671899
p04013
u550943777
1547615958
Python
Python (3.4.3)
py
Runtime Error
2108
54004
615
N,A = map(int,input().split()) x = [0] + list(map(int,input().split())) X = max(x) dp = [[[0]*(N*X+1) for k in range(N+1)] for j in range(N+1)] for j in range(N+1): for k in range(N+1): for s in range(N*X+1): if j == 0 and k == 0 and s == 0 : dp[j][k][s] = 1 elif j >...
Traceback (most recent call last): File "/tmp/tmpd081yeak/tmpir0mikm9.py", line 1, in <module> N,A = map(int,input().split()) ^^^^^^^ EOFError: EOF when reading a line
s503067161
p04013
u052332717
1545869973
Python
Python (3.4.3)
py
Runtime Error
1295
62960
429
n, a = map(int, input().split()) x = list(map(int, input().split())) M = max(x) dp = [[[0]*(n*M+1) for _ in range(n+1)] for _ in range(n+1)] dp[0][0][0] = 1 for j in range(n): for k in range(n+1): for s in range(n*M+1): if dp[j][k][s]: dp[j+1][k][s] += dp[j][k][s] ...
Traceback (most recent call last): File "/tmp/tmpayrorp4r/tmppbua7nzl.py", line 1, in <module> n, a = map(int, input().split()) ^^^^^^^ EOFError: EOF when reading a line
s760675121
p04013
u052332717
1545869919
Python
Python (3.4.3)
py
Runtime Error
1431
62960
429
n, a = map(int, input().split()) x = list(map(int, input().split())) M = max(x) dp = [[[0]*(n*M+1) for _ in range(n+1)] for _ in range(n+1)] dp[0][0][0] = 1 for j in range(n): for k in range(n+1): for s in range(n*M+1): if dp[j][k][s]: dp[j+1][k][s] += dp[j][k][s] ...
Traceback (most recent call last): File "/tmp/tmpzb0jbykw/tmp0e1ntlym.py", line 1, in <module> n, a = map(int, input().split()) ^^^^^^^ EOFError: EOF when reading a line
s878917025
p04013
u052332717
1545865235
Python
Python (3.4.3)
py
Runtime Error
219
5356
801
N, A = map(int, input().split()) X = list(map(lambda x: int(x) - A, input().split())) maxn = max(max(X), A) dp = [[0 for _ in range(2 * N * maxn + 1)] for _ in range(N + 1)] dp[0][N * maxn] = 1 for i in range(N): for k in range(2 * N * maxn + 1): dp[i + 1][k] = dp[i][k] if 0 <= k - X[i] <= 2 * N...
Traceback (most recent call last): File "/tmp/tmp2ro8ehrb/tmp5h362i4k.py", line 1, in <module> N, A = map(int, input().split()) ^^^^^^^ EOFError: EOF when reading a line
s875354580
p04013
u052332717
1545865199
Python
Python (3.4.3)
py
Runtime Error
221
7284
800
N, A = map(int, input().split()) X = list(map(lambda x: int(x) - A, input().split())) maxn = max(max(X), A) dp = [[0 for _ in range(2 * N * maxn + 1)] for _ in range(N + 1)] dp[0][N * maxn] = 1 for i in range(N): for k in range(2 * N * maxn + 1): dp[i + 1][k] = dp[i][k] if 0 <= k - X[i] <= 2 * N...
Traceback (most recent call last): File "/tmp/tmpjavidlf3/tmp4r7qp3n8.py", line 1, in <module> N, A = map(int, input().split()) ^^^^^^^ EOFError: EOF when reading a line
s162041917
p04013
u643840641
1545572017
Python
Python (3.4.3)
py
Runtime Error
2107
56436
425
n, a = map(int, input().split()) x = list(map(int, input().split())) sum = sum(x) dp = [[[0 for s in range(sum+1)] for k in range(n+1)] for i in range(n+1)] dp[0][0][0] = 1 for i in range(1, n+1): for k in range(n+1): for s in range(sum+1): if s >= x[i-1]: dp[i][k][s] = dp[i-1][k][s] + dp[i-1][k-1][s-x[i-1]] ...
Traceback (most recent call last): File "/tmp/tmpgj0fweon/tmph7yeg_kg.py", line 1, in <module> n, a = map(int, input().split()) ^^^^^^^ EOFError: EOF when reading a line
s485028008
p04013
u782098901
1545404381
Python
Python (3.4.3)
py
Runtime Error
2107
58356
513
N, A = map(int, input().split()) # X = list(map(lambda x: int(x) - A, input().split())) X = list(map(int, input().split())) dp = [[[0 for _ in range(max(X) * N + 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): for k in range(max(X) * N + 1): ...
Traceback (most recent call last): File "/tmp/tmpilrwy26s/tmpt4h8sxl2.py", line 1, in <module> N, A = map(int, input().split()) ^^^^^^^ EOFError: EOF when reading a line
s033000812
p04013
u140251125
1543514577
Python
Python (3.4.3)
py
Runtime Error
36
3444
592
import collections # input n, a = map(int, input().split()) X = [int(i) - a for i in input().split()] S = collections.Counter([0, X[0]]) # Xから1枚以上選んで作ることが可能な和:作り方の場合の数 # 1枚も選ばない=0:1通り # X[0]のみ選ぶ=X[0]:1通り for i in X[1:]: # 選べるカードを増やしていく (X[0] ~ X[i] から選ぶ) S_temp = collections.Counter() for s, c in S.items(): ...
Traceback (most recent call last): File "/tmp/tmpe_6tchsu/tmpgzos_mp7.py", line 4, in <module> n, a = map(int, input().split()) ^^^^^^^ EOFError: EOF when reading a line
s774584993
p04013
u297109012
1540699413
Python
Python (3.4.3)
py
Runtime Error
2108
3064
963
import math from itertools import combinations def solve(N, A, Xs): diffs = [x - A for x in Xs] minus = [d for d in diffs if d < 0] minuses = {} plus = [d for d in diffs if d > 0] pluses = {} zero = [d for d in diffs if d == 0] for n in range(1, len(minus) + 1): for ns in combinat...
Traceback (most recent call last): File "/tmp/tmpe2fn3koh/tmp17v2t15s.py", line 38, in <module> N, A = map(int, input().split(" ")) ^^^^^^^ EOFError: EOF when reading a line
s274022112
p04013
u474270503
1538250242
Python
Python (3.4.3)
py
Runtime Error
18
3064
501
N,A=map(int, input().split()) x=[int(x) for x in input().split()] sort(x) W=sum(x) dp=[[[0]*(W+1) for _ in range(N+1)] for _ in range(N+1)] for j in range(N+1): dp[j][0][0]=1 for j in range(1,N+1): xj=x[j-1] for k in range(1, N+1): for s in range(1, W+1): if s<xj: dp[j][k...
Traceback (most recent call last): File "/tmp/tmp9snntd3z/tmpeufu02do.py", line 1, in <module> N,A=map(int, input().split()) ^^^^^^^ EOFError: EOF when reading a line
s587645999
p04013
u474270503
1538248868
Python
Python (3.4.3)
py
Runtime Error
2107
58484
618
N,A=map(int, input().split()) x=list(map(int, input().split())) dp=[] for _ in range(N+1): dp.append([[0 for _ in range(N*max(x)+1)] for _ in range(N+1)]) for j in range(0,N+1): for k in range(0, N+1): for s in range(0, N*max(x)+1): if j>=1 and s<x[j-1]: dp[j][k][s]=dp[j-1][k...
Traceback (most recent call last): File "/tmp/tmpo6t__2w2/tmp06wnp75y.py", line 1, in <module> N,A=map(int, input().split()) ^^^^^^^ EOFError: EOF when reading a line
s567728053
p04013
u474270503
1538248645
Python
Python (3.4.3)
py
Runtime Error
2107
56436
614
N,A=map(int, input().split()) x=list(map(int, input().split())) dp=[] for _ in range(N+1): dp.append([[0 for _ in range(sum(x)+1)] for _ in range(N+1)]) for j in range(0,N+1): for k in range(0, N+1): for s in range(0, sum(x)+1): if j>=1 and s<x[j-1]: dp[j][k][s]=dp[j-1][k][s]...
Traceback (most recent call last): File "/tmp/tmpc2tetabo/tmpsan1wfc1.py", line 1, in <module> N,A=map(int, input().split()) ^^^^^^^ EOFError: EOF when reading a line
s799924492
p04013
u611249982
1537191911
Python
Python (3.4.3)
py
Runtime Error
2107
58484
472
n, a = [int(i) for i in input().split()] x = [int(i) for i in input().split()] nx = n * max(max(x), a) dp = [[[0 for k in range(nx + 1)] for j in range(n + 1)] for i in range(n + 1)] dp[0][0][0] = 1 for i in range(n): for j in range(n): for k in range(nx): if k + x[j] <= n * a: ...
Traceback (most recent call last): File "/tmp/tmpmazqymlm/tmp6mjg275b.py", line 1, in <module> n, a = [int(i) for i in input().split()] ^^^^^^^ EOFError: EOF when reading a line
s101066790
p04013
u957084285
1534446698
Python
Python (3.4.3)
py
Runtime Error
177
4980
358
n,a = map(int, input().split()) x = list(map(lambda x:int(x)-a, input().split())) y = max(x) dp = [[0]*(2*n*y+1) for _ in range(n+1)] dp[0][n*y] = 1 for k in range(n): for i in range(2*n*y+1): if i+x[k] < 0 or i+x[k] > 2*n*y: dp[k+1][i] = dp[k][i] else: dp[k+1][i] = dp[k][i]...
Traceback (most recent call last): File "/tmp/tmp4ylrm48x/tmp5teqqi10.py", line 1, in <module> n,a = map(int, input().split()) ^^^^^^^ EOFError: EOF when reading a line
s905167957
p04013
u690536347
1534265881
Python
Python (3.4.3)
py
Runtime Error
2107
58484
522
n,a=map(int,input().split()) l=list(map(int,input().split())) x=max(l) dp=[[[0 for _ in range(n*x+1)] for _ in range(n+1)] for _ in range(n+1)] for j in range(n+1): for k in range(n+1): for s in range(n*x+1): if j==0 and k==0 and s==0: dp[j][k][s]=1 elif j>=1 and s<l[j-1]: dp[j][k][s]...
Traceback (most recent call last): File "/tmp/tmpn01onvzt/tmp7isp8a61.py", line 1, in <module> n,a=map(int,input().split()) ^^^^^^^ EOFError: EOF when reading a line
s627119270
p04013
u562935282
1534093390
Python
Python (3.4.3)
py
Runtime Error
2107
59760
662
def ary3(x, y, z, v): return [[[v for _ in range(z)] for _ in range(y)] for _ in range(x)] n, a = map(int, input().split()) x = list(map(int, input().split())) m = max(x) dp = ary3(n + 1, n + 1, m * n + 1, 0)#(選べる枚数(範囲)0 ~ n, 選んだ枚数0 ~ n, 合計0 ~ n * max(x)) = パターン数 for i in range(n + 1): dp[i][0][0] = 1 for i in ...
Traceback (most recent call last): File "/tmp/tmpdf2munrt/tmpb6cbtd0k.py", line 3, in <module> n, a = map(int, input().split()) ^^^^^^^ EOFError: EOF when reading a line
s497314873
p04013
u439396449
1532405387
Python
Python (3.4.3)
py
Runtime Error
2109
58612
537
from itertools import product N, A = map(int, input().split()) x = [int(x) for x in input().split()] max_x = max(max(x), A) dp = [[[0 for _ in range(N * max_x)] for _ in range(N + 1)] for _ in range(N + 1)] dp[0][0][0] = 1 for j, k, s in product(range(1, N + 1), range(N + 1), range(N * max_x)): if s < x[j - 1]: ...
Traceback (most recent call last): File "/tmp/tmp92tfhx3z/tmp36k1hr69.py", line 3, in <module> N, A = map(int, input().split()) ^^^^^^^ EOFError: EOF when reading a line
s899198357
p04013
u439396449
1532404449
Python
Python (3.4.3)
py
Runtime Error
2107
56564
557
N, A = map(int, input().split()) x = [int(x) for x in input().split()] max_x = max(x) dp = [[[0 for _ in range((N + 1) * max_x)] 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 + 1) * max_x): if s < x[j - 1]: ...
Traceback (most recent call last): File "/tmp/tmp4h9fcety/tmp49kymq03.py", line 1, in <module> N, A = map(int, input().split()) ^^^^^^^ EOFError: EOF when reading a line
s096371942
p04013
u415905784
1532404188
Python
Python (3.4.3)
py
Runtime Error
18
3064
699
import heapq N, A = map(int, input().split()) X = [int(x) - A for x in input().split()] for x in X: if x > 0: Xp.append(x) elif x < 0: Xm.append(-x) else: X0.append(x) limit = min(sum(Xp), sum(Xm)) Xp = [x for x in Xp if x <= limit] Xm = [x for x in Xm if x <= limit] R = [[0, 0] for x in range(limit +...
Traceback (most recent call last): File "/tmp/tmpi7p6igon/tmprpz06k6w.py", line 2, in <module> N, A = map(int, input().split()) ^^^^^^^ EOFError: EOF when reading a line
s557245995
p04013
u136090046
1532215255
Python
Python (3.4.3)
py
Runtime Error
17
2940
933
import itertools↲ ↲ n, a = map(int, input().split())↲ array = [int(x) for x in input().split()]↲ ↲ array2 = []↲ tmp ...
File "/tmp/tmptmlnpdyq/tmptuz4hxpg.py", line 1 import itertools↲ ^ SyntaxError: invalid character '↲' (U+21B2)
s905299871
p04013
u118605645
1531064254
Python
Python (3.4.3)
py
Runtime Error
2213
1810060
656
import itertools def get_all_comb(ary): r = [] for i in range(1, len(ary) + 1): r += list(itertools.combinations(ary, i)) return r N, A = (int(s) for s in input().split()) X = [int(s) for s in input().split()] lowers = [] i = 0 while X[i] < A: lowers.append((X[i])) i += 1 lowers = [x for...
Traceback (most recent call last): File "/tmp/tmpud9u4dj7/tmpryg3kzzt.py", line 9, in <module> N, A = (int(s) for s in input().split()) ^^^^^^^ EOFError: EOF when reading a line
s168093638
p04013
u559823804
1528951024
Python
Python (3.4.3)
py
Runtime Error
2107
56436
449
n,a=map(int,input().split()) x=list(map(int,input().split())) X=max(x) X=max(X,a) dp=[[[0 for _ in range(n*X+1)] for _ in range(51)] for _ in range(51)] dp[0][0][0]=1 for j in range(n): for k in range(n+1): for s in range(n*X+1): dp[j+1][k][s]+=dp[j][k][s] if x[j]+s<n*X+1: ...
Traceback (most recent call last): File "/tmp/tmpjegfwsa2/tmp755wow7r.py", line 1, in <module> n,a=map(int,input().split()) ^^^^^^^ EOFError: EOF when reading a line
s162908411
p04013
u846150137
1527121940
Python
Python (3.4.3)
py
Runtime Error
17
2940
375
n, a = [int(i) for i in input().split()] x = [int(i) for i in input().split()] dp=[[0 for i in range(a*n+1)] for j in range(n+1)] dp[0][0]=1 ans=0 f=0 for k in range(1,n+1): kx=x[k-1] f+=kx for i in range(k,0,-1): for j in range(kx,a*n+1): dp[i][j] += dp[i-1][j-kx] if j > f: break ...
File "/tmp/tmpmxx8jdxl/tmpze5fvtq6.py", line 1 n, a = [int(i) for i in input().split()] IndentationError: unexpected indent
s487406936
p04013
u846150137
1527121236
Python
Python (3.4.3)
py
Runtime Error
2109
14680
435
import numpy as np n, a = [int(i) for i in input().split()] x = [int(i) for i in input().split()] sx=sum(x) dp= np.zeros((n+1,sx+1),dtype='int32') #dp=[[0]*(n*a+1)]*(n+1) dp[0][0]=1 ans=0 f=0 for k in range(1,n+1): kx=x[k-1] f+=kx for i in range(k,0,-1): for j in range(kx,sx+1): dp[i][j] += dp[i-1][j-kx...
Traceback (most recent call last): File "/tmp/tmpze9xtp72/tmp7gd1prmv.py", line 2, in <module> n, a = [int(i) for i in input().split()] ^^^^^^^ EOFError: EOF when reading a line
s610245692
p04013
u846150137
1527111339
Python
Python (3.4.3)
py
Runtime Error
2109
14568
425
import numpy as np n, a = [int(i) for i in input().split()] x = [int(i) for i in input().split()] dp= np.zeros((n+1,n*a+1),dtype=int) dp[0][0]=1 ans=0 f=0 for k in range(1,n+1): f+=x[k-1] for i in range(k,-1,-1): for j in range(0, f + 1): if j>=x[k-1] and i>=1: dp[i][j]= dp[i][j] + dp[i-1][j-x[k...
Traceback (most recent call last): File "/tmp/tmp4vg2s74h/tmp7lzdt8e9.py", line 2, in <module> n, a = [int(i) for i in input().split()] ^^^^^^^ EOFError: EOF when reading a line
s883552179
p04013
u846150137
1527111045
Python
Python (3.4.3)
py
Runtime Error
1633
13160
428
import numpy as np n, a = [int(i) for i in input().split()] x = [int(i) for i in input().split()] sx=sum(x) dp= np.zeros((n+1,n*a+1),dtype=int) dp[0][0]=1 ans=0 f=0 for k in range(1,n+1): f+=k for i in range(k,-1,-1): for j in range(0, f + 1): if j>=x[k-1] and i>=1: dp[i][j]= dp[i][j] + dp[i-1][j...
Traceback (most recent call last): File "/tmp/tmp_8v3ok1x/tmp95_gtjdq.py", line 2, in <module> n, a = [int(i) for i in input().split()] ^^^^^^^ EOFError: EOF when reading a line
s102090630
p04013
u846150137
1527110933
Python
Python (3.4.3)
py
Runtime Error
2108
13040
422
import numpy as np n, a = [int(i) for i in input().split()] x = [int(i) for i in input().split()] sx=sum(x) dp= np.zeros((n+1,n*a+1),dtype=int) dp[0][0]=1 ans=0 for k in range(1,n+1): for i in range(k,-1,-1): for j in range(0, sx * n + 1): if j>=x[k-1] and i>=1: dp[i][j]= dp[i][j] + dp[i-1][j-x[k-1...
Traceback (most recent call last): File "/tmp/tmpw_mhkvcf/tmp472qfh1z.py", line 2, in <module> n, a = [int(i) for i in input().split()] ^^^^^^^ EOFError: EOF when reading a line
s067346679
p04013
u846150137
1527110137
Python
Python (3.4.3)
py
Runtime Error
18
3064
419
n, a = [int(i) for i in input().split()] x = [int(i) for i in input().split()] dp= np.zeros((n+1,n+1,n*a+1),dtype=int) dp[0][0][0]=1 ans=0 for k in range(1,n+1): for i in range(0,k+1): for j in range(0,a * i+1): if j>=x[k-1] and i>=1: dp[k][i][j]= dp[k-1][i][j] + dp[k-1][i-1][j-x[k-1]] else:...
Traceback (most recent call last): File "/tmp/tmpavstzl3u/tmpx7pjdrz5.py", line 1, in <module> n, a = [int(i) for i in input().split()] ^^^^^^^ EOFError: EOF when reading a line
s212831457
p04013
u846150137
1527109788
Python
Python (3.4.3)
py
Runtime Error
151
12452
405
import numpy as np n, a = [int(i) for i in input().split()] x = [int(i) for i in input().split()] dp= np.zeros((n+1,s*n+1),dtype=int) dp[0][0]=1 ans=0 for k in range(1,n+1): for i in range(0,k+1): for j in range(0,s*n+1): if j>=x[k-1] and i>=1: dp[i][j]= dp[i][j] + dp[i-1][j-x[k-1]] else: ...
Traceback (most recent call last): File "/tmp/tmppg9pwu4f/tmpg9oiqrut.py", line 2, in <module> n, a = [int(i) for i in input().split()] ^^^^^^^ EOFError: EOF when reading a line
s170046804
p04013
u846150137
1527109705
Python
Python (3.4.3)
py
Runtime Error
149
14500
419
import numpy as np n, a = [int(i) for i in input().split()] x = [int(i) for i in input().split()] xs=sum(x) dp= np.zeros((n+1,xs*n+1),dtype=int) dp[0][0][0]=1 ans=0 for k in range(1,n+1): for i in range(0,k+1): for j in range(0,xs*n+1): if j>=x[k-1] and i>=1: dp[i][j]= dp[i][j] + dp[i-1][j-x[k-1]] ...
Traceback (most recent call last): File "/tmp/tmp1cuzyiaz/tmpsgssq3r5.py", line 2, in <module> n, a = [int(i) for i in input().split()] ^^^^^^^ EOFError: EOF when reading a line
s924128898
p04013
u846150137
1527109599
Python
Python (3.4.3)
py
Runtime Error
2108
37092
447
import numpy as np n, a = [int(i) for i in input().split()] x = [int(i) for i in input().split()] xs=sum(x) dp= np.zeros((n+1,n+1,xs*n+1),dtype=int) dp[0][0][0]=1 ans=0 for k in range(1,n+1): for i in range(0,k+1): for j in range(0,xs*n+1): if j>=x[k-1] and i>=1: dp[k][i][j]= dp[k-1][i][j] + dp[k-1...
Traceback (most recent call last): File "/tmp/tmptbth7bmu/tmpyxx_447g.py", line 2, in <module> n, a = [int(i) for i in input().split()] ^^^^^^^ EOFError: EOF when reading a line
s194897703
p04013
u846150137
1527109542
Python
Python (3.4.3)
py
Runtime Error
2108
36964
446
import numpy as np n, a = [int(i) for i in input().split()] x = [int(i) for i in input().split()] xs=sum(x) dp= np.zeros((n+1,n+1,n*a+1),dtype=int) dp[0][0][0]=1 ans=0 for k in range(1,n+1): for i in range(0,k+1): for j in range(0,xs*n+1): if j>=x[k-1] and i>=1: dp[k][i][j]= dp[k-1][i][j] + dp[k-1]...
Traceback (most recent call last): File "/tmp/tmpvgf6kci1/tmp9fn9i8l6.py", line 2, in <module> n, a = [int(i) for i in input().split()] ^^^^^^^ EOFError: EOF when reading a line
s966918474
p04013
u503901534
1526621094
Python
Python (3.4.3)
py
Runtime Error
18
3064
758
s = int(input()) sl = list(str(s)) sl_n = len(sl) - 1 l = ['a','b'] def a_or_b(x): if len(list(str(x[0]))) == sl_n: return x else: ll = [] for i in range(len(x)): ll.append(x[i] + 'a') for i in range(len(x)): ll.append(x[i] + 'b') x = ll re...
Traceback (most recent call last): File "/tmp/tmpax0xmdzz/tmpsw__2pkw.py", line 1, in <module> s = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s536350045
p04013
u503901534
1525486911
Python
Python (3.4.3)
py
Runtime Error
17
2940
435
n, a = map(int,input().split()) x = list(map(int,input().split())) xx = [] for i in range(n): xx.append(x-a) X = max(xx) #dp def dp(j,t,l=xx): if j = 0 and t = n * X: return 1 elif j > 0 and t -l[j] < 0 or t- l[j] > 2* n * X: return dp(j-1,t,l=xx) elif j > 1 and 0 <= t-l[j] <= 2*n*X...
File "/tmp/tmphsyyvb6l/tmprlr_mkz1.py", line 10 if j = 0 and t = n * X: ^^^^^ SyntaxError: invalid syntax. Maybe you meant '==' or ':=' instead of '='?
s559823355
p04013
u667024514
1524843790
Python
Python (3.4.3)
py
Runtime Error
17
3064
373
n = int(input()) a = sorted(map(int,input().split())) b = sorted(map(int,input().split())) c = sorted(map(int,input().split())) lis = [0] * n j = 0 for i in range(n): while j < n and a[j] < b[i]: j += 1 lis[i] = j li = [0] * n m = 0 j = 0 for i in range(n): while j < n and b[j] < c[i]: m +...
Traceback (most recent call last): File "/tmp/tmphlm4c828/tmpebniypfa.py", line 1, in <module> n = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s269193579
p04013
u125205981
1524438201
Python
Python (3.4.3)
py
Runtime Error
181
4980
568
def main(): N, A = map(int, input().split()) X = tuple(map(int, input().split())) x = [i - A for i in X] nx = max(x) * N dp = [[0] * (2 * nx + 1) for _ in [0] * (N + 1)] for i in range(N + 1): for j in range(2 * nx + 1): if not i: if j == nx: ...
Traceback (most recent call last): File "/tmp/tmps3smv6t5/tmp4vmjlb8_.py", line 19, in <module> main() File "/tmp/tmps3smv6t5/tmp4vmjlb8_.py", line 2, in main N, A = map(int, input().split()) ^^^^^^^ EOFError: EOF when reading a line
s810024471
p04013
u281303342
1524340107
Python
Python (3.4.3)
py
Runtime Error
2107
58484
617
N,A = map(int,input().split()) X = [0]+list(map(int,input().split())) sumX = sum(X) dp = [[[0 for _ in range(sumX+1)] for _ in range(N+1)] for _ in range(N+1)] dp[0][0][0] = 1 for i in range(1,N+1): for j in range(0,i+1): for k in range(sum(X)+1): if j==0 and k==0: dp[i][j][k] ...
Traceback (most recent call last): File "/tmp/tmpqbmork48/tmpjj4iu05g.py", line 1, in <module> N,A = map(int,input().split()) ^^^^^^^ EOFError: EOF when reading a line
s043980293
p04013
u281303342
1524339557
Python
Python (3.4.3)
py
Runtime Error
2107
61680
570
N,A = map(int,input().split()) X = [0]+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(1,N+1): for j in range(0,i+1): for k in range(N*maxX+1): if j==0 and k==0: dp[i][j][k...
Traceback (most recent call last): File "/tmp/tmpi_9t6fe3/tmpu7c0c83a.py", line 1, in <module> N,A = map(int,input().split()) ^^^^^^^ EOFError: EOF when reading a line
s453971103
p04013
u075012704
1524276566
Python
Python (3.4.3)
py
Runtime Error
2108
54772
478
N, A = map(int, input().split()) X = list(map(int, input().split())) x_max = max(X) dp = [[[0]*(N*x_max+1) for i in range(N+1)] for i 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_max+1): if X[j-1] <= s: dp[j][k][s] = dp[j-1][k][s...
Traceback (most recent call last): File "/tmp/tmp7fvqeqk0/tmp5m75e59m.py", line 1, in <module> N, A = map(int, input().split()) ^^^^^^^ EOFError: EOF when reading a line
s535561228
p04013
u952708174
1522618062
Python
Python (3.4.3)
py
Runtime Error
18
3060
419
def c_atcodeer_and_election_report(N, R): from math import ceil t = 1 # 高橋の票数 a = 1 # 青木の票数 for x, y in R: # t<=nx ∧ a<=ny を満たす最小のnを求める n = max(ceil(t / x), ceil(a / y)) t = n * x a = n * y return t + a N = int(input()) R = [[int(i) for i in input().split()] for j i...
Traceback (most recent call last): File "/tmp/tmpx8xdrk2v/tmpsxclpkr7.py", line 11, in <module> N = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s186447755
p04013
u651925006
1520964525
Python
Python (3.4.3)
py
Runtime Error
17
2940
80
a, b, c = input().split() print('YES' if a[-1]==b[0] and b[-1]==c[0] else 'NO')
Traceback (most recent call last): File "/tmp/tmp6q9iky9t/tmpztvu0b91.py", line 1, in <module> a, b, c = input().split() ^^^^^^^ EOFError: EOF when reading a line
s250090165
p04013
u764600134
1518366974
Python
Python (3.4.3)
py
Runtime Error
2027
61772
1045
# -*- coding: utf-8 -*- """ https://beta.atcoder.jp/contests/abc044/tasks/arc060_a """ import sys from sys import stdin from copy import copy, deepcopy input = stdin.readline def solve(N, A, cards): ans = 0 cards.append(0) cards.sort() W = max(cards) * N # dp[j][k][s]: j番目までのカードをk枚使って合計をsにする組み合わ...
Traceback (most recent call last): File "/tmp/tmp8fg0qder/tmpmmdq_6vw.py", line 45, in <module> main(sys.argv[1:]) File "/tmp/tmp8fg0qder/tmpmmdq_6vw.py", line 38, in main N, A = map(int, input().split()) ^^^^ ValueError: not enough values to unpack (expected 2, got 0)
s134611784
p04013
u952708174
1517167184
Python
Python (3.4.3)
py
Runtime Error
81
5748
418
def c_Tak_and_Cards(N, A, S): X = max(S) y = [x - A for x in S] dp = [[0 for _ in range(2 * N * X + 1)] for _ in range(N + 1)] dp[0][N * X] = 1 for j in range(N): for t in range(X, (2 * N - 1) * X): dp[j + 1][t] = dp[j][t] + dp[j][t - y[j]] return dp[N][N * X] - 1 N,A = [int(...
Traceback (most recent call last): File "/tmp/tmpwhr0nhax/tmpgdvu1udw.py", line 10, in <module> N,A = [int(i) for i in input().split()] ^^^^^^^ EOFError: EOF when reading a line
s129682693
p04013
u621935300
1514013520
Python
Python (2.7.6)
py
Runtime Error
2107
55676
525
N,A=map(int,raw_input().split()) x=[0]+map(int,raw_input().split()) #print x max_n=max(x) dp=[[[0]*(N*max_n+1) for k in range(N + 1)] for j in range(N+1)] #print dp for j in range(N+1): for k in range(N+1): for s in range(N*max_n+1): if j==k==s==0: dp[j][k][s]=1 elif j>=1 and s<x[j]: dp[j][k][s]=dp...
File "/tmp/tmpx3zewl1n/tmptxxubuho.py", line 29 print ans ^^^^^^^^^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
s093684778
p04013
u879309973
1495628106
Python
Python (2.7.6)
py
Runtime Error
1825
63360
408
import numpy as np N, A = map(int, raw_input().split()) x = map(int, raw_input().split()) dp = np.full((N+1, A+1, (N+1)*(A+1)), -1) def dfs(i, t, W): if t == 0: return int(W == 0) if i < 0: return 0 if dp[i, t, W] > -1: return dp[i, t, W] dp[i, t, W] = dfs(i-1, t, W) + dfs(i-1, ...
File "/tmp/tmpmrcru1_j/tmpw6c65u9j.py", line 15 print sum([dfs(N-1, T, T*A) for T in range(1, N+1)]) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
s636976868
p04013
u332385682
1490738752
Python
Python (3.4.3)
py
Runtime Error
129
54004
560
N, A = map(int, input().split()) x = [int(i) for i in input().split()] # 3d DP max_x = max(x) dp = [[[0] * (max_x * N + 1) for j in range(N + 1)] for i in range(N + 1)] dp[0][0][0] = 1 for i in range(0, N): for k in range(0, N + 1): for y in range(max_x * N + 1): ...
Traceback (most recent call last): File "/tmp/tmp1epjrtyo/tmpuqi2gqvp.py", line 1, in <module> N, A = map(int, input().split()) ^^^^^^^ EOFError: EOF when reading a line
s881571500
p04013
u481333386
1489285611
Python
Python (3.4.3)
py
Runtime Error
18
3060
390
n, a = [int(e) for e in input().split()] lst = [int(e) for e in input().split()] def main(n, a, lst): count = 0 lst_len = len(lst) for i in range(1, i + 1): for j, _ in enumerate(lst): if lst_len <= j + i: break e = lst[j:j + i] if e // i == a: ...
Traceback (most recent call last): File "/tmp/tmpgbbi1rmy/tmpecotlgmk.py", line 1, in <module> n, a = [int(e) for e in input().split()] ^^^^^^^ EOFError: EOF when reading a line
s679741117
p04013
u332385682
1488400419
Python
Python (3.4.3)
py
Runtime Error
225
3444
612
import sys from collections import Counter def debug(x, table): for name, val in table.items(): if x is val: print('DEBUG:{} -> {}'.format(name, val), file=sys.stderr) return None def solve(): N, A = map(int, input().split()) assert N <= 16 x = [int(i) for i in input(...
Traceback (most recent call last): File "/tmp/tmp4aztcwzo/tmp8cdoeicm.py", line 27, in <module> solve() File "/tmp/tmp4aztcwzo/tmp8cdoeicm.py", line 11, in solve N, A = map(int, input().split()) ^^^^^^^ EOFError: EOF when reading a line
s195187262
p04013
u614550445
1485640939
Python
Python (3.4.3)
py
Runtime Error
1021
4208
362
N, A = [int(_) for _ in input().split()] x = sorted([int(_) for _ in input().split()]) dp = [[0] * (sum(x)+1) for j in range(N+1)] dp[0][0] = 1 for i in range(1, N+1): for j in list(range(1, N+1))[::-1]: for k in list(range(x[i-1], sum(x[:i])+1))[::-1]: dp[j][k] += dp[j-1][k - x[i-1]] print(...
Traceback (most recent call last): File "/tmp/tmpl50z41s6/tmpfnmm7xvw.py", line 2, in <module> N, A = [int(_) for _ in input().split()] ^^^^^^^ EOFError: EOF when reading a line
s240276578
p04013
u831695469
1478859316
Python
Python (3.4.3)
py
Runtime Error
22
3064
323
n, a = map(int, raw_input().split()) X = map(int, raw_input().split()) dp = [[0]*(n*a+1) for i in xrange(n+1)] dp[0][0] = 1 for i in xrange(n): for j in xrange(i, -1, -1): for k in xrange(n*a, X[i]+1, -1): dp[j+1][k] += dp[j][k-X[i]] ans = 0 for i in xrange(1, n+1): ans += dp[i][i*a] print a...
File "/tmp/tmptsc703pu/tmp3xn7zy75.py", line 12 print ans ^^^^^^^^^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
s605216610
p04013
u664481257
1478645487
Python
Python (3.4.3)
py
Runtime Error
45
5388
1278
# -*- coding: utf-8 -*- # !/usr/bin/env python # vim: set fileencoding=utf-8 : """ # # Author: Noname # URL: https://github.com/pettan0818 # License: MIT License # Created: 火 11/ 8 17:04:53 2016 # Usage # """ from itertools import repeat from itertools import combinations import sys from statistics import m...
Traceback (most recent call last): File "/tmp/tmp34heyldn/tmpbc04ail7.py", line 66, in <module> N, A, x_list = read_input() ^^^^^^^^^^^^ File "/tmp/tmp34heyldn/tmpbc04ail7.py", line 23, in read_input first = input().split(" ") ^^^^^^^ EOFError: EOF when reading a line
s398568631
p04013
u065683101
1475679579
Python
Python (3.4.3)
py
Runtime Error
1080
38900
550
from array import array def read(): return int(input()) def reads(sep=None): return list(map(int, input().split(sep))) def main(): n, a = reads() x = reads() s = sum(x) dp = [[array('I', [0]*3500) for j in range(n+1)] for i in range(n+1)] dp[0][0][0] = 1 for i in range(n): for...
Traceback (most recent call last): File "/tmp/tmp7py_3uro/tmpw466wxwx.py", line 25, in <module> main() File "/tmp/tmp7py_3uro/tmpw466wxwx.py", line 10, in main n, a = reads() ^^^^^^^ File "/tmp/tmp7py_3uro/tmpw466wxwx.py", line 7, in reads return list(map(int, input().split(sep))) ...
s716220110
p04013
u343675824
1473557119
Python
Python (3.4.3)
py
Runtime Error
38
3064
1026
#include <bits/stdc++.h> #define FOR(i,a,b) for(int i=(a);i<(b);i++) #define RFOR(i,a,b) for(int i=(b) - 1;i>=(a);i--) #define REP(i,n) for(int i=0;i<(n);i++) #define RREP(i,n) for(int i=n-1;i>=0;i--) #define PB push_back #define MP make_pair #define ALL(a) (a).begin(),(a).end() #define RALL(a) (a).rbegin(),(a).rend()...
File "/tmp/tmpm7u5vw43/tmp08_rtrot.py", line 16 using namespace std; ^^^^^^^^^ SyntaxError: invalid syntax
s662166796
p04013
u212829728
1473092318
Python
Python (3.4.3)
py
Runtime Error
41
3316
1042
def app(numlist, A ): counter = 0 N = len(numlist) for i in range(1,N): counter += f(numlist, i, A*i) return counter def f(numlist, rest, sum): result = 0 numset = set(numlist) if rest == 1: return numlist.count(sum) elif rest == 2: for big in numset: if (sum - big in numset) and (bi...
Traceback (most recent call last): File "/tmp/tmpgmt5iisg/tmp58a4xvbn.py", line 46, in <module> N, A = input() ^^^^^^^ EOFError: EOF when reading a line
s138112581
p04013
u442810826
1472456886
Python
Python (2.7.6)
py
Runtime Error
30
2568
1438
rom itertools import combinations n,a=map(int,raw_input().split()) x=map(int,raw_input().split()) el_plus = [] el_minus = [] sum_plus_dict = {"def":None} sum_minus_dict = {"def":None} x = [el - a for el in x] count_zero = 0 count = 0 for i in range(len(x)): if x[i] > 0: el_plus.append(x[i]) elif x[i]...
File "/tmp/tmp6ini412f/tmpliwkbf3t.py", line 1 rom itertools import combinations ^^^^^^^^^ SyntaxError: invalid syntax
s078914664
p04013
u442810826
1472455880
Python
Python (2.7.6)
py
Runtime Error
28
2696
1351
from itertools import combinations n,a=map(int,raw_input().split()) x=map(int,raw_input().split()) el_plus = [] el_minus = [] sum_plus_dict = {"def":None} sum_minus_dict = {"def":None} x = [el - a for el in x] count_zero = 0 count = 0 for i in range(len(x)): if x[i] > 0: el_plus.append(x[i]) elif x[i...
File "/tmp/tmpvh275agn/tmp106avf2_.py", line 24 print 0 ^^^^^^^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
s849215541
p04013
u123756661
1472434241
Python
Python (2.7.6)
py
Runtime Error
473
4612
276
n,a=map(int,raw_input().split()) x=map(int,raw_input().split()) ans=0 for i in range(1<<n): chk=0 t=bin(i)[2:] t='0'*(n-len(t))+t for j,p in enumerate(t): if p=='1': chk+=x[j] if chk!=0 and chk==a*t.count('1'): ans+=1 print ans
File "/tmp/tmp5_bi2054/tmpvlkh_mfe.py", line 13 print ans ^^^^^^^^^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
s009355390
p04014
u825685913
1600745759
Python
Python (3.8.2)
py
Runtime Error
429
9380
508
#自分の回答 import math def digit(b, n): if n < b: return n else: return digit(b, math.floor(n/b)) + n % b n, s = int(input()), int(input()) if n == s: print(n+1) exit() if n < s: print(-1) exit() for i in range(2, int(math.sqrt(n)) + 2): if digit(i, n) == s: print(i...
Traceback (most recent call last): File "/tmp/tmpw9wycrf3/tmpxfsdilbw.py", line 9, in <module> n, s = int(input()), int(input()) ^^^^^^^ EOFError: EOF when reading a line
s100018785
p04014
u825685913
1600745317
Python
Python (3.8.2)
py
Runtime Error
433
9692
508
#自分の回答 import math def digit(b, n): if n < b: return n else: return digit(b, math.floor(n/b)) + n % b n, s = int(input()), int(input()) if n == s: print(n+1) exit() if n < s: print(-1) exit() for i in range(2, int(math.sqrt(n)) + 2): if digit(i, n) == s: print(i...
Traceback (most recent call last): File "/tmp/tmpv20xestp/tmpcp5ibx35.py", line 9, in <module> n, s = int(input()), int(input()) ^^^^^^^ EOFError: EOF when reading a line
s984660441
p04014
u825685913
1600744680
Python
Python (3.8.2)
py
Runtime Error
428
9392
506
#自分の回答 import math def digit(b, n): if n < b: return n else: return digit(b, math.floor(n/b)) + n % b n, s = int(input()), int(input()) if n == s: print(n+1) exit() if n < s: print(-1) exit() for i in range(2, int(math.sqrt(n) + 1)): if digit(i, n) == s: print(i...
Traceback (most recent call last): File "/tmp/tmpyevnduac/tmpyazd5bv1.py", line 9, in <module> n, s = int(input()), int(input()) ^^^^^^^ EOFError: EOF when reading a line
s401456114
p04014
u825685913
1600744464
Python
Python (3.8.2)
py
Runtime Error
431
9476
483
import math def digit(b, n): if n < b: return n else: return digit(b, math.floor(n/b)) + n % b n, s = int(input()), int(input()) if n == s: print(n+1) exit() if n < s: print(-1) exit() for i in range(2, int(math.sqrt(n))): if digit(i, n) == s: print(i) e...
Traceback (most recent call last): File "/tmp/tmpir_ac5ye/tmpzb3xdsh1.py", line 8, in <module> n, s = int(input()), int(input()) ^^^^^^^ EOFError: EOF when reading a line
s407215184
p04014
u969708690
1599275046
Python
Python (3.8.2)
py
Runtime Error
27
9112
102
n=int(input()) s=int(input()) if n==s: print(n+1) exit() if (n+3)//2<=s: print(-1) exit() ewew
Traceback (most recent call last): File "/tmp/tmp1wn1_l84/tmp982z2egx.py", line 1, in <module> n=int(input()) ^^^^^^^ EOFError: EOF when reading a line
s461030622
p04014
u074220993
1599106043
Python
Python (3.8.2)
py
Runtime Error
285
9612
496
n, s = int(input()), int(input()) f = lambda b,n:n if n < b else n%b + f(b,n//b) import math ans = n+2 for b in range(2,math.ceil(math.sqrt(n))): #O(√n)の全探索 if f(b,n) == s: ans = b; break else: for p in range(math.ceil(math.sqrt(n))): #n=pb+q (b>√n, p+q=s)に基づいたO(√n)の全探索 q = s-p if p > 0...
Traceback (most recent call last): File "/tmp/tmp657zp7fz/tmph_k79za1.py", line 1, in <module> n, s = int(input()), int(input()) ^^^^^^^ EOFError: EOF when reading a line
s533095829
p04014
u533039576
1597252447
Python
PyPy3 (7.3.0)
py
Runtime Error
2207
74736
539
def func(b, n): res = 0 while n > 0: res += n % b n //= b return res def solve(): n = int(input()) s = int(input()) if n == s: return n + 1 # elif n < s: # return -1 for b in range(2, n + 1): if b**2 > n: break if func(b, n)...
Traceback (most recent call last): File "/tmp/tmpoofoid3l/tmp_tozwhc0.py", line 35, in <module> ans = solve() ^^^^^^^ File "/tmp/tmpoofoid3l/tmp_tozwhc0.py", line 10, in solve n = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s950581888
p04014
u758815106
1595830542
Python
Python (3.8.2)
py
Runtime Error
388
9196
442
import math n = int(input()) s = int(input()) r = 0 if n == s: print(n + 1) exit() nn = int(math.sqrt(n)) + 1 for i in range(2, nn): nt = n st = 0 while nt > 0: st += nt % i nt //= i if st == s: print(i) exit() for i in range(nn, 0, -1): nt = n ...
Traceback (most recent call last): File "/tmp/tmpzpr7t3m_/tmpw8y4uona.py", line 3, in <module> n = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s329214318
p04014
u758815106
1595830427
Python
PyPy3 (7.3.0)
py
Runtime Error
114
75104
480
import math n = int(input()) s = int(input()) r = 0 if n == s: print(n + 1) exit() elif n < s: print(-1) exit() nn = int(math.sqrt(n)) + 1 for i in range(2, nn): nt = n st = 0 while nt > 0: st += nt % i nt //= i if st == s: print(i) exit() for ...
Traceback (most recent call last): File "/tmp/tmp4s_644u3/tmp75789_ra.py", line 3, in <module> n = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s426873946
p04014
u758815106
1595829262
Python
Python (3.8.2)
py
Runtime Error
483
9188
554
import math n = int(input()) s = int(input()) r = 0 if n == s: print(n + 1) exit() elif n < s: print(-1) exit() elif s == 1: print(n) exit() nn = int(math.sqrt(n)) + 1 for i in range(2, nn): nt = n st = 0 while nt > 0: st += nt % i nt //= i if st == s: ...
Traceback (most recent call last): File "/tmp/tmpoalml2g0/tmpsp6_arxd.py", line 3, in <module> n = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s011869719
p04014
u726872801
1595660496
Python
Python (3.8.2)
py
Runtime Error
2206
9648
856
import sys import heapq, math from itertools import zip_longest, permutations, combinations, combinations_with_replacement from itertools import accumulate, dropwhile, takewhile, groupby from functools import lru_cache from copy import deepcopy N, S = [int(input()), int(input())] def solve1(): i = 2 while i ...
Traceback (most recent call last): File "/tmp/tmp47211n2u/tmpm_2ireiz.py", line 8, in <module> N, S = [int(input()), int(input())] ^^^^^^^ EOFError: EOF when reading a line
s232264597
p04014
u786020649
1594407897
Python
Python (3.8.2)
py
Runtime Error
59
9120
618
import sys import math def divlist(n): sl=[] ll=[] for x in range(1,int(math.sqrt(n))+1): if n%x==0: sl.append(x) ll.append(n//x) ll.reverse() sl.extend(ll) return sl def f(b,n): if n<b: return n else: return f(b,n//b)+(n%b) def main(n,s): if...
Traceback (most recent call last): File "/tmp/tmpv0dnqml3/tmp_olchzdp.py", line 33, in <module> n=int(sys.stdin.readline().strip()) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ValueError: invalid literal for int() with base 10: ''
s410403577
p04014
u786020649
1594407539
Python
Python (3.8.2)
py
Runtime Error
28
9056
547
import sys import math n=int(sys.stdin.readline().strip()) s=int(sys.stdin.readline().strip()) def divlist(n): sl=[] ll=[] for x in range(1,int(math.sqrt(n))+1): if n%x==0: sl.append(x) ll.append(n//x) ll.reverse() sl.extend(ll) return sl def f(b,n): if n<b: ...
File "/tmp/tmpzc3_d7tb/tmplv84bkv4.py", line 25 print(-1 ^ SyntaxError: '(' was never closed
s636813106
p04014
u203843959
1590546623
Python
PyPy3 (2.4.0)
py
Runtime Error
240
40684
405
import sys n=int(input()) s=int(input()) if n==s: print(n+1) sys.exit(0) def f(b,n): ret=0 while n: ret+=n%b n//=b return ret for b in range(2,int(n**0.5)+1): ss=f(b,n) if ss==s: print(b) sys.exit(0) #n=pb+q for p in range(1,int(n**0.5)+1): q=s-p b=(n-q)//p if q<0 or (n-q)%p!=0: ...
Traceback (most recent call last): File "/tmp/tmp3a78on52/tmpb81vybhh.py", line 2, in <module> n=int(input()) ^^^^^^^ EOFError: EOF when reading a line
s780288528
p04014
u888100977
1590112909
Python
Python (3.4.3)
py
Runtime Error
313
20884
615
n = int(input()) s = int(input()) import sys sys.setrecursionlimit(20000) import math def f(b, n): # print(b, n) if n<b: return n else: x = f(b, n//b) + n%b return x # print(f(100000000000,100000000000)) ans = 0 # if n<s: # print(-1) # exit() if n==s: print(n+1) exit...
Traceback (most recent call last): File "/tmp/tmpv4rswnlx/tmp7_0169tf.py", line 1, in <module> n = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s523173150
p04014
u888100977
1590112373
Python
Python (3.4.3)
py
Runtime Error
309
4020
504
n = int(input()) s = int(input()) import math def f(b, n): # print(b, n) if n<b: return n else: x = f(b, n//b) + n%b return x ans = 0 if n<s: print(-1) exit() for b in range(2,int(math.sqrt(n))+500): if f(b, n) == s: ans = b print(ans) ex...
Traceback (most recent call last): File "/tmp/tmp6rlgvr8g/tmpcycxdgr7.py", line 1, in <module> n = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s704641649
p04014
u888100977
1590112350
Python
PyPy3 (2.4.0)
py
Runtime Error
360
52592
504
n = int(input()) s = int(input()) import math def f(b, n): # print(b, n) if n<b: return n else: x = f(b, n//b) + n%b return x ans = 0 if n<s: print(-1) exit() for b in range(2,int(math.sqrt(n))+500): if f(b, n) == s: ans = b print(ans) ex...
Traceback (most recent call last): File "/tmp/tmpkjqt10z3/tmps8fcvf03.py", line 1, in <module> n = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s762984161
p04014
u915647268
1588667512
Python
Python (3.4.3)
py
Runtime Error
537
3188
355
n = int(input()) s = int(input()) sq = n**.5 ans = '-1' for b in range(2, int(sq)+1): sum = 0 tmp = n while tmp//b != 0: sum += tmp%b tmp //= b sum += tmp if sum == s: ans = b break if ans == '-1': for p in range(int(sq), 0, -1): b = (n-s+p)/p if b % 1 == 0: b = int(b) q = n%b if p+q == s: ...
Traceback (most recent call last): File "/tmp/tmpm3a8byqp/tmpl34daw01.py", line 1, in <module> n = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s427491459
p04014
u308918401
1588637868
Python
Python (3.4.3)
py
Runtime Error
18
2940
177
def f(b,n): if n<b: return(n) else: return(f(b,int(n/b))+n%b) n=int(input()) s=int(inout()) t=-1 for i in range(n-2): if f(i+2,n)==s: t=i+2 break print(t)
Traceback (most recent call last): File "/tmp/tmp1gb_gupr/tmp4dfrnldx.py", line 7, in <module> n=int(input()) ^^^^^^^ EOFError: EOF when reading a line
s136893337
p04014
u915647268
1587822431
Python
Python (3.4.3)
py
Runtime Error
547
3064
360
n = int(input()) s = int(input()) sq = n**.5 ans = '-1' for b in range(2, int(sq)+1): sum = 0 tmp = n while tmp//b != 0: sum += tmp%b tmp //= b sum += tmp if sum == s: ans = b break if ans == '-1': for p in range(int(sq), 0, -1): b = (n-s+p)/p if b.is_integer(): b = int(b) q = n%b if p+q ==...
Traceback (most recent call last): File "/tmp/tmp722z31gc/tmpd27u0437.py", line 1, in <module> n = int(input()) ^^^^^^^ EOFError: EOF when reading a line