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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
s205122226 | p02555 | u849559474 | 1600369886 | Python | Python (3.8.2) | py | Runtime Error | 344 | 27732 | 263 | s = int(input())
mod = 10**9+7
import numpy as np
if s == 1 or s == 2:
print(0)
elif s == 3 or s == 4:
print(1)
else:
array = np.zeros(s)
array[2] = 1
array[3] = 1
for i in range(4, s):
array[i] = (array[i-1] + array[i-3]) % mod
print(array[s]) | Traceback (most recent call last):
File "/tmp/tmphujh9o1q/tmp559dlrg6.py", line 1, in <module>
s = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s012568308 | p02555 | u849559474 | 1600369775 | Python | Python (3.8.2) | py | Runtime Error | 117 | 27020 | 264 | s = int(input())
mod = 10**9+7
import numpy as np
if s == 1 or s == 2:
print(0)
elif s == 3 or s == 4:
print(1)
else:
array = np.zeros(s)
array[2] = 1
array[3] = 1
for i in range(4, s):
array[i] = (array[i-1] + array[i-3]) % mod
print(array[s])
| Traceback (most recent call last):
File "/tmp/tmpwk4b2pdx/tmp15j6r2az.py", line 1, in <module>
s = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s630051120 | p02555 | u849559474 | 1600369679 | Python | Python (3.8.2) | py | Runtime Error | 24 | 9004 | 263 | s = int(input())
mod = 10**9+7
import numpy as np
if s == 1 or s == 2:
print(0)
elif s == 3 or s == 4:
print(1)
else:
array = np.zeros(s)
array[2] = 1
array[3] = 1
for i in range(4, s):
array[i] = (array[i-1] + array[i-3]) % mod
print(array[s]) | File "/tmp/tmpn232er8w/tmpw7cbq1sx.py", line 13
for i in range(4, s):
^
IndentationError: unindent does not match any outer indentation level
| |
s860167706 | p02555 | u364693468 | 1600356761 | Python | PyPy3 (7.3.0) | py | Runtime Error | 140 | 78640 | 988 | import bisect, collections, copy, heapq, itertools, math, string
import sys
def I(): return int(sys.stdin.readline().rstrip())
def MI(): return map(int, sys.stdin.readline().rstrip().split())
def LI(): return list(map(int, sys.stdin.readline().rstrip().split()))
def S(): return sys.stdin.readline().rstrip()
def LS(): r... | Traceback (most recent call last):
File "/tmp/tmpkcelrgui/tmpcx0nj90b.py", line 29, in <module>
main()
File "/tmp/tmpkcelrgui/tmpcx0nj90b.py", line 19, in main
S = I()
^^^
File "/tmp/tmpkcelrgui/tmpcx0nj90b.py", line 3, in I
def I(): return int(sys.stdin.readline().rstrip())
... | |
s389321059 | p02555 | u182166469 | 1600349922 | Python | Python (3.8.2) | py | Runtime Error | 83 | 9168 | 304 | import math
def combination(n,r):
return math.factorial(n+r) / (math.factorial(n)*math.factorial(r))
s=int(input())
if s==0 or s==1 or s==2:
print(0)
else:
p=int(s/3)
sum=0
for i in range(p):
distribute=s-3*(i+1)
sum+=combination(distribute,i)
sum=int(sum)%(10**9+7)
print(sum) | Traceback (most recent call last):
File "/tmp/tmpwzuy5fyp/tmp_uz4podl.py", line 5, in <module>
s=int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s939011005 | p02555 | u182166469 | 1600349666 | Python | Python (3.8.2) | py | Runtime Error | 85 | 9168 | 264 | import math
s=int(input())
if s==0 or s==1 or s==2:
print(0)
else:
p=int(s/3)
sum=0
for i in range(p):
distribute=s-3*(i+1)
sum+=math.factorial(distribute+i) / (math.factorial(distribute)*math.factorial(i))
sum=int(sum)%(10**9+7)
print(sum) | Traceback (most recent call last):
File "/tmp/tmpz82m1u6s/tmp93h69sb_.py", line 2, in <module>
s=int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s042862031 | p02555 | u182166469 | 1600349396 | Python | Python (3.8.2) | py | Runtime Error | 84 | 9148 | 252 | import math
s=int(input())
if s==0 or s==1 or s==2:
print(0)
else:
p=int(s/3)
sum=0
for i in range(p):
distribute=s-3*(i+1)
sum+=math.factorial(distribute+i) / (math.factorial(distribute)*math.factorial(i))
print(int(sum)%(10**9+7)) | Traceback (most recent call last):
File "/tmp/tmp5hw8jns3/tmpkro2g_ar.py", line 2, in <module>
s=int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s688813833 | p02555 | u182166469 | 1600349329 | Python | Python (3.8.2) | py | Runtime Error | 81 | 8972 | 242 | import math
s=int(input())
if s==0 or s==1 or s==2:
print(0)
else:
p=int(s/3)
sum=0
for i in range(p):
distribute=s-3*(i+1)
sum+=math.factorial(distribute+i) / (math.factorial(distribute)*math.factorial(i))
print(int(sum)) | Traceback (most recent call last):
File "/tmp/tmpfij76qxb/tmpydvy2dge.py", line 2, in <module>
s=int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s018669169 | p02555 | u536230475 | 1600344177 | Python | PyPy3 (7.3.0) | py | Runtime Error | 97 | 77616 | 465 | import os
import sys
import math
import heapq
from decimal import *
from io import BytesIO, IOBase
from collections import defaultdict, deque
def r():
return int(input())
def rm():
return map(int,input().split())
def rl():
return list(map(int,input().split()))
'''D Redistribution'''
mod=10**9+7
n = r()
an... | Traceback (most recent call last):
File "/tmp/tmpncmpkw7w/tmpmyrzqg5d.py", line 18, in <module>
n = r()
^^^
File "/tmp/tmpncmpkw7w/tmpmyrzqg5d.py", line 10, in r
return int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s120119415 | p02555 | u663404111 | 1600296077 | Python | Python (3.8.2) | py | Runtime Error | 60 | 9144 | 300 | S = int(input())
N = S//3
ans = 0
if N == 0:
ans = 0
else:
for l in range(N):
n = S - 2*l - 3
p = 1
if l == 0:
ans += 1
else:
for i in range(l):
p *= (n - i) / (i + 1)
ans += p % 10**9 + 7
ans %= 10**9 + 7
print(int(ans)) | Traceback (most recent call last):
File "/tmp/tmp07m4wg5h/tmpq7h37g3p.py", line 1, in <module>
S = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s017005119 | p02555 | u663404111 | 1600295929 | Python | Python (3.8.2) | py | Runtime Error | 26 | 9024 | 290 | S = int(input())
N = S//3
ans = 0
if N == 0:
continue
else:
for l in range(N):
n = S - 2*l - 3
p = 1
if l == 0:
ans += 1
else:
for i in range(l):
p *= (n - i) / i % (10**9 + 7)
ans += p
ans %= 10**9+7
print(ans) | File "/tmp/tmp9goufbn4/tmp5t48tuvx.py", line 5
continue
^^^^^^^^
SyntaxError: 'continue' not properly in loop
| |
s975859870 | p02555 | u663404111 | 1600295861 | Python | Python (3.8.2) | py | Runtime Error | 26 | 9004 | 282 | S = int(input())
N = S//3
if N == 0:
print(0)
else:
for l in range(N):
n = S - 2*l - 3
p = 1
if l == 0:
ans = 1
else:
for i in range(l):
p *= (n - i) / i % (10**9 + 7)
ans += p
ans %= 10**9+7
print(ans) | File "/tmp/tmptunhpd_6/tmpal0phnlw.py", line 1
S = int(input())
IndentationError: unexpected indent
| |
s644574253 | p02555 | u536034761 | 1600274905 | Python | Python (3.8.2) | py | Runtime Error | 28 | 9084 | 181 | S = int(input())
mod = 10 ** 9 + 7
dp = [0 for _ in range(S)]
dp[0] = dp[1] = 0
dp[2] = dp[3] = 1
for i in range(3, S):
dp[i] = (dp[i - 3] + dp[i - 1]) % mod
print(dp[-1]) | Traceback (most recent call last):
File "/tmp/tmpwgrdh680/tmpnvz3anhx.py", line 1, in <module>
S = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s614775522 | p02555 | u536034761 | 1600274752 | Python | Python (3.8.2) | py | Runtime Error | 31 | 9076 | 182 | S = int(input())
mod = 10 ** 9 + 7
dp = [0 for _ in range(S)]
dp[0] = dp[1] = 0
dp[2] = dp[3] = 0
for i in range(S - 3):
dp[i + 3] = (dp[i] + dp[i + 2]) % mod
print(dp[-1]) | Traceback (most recent call last):
File "/tmp/tmp2jjgpyw9/tmpzosp1_xk.py", line 1, in <module>
S = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s451724030 | p02555 | u536034761 | 1600273882 | Python | Python (3.8.2) | py | Runtime Error | 32 | 9920 | 233 | from functools import lru_cache
@lru_cache(maxsize=None)
def dp(i):
if i == 1 or i == 2:
return 0
elif i == 3 or i == 4:
return 1
else:
return dp(i - 3) + dp(i - 1)
S = int(input())
print(dp(S))
| Traceback (most recent call last):
File "/tmp/tmpeld506ks/tmp7feqgnxy.py", line 12, in <module>
S = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s022302678 | p02555 | u536034761 | 1600273761 | Python | Python (3.8.2) | py | Runtime Error | 31 | 9116 | 176 | def dp(i):
if i == 1 or i == 2:
return 0
elif i == 3 or i == 4:
return 1
else:
return dp[i - 3] + dp[i - 1]
S = int(input())
print(dp(S))
| Traceback (most recent call last):
File "/tmp/tmpv05bigg_/tmp8yydj5ls.py", line 10, in <module>
S = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s956903166 | p02555 | u536034761 | 1600271189 | Python | Python (3.8.2) | py | Runtime Error | 24 | 8968 | 450 | import math
#n個からr個とるときの組み合わせの数
def combinations_count(n, r):
return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))
S = int(input())
ans = 0
mod = 10 ** 9 + 7
for i in range(1,S // 3 + 1): #長さiの数列のとき
x = S - 3 * i #3を分配後の余り
ans += (combinations_count(x + i - 1, i - 1))... | File "/tmp/tmp2dxv08ln/tmpwba_mzig.py", line 13
ans += (combinations_count(x + i - 1, i - 1)) % mod #重複組み合わせを足す
^
SyntaxError: invalid non-printable character U+3000
| |
s811647091 | p02555 | u132978996 | 1600267850 | Python | Python (3.8.2) | py | Runtime Error | 23 | 8860 | 3056 |
#include <bits/stdc++.h>
#define FIXED_FLOAT(x) std::fixed <<std::setprecision(7)<<(x)
#define all(v) (v).begin(), (v).end()
using namespace std;
#define loop(i,a,b) for (int i=a; i<b; ++i)
using ll = long long;
const int mod = 1e9 + 7;
typedef pair<int , int> pairs;
typedef complex<ll> G;
const int N = 1e3 + 10;
... | File "/tmp/tmpctcumtlz/tmpmwv9v6n0.py", line 18
c=(1LL*c*c)%mod;
^
SyntaxError: invalid decimal literal
| |
s816997456 | p02555 | u694665829 | 1600265645 | Python | Python (3.8.2) | py | Runtime Error | 29 | 9184 | 118 | s = int(input())
a = [0]*2001
a[3] = 1
for i in range(4,n+1):
a[i] = a[i-3] + a[i-1]
mod = 10**9+7
print(a[s]%mod) | Traceback (most recent call last):
File "/tmp/tmp6yet3ful/tmplddm34qm.py", line 1, in <module>
s = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s993440149 | p02555 | u785697410 | 1600265116 | Python | PyPy3 (7.3.0) | py | Runtime Error | 95 | 74692 | 1384 | import sys
#from collections import deque
#from functools import *
#from fractions import Fraction as f
from copy import *
from bisect import *
#from heapq import *
#from math import ceil
#from itertools import permutations ,product
def eprint(*args):
print(*args, file=sys.stderr)
zz=1
#sys.setrecursionlimit(1... | Traceback (most recent call last):
File "/tmp/tmpnkwf187g/tmpvj3m2x1e.py", line 61, in <module>
s=fi()
^^^^
File "/tmp/tmpnkwf187g/tmpvj3m2x1e.py", line 37, in fi
return int(input())
^^^^^^^^^^^^
ValueError: invalid literal for int() with base 10: ''
| |
s907798995 | p02555 | u785697410 | 1600265076 | Python | PyPy3 (7.3.0) | py | Runtime Error | 89 | 74224 | 1384 | import sys
#from collections import deque
#from functools import *
#from fractions import Fraction as f
from copy import *
from bisect import *
#from heapq import *
#from math import ceil
#from itertools import permutations ,product
def eprint(*args):
print(*args, file=sys.stderr)
zz=1
#sys.setrecursionlimit(1... | Traceback (most recent call last):
File "/tmp/tmpi6s4fj1_/tmp8ppn0bua.py", line 61, in <module>
s=fi()
^^^^
File "/tmp/tmpi6s4fj1_/tmp8ppn0bua.py", line 37, in fi
return int(input())
^^^^^^^^^^^^
ValueError: invalid literal for int() with base 10: ''
| |
s780904303 | p02555 | u869519920 | 1600261894 | Python | Python (3.8.2) | py | Runtime Error | 27 | 9188 | 112 | S=int(input())
a = [0]*(S+1)
a[3]=1
for i in range(4, S+1):
a[i] = a[i-3] + a[i-1]
mod=10**9+7
print(a[S]%mod) | Traceback (most recent call last):
File "/tmp/tmpqcmpa2_c/tmpxog5rbqo.py", line 1, in <module>
S=int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s870273953 | p02555 | u237935782 | 1600251596 | Python | Python (3.8.2) | py | Runtime Error | 28 | 9304 | 169 | S = int(input())
A = [0,0,1]
if S == 1 or S == 2:
print(0)
elif S == 3:
print(1)
else:
for i in range(3,S):
A += [A[i-1] + A[i-3]]
print(A[i] % (10 ** 9 + 7)) | Traceback (most recent call last):
File "/tmp/tmp3j_3chjx/tmp18o2sgq3.py", line 1, in <module>
S = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s943342807 | p02555 | u237935782 | 1600251471 | Python | Python (3.8.2) | py | Runtime Error | 31 | 9156 | 103 | S = int(input())
A = [0,0,1]
for i in range(3,S):
A += [A[i-1] + A[i-3]]
print(A[i] % (10 ** 9 + 7)) | Traceback (most recent call last):
File "/tmp/tmpe6vgombg/tmp1vz1ahho.py", line 1, in <module>
S = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s596621203 | p02555 | u237935782 | 1600251391 | Python | Python (3.8.2) | py | Runtime Error | 29 | 9300 | 101 | S = int(input())
A = [0,0,1]
for i in range(3,S):
A += [A[i-1] + A[i-3]]
print(A[i]%(10 ** 9 + 7)) | Traceback (most recent call last):
File "/tmp/tmp4clqo0ly/tmpvi55js1a.py", line 1, in <module>
S = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s778819298 | p02555 | u661764795 | 1600224148 | Python | PyPy3 (7.3.0) | py | Runtime Error | 121 | 74180 | 191 | S = int(input())
if S == 1:
print(0)
sys.exit()
dp = [0] * (S + 1)
dp[0] = 1
dp[1] = 0
dp[2] = 0
for i in range(3, S + 1):
dp[i] = sum(dp[:i - 2])
print(dp[S] % (10 ** 9 + 7))
| Traceback (most recent call last):
File "/tmp/tmpvicuydt8/tmp039jfwfi.py", line 1, in <module>
S = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s646308185 | p02555 | u661764795 | 1600224039 | Python | PyPy3 (7.3.0) | py | Runtime Error | 126 | 74272 | 151 | S = int(input())
dp = [0] * (S + 1)
dp[0] = 1
dp[1] = 0
dp[2] = 0
for i in range(3, S + 1):
dp[i] = sum(dp[:i - 2])
print(dp[S] % (10 ** 9 + 7))
| Traceback (most recent call last):
File "/tmp/tmp292x8617/tmpftogb7pj.py", line 1, in <module>
S = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s400220506 | p02555 | u033602950 | 1600210088 | Python | Python (3.8.2) | py | Runtime Error | 116 | 27172 | 568 | import sys
#import time
from collections import deque, Counter, defaultdict
#from fractions import gcd
import bisect
import heapq
#import math
import itertools
import numpy as np
input = sys.stdin.readline
sys.setrecursionlimit(10**8)
inf = 10**18
MOD = 1000000007
ri = lambda : int(input())
rs = lambda : input().strip(... | Traceback (most recent call last):
File "/tmp/tmpr8t16jtc/tmpj3kaxsf_.py", line 18, in <module>
s = ri()
^^^^
File "/tmp/tmpr8t16jtc/tmpj3kaxsf_.py", line 14, in <lambda>
ri = lambda : int(input())
^^^^^^^^^^^^
ValueError: invalid literal for int() with base 10: ''
| |
s811366886 | p02555 | u237935782 | 1600192467 | Python | Python (3.8.2) | py | Runtime Error | 27 | 9160 | 87 | S = int(input())
A = [0,0,1]
for i in range(3,S):
A += [A[i-1] + A[i-3]]
print(A[i]) | Traceback (most recent call last):
File "/tmp/tmp4ij8f5ma/tmps_vkwtpr.py", line 1, in <module>
S = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s964722401 | p02555 | u237935782 | 1600191885 | Python | Python (3.8.2) | py | Runtime Error | 2206 | 9396 | 172 | S = int(input())
def retu(n):
if n == 0 or n == 1 or n == 2:
return 0
elif n == 3:
return 1
else:
a = retu(n-1) + retu(n-3)
return a
print(retu(S)) | Traceback (most recent call last):
File "/tmp/tmp2g2co17a/tmp1c6f5wy8.py", line 1, in <module>
S = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s930590541 | p02555 | u033602950 | 1600182909 | Python | Python (3.8.2) | py | Runtime Error | 1398 | 27348 | 634 | import sys
#import time
from collections import deque, Counter, defaultdict
#from fractions import gcd
import bisect
import heapq
#import math
import itertools
import numpy as np
input = sys.stdin.readline
sys.setrecursionlimit(10**8)
inf = 10**18
MOD = 1000000007
ri = lambda : int(input())
rs = lambda : input().strip(... | Traceback (most recent call last):
File "/tmp/tmpmw0qtjws/tmpzg888sr_.py", line 18, in <module>
s = ri()
^^^^
File "/tmp/tmpmw0qtjws/tmpzg888sr_.py", line 14, in <lambda>
ri = lambda : int(input())
^^^^^^^^^^^^
ValueError: invalid literal for int() with base 10: ''
| |
s277831090 | p02555 | u398511319 | 1600182113 | Python | Python (3.8.2) | py | Runtime Error | 29 | 9260 | 209 | N = int(input())
C=[0]*N
C[0]=0
C[1]=0
C[2]=1
n=2
#フィボナッチ数列のイメージ
while True:
n=n+1
C[n]=C[n-1]+C[n-3]
#print(n,C[n])
if n==(N-1):
break
print(C[N-1]%(10**9+7)) | Traceback (most recent call last):
File "/tmp/tmpmjzy7p54/tmpj45qhthu.py", line 1, in <module>
N = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s606070330 | p02555 | u474162944 | 1600175225 | Python | Python (3.8.2) | py | Runtime Error | 124 | 27300 | 496 | import numpy as np
S = int(input())
l = int(S//3)
#print ('l=' + str(l))
Cp = 1
Ci = 1
count = 0
for i in range(l):
r = S - 3*(i+1)
#count = count + c
#c=(r+i)!/r!/i!
#for k in range(i):
# Cp = Cp*(r+i-k)
# Ci = Ci*(k+1)
#c = Cp//Ci
Cp = np.arange(r+1,r+i)
Ci = np.arange(1,i... | Traceback (most recent call last):
File "/tmp/tmpdbpchmwx/tmp1tnyfu02.py", line 3, in <module>
S = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s273596373 | p02555 | u188745744 | 1600170514 | Python | Python (3.8.2) | py | Runtime Error | 27 | 9180 | 124 | N=int(input())
DP=[0]*(N+1)
DP[3]=1
tmp=0
mod=10**9+7
for i in range(4,N+1):
DP[i]=(DP[i-1]+DP[i-3])%mod
print(DP[N]%mod) | Traceback (most recent call last):
File "/tmp/tmp1hntm9xx/tmpa6rvkwi7.py", line 1, in <module>
N=int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s554505399 | p02555 | u944325914 | 1600168653 | Python | Python (3.8.2) | py | Runtime Error | 23 | 9004 | 201 | s=int(input())
if s==1:
print(0)
exit()
mod=10**9+7
dp=[0]*(s+1)
dp[1]=0
dp[2]=0
for i in range(3,s+1):
for j in range(3,i+1):
dp[i]+=(dp[i-j])%mod
dp[i]+=1
print(dp[s]%mod) | File "/tmp/tmpzxt20rer/tmpd45twa0h.py", line 4
exit()
^
SyntaxError: invalid non-printable character U+3000
| |
s079884781 | p02555 | u944325914 | 1600168515 | Python | Python (3.8.2) | py | Runtime Error | 455 | 9088 | 167 | s=int(input())
mod=10**9+7
dp=[0]*(s+1)
dp[1]=0
dp[2]=0
for i in range(3,s+1):
for j in range(3,i+1):
dp[i]+=(dp[i-j])%mod
dp[i]+=1
print(dp[s]%mod)
| Traceback (most recent call last):
File "/tmp/tmp83b563me/tmp0jz9pg8k.py", line 1, in <module>
s=int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s299187486 | p02555 | u150788544 | 1600159308 | Python | Python (3.8.2) | py | Runtime Error | 320 | 9136 | 377 | import sys
n = int(input())
ans = [0]*(n+1) #ans[k]:入力値kでの答え
#初期値3、4、5
ans[3] = 1
ans[4] = 1
ans[5] = 1
if n == 1 or n == 2:
print(0)
sys.exit()
if 3<= n <=5:
print(1)
sys.exit()
for i in range(6,n+1):
start = 3
stop = i-3
s = 1
for j in range(start,stop+1):
s = (s+ans[j]) % (10**9+7)
ans... | Traceback (most recent call last):
File "/tmp/tmpwi4bznin/tmp4hh5irvl.py", line 2, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s229220696 | p02555 | u150788544 | 1600159129 | Python | Python (3.8.2) | py | Runtime Error | 304 | 9132 | 280 | n = int(input())
ans = [0]*(n+1) #ans[k]:入力値kでの答え
#初期値3、4、5
ans[3] = 1
ans[4] = 1
ans[5] = 1
for i in range(6,n+1):
start = 3
stop = i-3
s = 1
for j in range(start,stop+1):
s = (s+ans[j]) % (10**9+7)
ans[i] = s
print(ans[-1]) | Traceback (most recent call last):
File "/tmp/tmpolawupzd/tmpo_dy3qnv.py", line 1, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s108240276 | p02555 | u015767468 | 1600150405 | Python | Python (3.8.2) | py | Runtime Error | 82 | 9208 | 218 | S=int(input())
import math
N=S//3
t=0
if S==1 or S==2:
print (0)
else:
for i in range(1,N+1):
t=t+math.factorial(S-2*i-1)/(math.factorial(i-1)*math.factorial(S-3*i))
i=i+1
print(t%(10**9+7)) | Traceback (most recent call last):
File "/tmp/tmpwem8apw2/tmpwxzg79fj.py", line 1, in <module>
S=int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s731609105 | p02555 | u015767468 | 1600150009 | Python | Python (3.8.2) | py | Runtime Error | 27 | 9148 | 213 | S=int(input())
import math
N=(S-S%3)/3
t=0
if S==1 or S==2:
print (0)
else:
for i in range(1,N+1):
t=t+math.factorial(S-2*i-1)/(math.factorial(i-1)*math.factorial(S-3*i))
i=i+1
print(t) | Traceback (most recent call last):
File "/tmp/tmp5tmk0eq2/tmp8i3cfolq.py", line 1, in <module>
S=int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s818058640 | p02555 | u015767468 | 1600149615 | Python | Python (3.8.2) | py | Runtime Error | 27 | 9036 | 171 | S=int(input())
import math
N=(S-S%3)/3
t=0
for i in range(1,N+1):
t=t+math.factorial(S-2*i-1)/(math.factorial(i-1)*math.factorial(S-3*i))
i=i+1
print (t%(10**9+7)) | Traceback (most recent call last):
File "/tmp/tmpluf1cpzc/tmpcfv6h_ez.py", line 1, in <module>
S=int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s290911478 | p02555 | u903005414 | 1600147165 | Python | Python (3.8.2) | py | Runtime Error | 29 | 9144 | 189 | S = int(input())
MOD = 10**9 + 7
A = [0] * (S + 1)
A[0] = 1
A[1] = 0
A[2] = 0
cumsum = 1
for i in range(3, len(A)):
A[i] = cumsum
cumsum += A[i - 2]
cumsum %= MOD
print(A[-1])
| Traceback (most recent call last):
File "/tmp/tmp87ovf7sv/tmpqvqwrjgc.py", line 1, in <module>
S = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s046617646 | p02555 | u185249212 | 1600131629 | Python | PyPy3 (7.3.0) | py | Runtime Error | 92 | 74680 | 1747 | from __future__ import print_function
import sys
from functools import reduce
input = sys.stdin.readline
def eprint(*args, **kwargs):
print(*args, file=sys.stderr, **kwargs)
return
def solve02():
n = int(input().strip())
L = []
Xmin, Ymin, Xmax, Ymax = (sys.maxsize, sys.maxsize, -100, -100)
... | Traceback (most recent call last):
File "/tmp/tmpmffwkox2/tmp701hj__q.py", line 49, in <module>
main()
File "/tmp/tmpmffwkox2/tmp701hj__q.py", line 45, in main
solve02()
File "/tmp/tmpmffwkox2/tmp701hj__q.py", line 15, in solve02
n = int(input().strip())
^^^^^^^^^^^^^^^^^^^^
ValueError: invali... | |
s468358382 | p02555 | u988402778 | 1600121499 | Python | PyPy3 (7.3.0) | py | Runtime Error | 144 | 78688 | 45008 | def main(sample_file = ''):
""" convenient functions
# for i, a in enumerate(iterable)
# q, mod = divmod(a, b)
# divmod(x, y) returns the tuple (x//y, x%y)
# Higher-order function: reduce(operator.mul, xyz_count, 1)
# manage median(s) using two heapq https://atcoder.jp/contests/abc127/tasks/abc... | Traceback (most recent call last):
File "/tmp/tmp65dgju5j/tmpr3y_p79n.py", line 744, in <module>
main()
File "/tmp/tmp65dgju5j/tmpr3y_p79n.py", line 150, in main
from fractions import gcd
ImportError: cannot import name 'gcd' from 'fractions' (/root/miniconda3/envs/sandbox-runtime/lib/python3.11/fractions.p... | |
s239468194 | p02555 | u174523836 | 1600116184 | Python | Python (3.8.2) | py | Runtime Error | 292 | 9156 | 181 | S = int(input())
DP = [0]*(S+1)
DP[0] = 0
DP[1] = 0
DP[2] = 0
for i in range(3, S + 1):
DP[i] += 1
for j in range(i - 3 + 1):
DP[i] += DP[j]
print(DP[S] % (10 ** 9 + 7))
| Traceback (most recent call last):
File "/tmp/tmpjgalk8c2/tmp95voa74n.py", line 1, in <module>
S = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s156388081 | p02555 | u923662841 | 1600115827 | Python | Python (3.8.2) | py | Runtime Error | 30 | 9864 | 329 | S = int(input())
mod = 10**9+7
def dfs_memo(n):
memo = [0]*(n+1)
memo[3] = 1
def dfs(n):
if n < 3:
return 0
elif memo[n] != 0:
return memo[n]
memo[n] = dfs(n-1)+dfs(n-3)
return memo[n]
return dfs(n)
if S <3:
print(0)
else:
print(dfs_mem... | Traceback (most recent call last):
File "/tmp/tmpf85frikj/tmpoy5f4ne2.py", line 1, in <module>
S = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s958081660 | p02555 | u706330549 | 1600115068 | Python | Python (3.8.2) | py | Runtime Error | 28 | 8920 | 196 | s = int(input())
dp = [0]*(s+1)
MOD = 10**9+7
dp[0] = 1
dp[1] = 0
dp[2] = 0
if s >= 3:
for i in range(3, s+1):
dp[i] = (dp[i-1] + dp[i-3]) % MOD
print(dp[s])
else:
print(0)
| Traceback (most recent call last):
File "/tmp/tmp44xbjedd/tmpp9q5vid8.py", line 1, in <module>
s = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s121103788 | p02555 | u540877546 | 1600109753 | Python | PyPy3 (7.3.0) | py | Runtime Error | 249 | 74468 | 278 | n = int(input())
mod = 10**9+7
dp = [1]*(n+1)
for i in range(3):
dp[i] = 0
for j in range(3, 10):
if j <= n:
dp[j] = 1
for i in range(3, n+1):
for j in range(3, n):
if i+j <= n:
dp[i+j] += dp[i]
dp[i+j] %= mod
print(dp[-1])
| Traceback (most recent call last):
File "/tmp/tmp7d7f26t3/tmpzkup92ip.py", line 1, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s634289366 | p02555 | u540877546 | 1600109727 | Python | PyPy3 (7.3.0) | py | Runtime Error | 92 | 74820 | 278 | n = int(input())
mod = 10**9+7
dp = [1]*(n+1)
for i in range(3):
dp[i] = 0
for j in range(3, 10):
if j <= n:
dp[j] = 1
for i in range(3, n+1):
for j in range(3, n):
if i+j <= n:
dp[i+j] += dp[i]
dp[i+j] %= mod
print(dp[-1])
| Traceback (most recent call last):
File "/tmp/tmp017ct_5h/tmpqudywrja.py", line 1, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s258029428 | p02555 | u699522269 | 1600109035 | Python | Python (3.8.2) | py | Runtime Error | 35 | 9152 | 152 | S = int(input())
dp=[1]+[0 for i in range(S)]
i = 3
k=1000000007
while True:
dp[i]=(dp[i-1]+dp[i-3])%k
if i == S:
print(dp[-1])
break
i+=1 | Traceback (most recent call last):
File "/tmp/tmppkkptpkl/tmpv344vl9u.py", line 1, in <module>
S = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s444708642 | p02555 | u573234244 | 1600108890 | Python | Python (3.8.2) | py | Runtime Error | 24 | 8956 | 694 | from math import factorial
s = int(input())
ans = 0
for i in range(s // 3):
box = i + 1 # 箱の数
ball = s - 3 * box # あらかじめ箱に3こずつ入れたあとの残りの玉の数
# 箱の入れ方が何通りあるか計算。
# 割り算を // ではなく / とするとfloat型の計算となりオーバーフローする可能性がある。
# factorial(s_ + i) // (factorial(s_) * factorial(i))ではなくfactorial(s_ + i) // (factorial... | File "/tmp/tmpi09b9jz_/tmpvql7y4yn.py", line 10
# 箱の入れ方が何通りあるか計算。
^
SyntaxError: invalid non-printable character U+3000
| |
s169007038 | p02555 | u573234244 | 1600108702 | Python | Python (3.8.2) | py | Runtime Error | 30 | 8960 | 678 | from math import factorial
s = int(input())
ans = 0
for i in range(s // 3):
box = i + 1 # 箱の数
ball = s - 3 * box # あらかじめ箱に3こずつ入れたあとの残りの玉の数
# 箱の入れ方が何通りあるか計算。
# 割り算を // ではなく / とするとfloat型の計算となりオーバーフローする可能性がある。
# factorial(s_ + i) // (factorial(s_) * factorial(i))ではなくfactorial(s_ + i) // (factorial... | File "/tmp/tmpt4ir1yn2/tmpbq1y_equ.py", line 10
# 箱の入れ方が何通りあるか計算。
^
SyntaxError: invalid non-printable character U+3000
| |
s335183934 | p02555 | u573234244 | 1600108626 | Python | Python (3.8.2) | py | Runtime Error | 25 | 9016 | 696 | from math import factorial
s = int(input())
ans = 0
for i in range(s // 3):
box = i + 1 # 箱の数
ball = s - 3 * box # あらかじめ箱に3こずつ入れたあとの残りの玉の数
# 箱の入れ方が何通りあるか計算。
# 割り算を // ではなく / とするとfloat型の計算となりオーバーフローする可能性がある。
# factorial(s_ + i) // (factorial(s_) * factorial(i))ではなくfactorial(s_ + i) // (factorial... | File "/tmp/tmp96j_0dw8/tmpo10g0_gu.py", line 10
# 箱の入れ方が何通りあるか計算。
^
SyntaxError: invalid non-printable character U+3000
| |
s323428886 | p02555 | u573234244 | 1600108541 | Python | Python (3.8.2) | py | Runtime Error | 28 | 9016 | 677 | from math import factorial
s = int(input())
ans = 0
for i in range(s // 3):
box = i + 1 # 箱の数
ball = s - 3 * box # あらかじめ箱に3こずつ入れたあとの残りの玉の数
# 箱の入れ方が何通りあるか計算。
# 割り算を // ではなく / とするとfloat型の計算となりオーバーフローする可能性がある。
# factorial(s_ + i) // (factorial(s_) * factorial(i))ではなくfactorial(s_ + i) // (factorial(s... | File "/tmp/tmplj0ju8s1/tmp8p0enp2a.py", line 10
# 箱の入れ方が何通りあるか計算。
^
SyntaxError: invalid non-printable character U+3000
| |
s674504227 | p02555 | u686230543 | 1600108146 | Python | Python (3.8.2) | py | Runtime Error | 28 | 9172 | 341 | s = int(input())
fact = [1] * s
inv = [1] * s
invf = [1] * s
for i in range(2, s):
fact[i] = fact[i-1] * i % mod
inv[i] = -(p // i) * inv[p % i] % mod
invf[i] = invf[i-1] * inv[i] % mod
count = 0
rest = s
for n in range(1, (s + 2) // 3):
rest -= 3
count = (count + inv[rest + n - 1] * invf[rest] * invf[n - 1... | Traceback (most recent call last):
File "/tmp/tmp63240pn4/tmpuuupew75.py", line 1, in <module>
s = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s390908414 | p02555 | u810787773 | 1600107582 | Python | Python (3.8.2) | py | Runtime Error | 212 | 9244 | 227 | def main():
S = int(input())
dp = [0]*(S+1)
dp[0] = 1
dp[1] = 0
dp[2] = 0
for i in range(3,S+1,1):
for j in range(0,i-2,1):
dp[i] += dp[j]
return dp[S]%1000000007
print(main())
| Traceback (most recent call last):
File "/tmp/tmphi0tbi_e/tmpwf5exjab.py", line 13, in <module>
print(main())
^^^^^^
File "/tmp/tmphi0tbi_e/tmpwf5exjab.py", line 2, in main
S = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s869433281 | p02555 | u021019433 | 1600106610 | Python | Python (3.8.2) | py | Runtime Error | 23 | 9016 | 83 | b,c,a=1,M=1e9+7;main(s){for(scanf("%d",&s);s-->2;c=(a+b)%M)a=b,b=c;printf("%d",c);} | File "/tmp/tmp5zrzelqm/tmp0_sod7fy.py", line 1
b,c,a=1,M=1e9+7;main(s){for(scanf("%d",&s);s-->2;c=(a+b)%M)a=b,b=c;printf("%d",c);}
^^^
SyntaxError: invalid syntax. Maybe you meant '==' or ':=' instead of '='?
| |
s367646134 | p02555 | u021019433 | 1600106555 | Python | Python (3.8.2) | py | Runtime Error | 22 | 8856 | 82 | b,c,a=1,M=1e9+7;main(s){for(scanf("%d",&s);s-->2;c=(a+b)%M)a=b,b=c;print("%d",c);} | File "/tmp/tmpkb6v1tkq/tmpx5cicqd1.py", line 1
b,c,a=1,M=1e9+7;main(s){for(scanf("%d",&s);s-->2;c=(a+b)%M)a=b,b=c;print("%d",c);}
^^^
SyntaxError: invalid syntax. Maybe you meant '==' or ':=' instead of '='?
| |
s606419385 | p02555 | u956318161 | 1600103665 | Python | Python (3.8.2) | py | Runtime Error | 30 | 9248 | 274 | s = int(input())
#最後に切った場所がiであるようなパターンの数をdp[i]とする
dp=[0]*(s+1)
dp[0]=1
if s<3:
print("0")
elif 3<=s<6 :
print("1")
for i in range(3,s+1):
dp[i]=dp[i-1]+dp[i-3]
dp.append(dp[i])
score=dp[s]%(10**9+7)
print(score) | Traceback (most recent call last):
File "/tmp/tmpcrdmiflt/tmp89mbe0gv.py", line 1, in <module>
s = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s329208895 | p02555 | u956318161 | 1600103504 | Python | Python (3.8.2) | py | Runtime Error | 32 | 9232 | 247 | s = int(input())
#最後に切った場所がiであるようなパターンの数をdp[i]とする
dp=[0]*(s+1)
dp[0]=1
if s<3:
print("0")
for i in range(3,s+1):
dp[i]=dp[i-1]+dp[i-3]
dp.append(dp[i])
score=dp[s]%(10**9+7)
print(score)
| Traceback (most recent call last):
File "/tmp/tmpfttnspnf/tmpf4bmn0eq.py", line 1, in <module>
s = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s587924179 | p02555 | u956318161 | 1600103421 | Python | Python (3.8.2) | py | Runtime Error | 28 | 9308 | 223 | s = int(input())
#最後に切った場所がiであるようなパターンの数をdp[i]とする
dp=[0]*(s+1)
dp[0]=1
for i in range(3,s+1):
dp[i]=dp[i-1]+dp[i-3]
dp.append(dp[i])
score=dp[s]%(10**9+7)
print(score) | Traceback (most recent call last):
File "/tmp/tmphfz2fnyw/tmp4hz3690r.py", line 1, in <module>
s = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s957327913 | p02555 | u385650604 | 1600096626 | Python | Python (3.8.2) | py | Runtime Error | 30 | 9132 | 355 | import math
N = input()
N = int(N)
x = N / 3
x = int(x)
p = 10 ** 9 + 7
sum = 0
if x == 0:
print(0)
else:
for k in range(x):
y = N - 3*k - 3
l = k
M = y + l
a = math.factorial(l)
b = math.factorial(M)
c = math.factorial(y)
z = b / a / c
z = z % p
sum += z
sum = sum %p
... | Traceback (most recent call last):
File "/tmp/tmpkf__ab35/tmp5fivslj8.py", line 2, in <module>
N = input()
^^^^^^^
EOFError: EOF when reading a line
| |
s646263708 | p02555 | u543000780 | 1600093786 | Python | Python (3.8.2) | py | Runtime Error | 26 | 9528 | 365 | S = int(input())
mod = 10**9+7
memo = [-1]*(S+1)
def redis(s):
if memo[s] != -1:
return memo[s]
else:
if s < 3:
memo[s] = 0
return 0
elif s < 6:
memo[s] = 1
return 1
else:
tmp = 0
for num in range(s):
tmp += (redis(num)*redis(s-num))%mod
memo[s] = tm... | Traceback (most recent call last):
File "/tmp/tmpiche8_xo/tmpbwwfkfgi.py", line 1, in <module>
S = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s991660518 | p02555 | u543000780 | 1600093679 | Python | Python (3.8.2) | py | Runtime Error | 24 | 8844 | 335 | S = int(input())
memo = [-1]*(S+1)
redis(s):
if memo[s] != -1:
return memo[s]
else:
if s < 3:
memo[s] = 0
return 0
elif s < 6:
memo[s] = 1
return 1
else:
tmp = 0
for num in range(s):
tmp += redis(num)*redis(s-num)
memo[s] = tmp
return tmp
print... | File "/tmp/tmp1hlpodub/tmp9qmeh5ok.py", line 3
redis(s):
^
SyntaxError: invalid syntax
| |
s693725798 | p02555 | u987692205 | 1600093314 | Python | Python (3.8.2) | py | Runtime Error | 394 | 9108 | 131 | s=int(input())
mod=10**9+7
dp=[0]*s
for i in range(4,s+1):
for j in range(0,(i-3)+1):
dp[i]+=dp[j]
dp[i]%=mod
print(dp[s])
| Traceback (most recent call last):
File "/tmp/tmpmafa0oyp/tmpzbf6vo7x.py", line 1, in <module>
s=int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s009225638 | p02555 | u987692205 | 1600092941 | Python | Python (3.8.2) | py | Runtime Error | 28 | 9064 | 118 | s=int(input())
mod=10**9+7
dp=[0]*s
dp[0]=1
for i in range(0,s+1):
dp[i]=dp[i-1]+dp[i-3]
dp[i]%=mod
print(dp[s])
| Traceback (most recent call last):
File "/tmp/tmpxrpkjhr6/tmpmv18ftln.py", line 1, in <module>
s=int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s164032622 | p02555 | u740157634 | 1600091699 | Python | Python (3.8.2) | py | Runtime Error | 485 | 9112 | 146 | S = int(input())
mod = 10**9+7
dp = [1]+[0]*(S-1)
for i in range(0, S+1):
for j in range(3, S-2):
dp[i] += dp[j]
print(dp[S]%mod)
| Traceback (most recent call last):
File "/tmp/tmpef5ow2ga/tmpl4hgyu5_.py", line 1, in <module>
S = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s617770116 | p02555 | u411923565 | 1600088844 | Python | PyPy3 (7.3.0) | py | Runtime Error | 90 | 74676 | 287 | # D - Redistribution
S = int(input())
MOD = 10**9+7
# dp[i]: 3 以上の数字で i を作る組み合わせ
dp = [0]*(S+1)
# 初期条件
dp[3],dp[4],dp[5] = 1,1,1
# i を作る組合わせ
for i in range(6,S+1):
dp[i] = dp[i-2] + dp[i-3] + dp[i-4]
ans = (dp[S])%MOD
print(ans) | Traceback (most recent call last):
File "/tmp/tmp2wxq2vy4/tmpzdybnonk.py", line 2, in <module>
S = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s737577345 | p02555 | u547520179 | 1600088289 | Python | Python (3.8.2) | py | Runtime Error | 308 | 9136 | 186 | INF=1000000000+7
s=int(input())
dp=[0]*(s+1);
dp[0]=dp[1]=dp[2]=0
dp[3]=1
for i in range(4,s+1):
temp=1
for j in range(3,i-2):
temp+=dp[j]%INF;
temp%=INF;
dp[i]=temp
print(dp[s])
| Traceback (most recent call last):
File "/tmp/tmpwy6am3cu/tmp5ncu4jy8.py", line 3, in <module>
s=int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s710726845 | p02555 | u955248595 | 1600084883 | Python | Python (3.8.2) | py | Runtime Error | 29 | 9080 | 149 | S = int(input())
DP = [0]*(S+1)
Mod = 10**9+7
DP[0] = 1
DP[1] = 0
DP[2] = 0
for TS in range(3,S+1):
DP[TS] = (DP[TS-1]+DP[TS-3])%Mod
print(DP[S]) | Traceback (most recent call last):
File "/tmp/tmpr_o6lvyw/tmpoeijxg11.py", line 1, in <module>
S = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s624592917 | p02555 | u955248595 | 1600084685 | Python | Python (3.8.2) | py | Runtime Error | 27 | 9188 | 135 | S = int(input())
DP = [0]*(S+1)
DP[0] = 1
DP[1] = 0
DP[2] = 0
for TS in range(3,S+1):
DP[TS] = (DP[TS-1]+DP[TS-3])%Mod
print(DP[S]) | Traceback (most recent call last):
File "/tmp/tmpalxoczap/tmppymfru52.py", line 1, in <module>
S = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s954892777 | p02555 | u478417863 | 1600083416 | Python | Python (3.8.2) | py | Runtime Error | 28 | 9184 | 160 | n=int(input())
mod=10**9+7
a=[0]*(n)
a[0]=0
a[1]=0
a[2]=1
if n<3:
print(0)
else:
for i in range(3,n):
a[i]=(a[i-3]+a[i-1])%mod
print(a[n-1]) | Traceback (most recent call last):
File "/tmp/tmppwneaf_0/tmprg_r21rc.py", line 1, in <module>
n=int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s765552495 | p02555 | u478417863 | 1600083330 | Python | Python (3.8.2) | py | Runtime Error | 26 | 9112 | 156 | n=int(input())
mod=10**9+7
a=[0]*(n)
a[0]=0
a[1]=0
a[2]=1
if n<3:
print(0)
else:
for i in range(3,n):
a[i]=(a[i-3]+a[i-1])%mod
print(a[n-1]) | Traceback (most recent call last):
File "/tmp/tmpg2n0lpq0/tmpd968bgz7.py", line 1, in <module>
n=int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s028651338 | p02555 | u770293614 | 1600081078 | Python | Python (3.8.2) | py | Runtime Error | 26 | 9028 | 483 | MOD=10**9+7
def cmb(n,r):
if n-r < r: r = n-r
if r == 0: return 1
denominator = 1
numerator = 1
for i in range(r):
numerator *= n-i
numerator %= Q
denominator *= i+1
denominator %= Q
return numerator*pow(denominator,... | Traceback (most recent call last):
File "/tmp/tmpjzrt7ox5/tmp007dc1x4.py", line 25, in <module>
main()
File "/tmp/tmpjzrt7ox5/tmp007dc1x4.py", line 16, in main
S=int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s182966090 | p02555 | u270144704 | 1600079986 | Python | PyPy3 (7.3.0) | py | Runtime Error | 84 | 68660 | 383 | s = int(input())
MOD = 10 ** 9 + 7
ans = 0
fact = [0] * 10000
fact[0], fact[1] = 1, 1
for i in range(2, 10000):
fact[i] = (fact[i-1] * i) % MOD
def f(n, r):
return fact[n] * pow(fact[n-r], -1, MOD) * pow(fact[r], -1, MOD)
for i in range(1, s//3+1):
if i == 1:
ans += 1
else:
m = s - i *... | Traceback (most recent call last):
File "/tmp/tmpni4bbxj3/tmplpc18x9k.py", line 1, in <module>
s = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s933774816 | p02555 | u770293614 | 1600079767 | Python | Python (3.8.2) | py | Runtime Error | 25 | 9016 | 889 | #define int long long
const int mod = 1e9+7;
int fact[2020];
int power(int a, int b){
int ans = 1;
while(b){
if (b&1){
ans = (ans*a)%mod;
}
a = (a*a)%mod;
b>>=1;
}
return ans;
}
int inv(int a){
return power(a, mod-2);
}
int ncr(int n, int r){
... | File "/tmp/tmp2qw5yzlz/tmpwdc89i1y.py", line 46
//n-1cr-1
^
SyntaxError: invalid decimal literal
| |
s042276247 | p02555 | u385650604 | 1600079195 | Python | Python (3.8.2) | py | Runtime Error | 25 | 9024 | 286 | import math
N = input()
N = int(N)
x = N / 3
p = 10 **9 + 7
if x == 0:
print(0)
sum = 0
else:
for k in range(x):
y = N - 3 * k
l = k - 1
M = y + l
a = math.factorial(l)
b = math.factorial(M)
c = math.factorial(y)
z = b / a / c
z = z % p
sum += z
print(z)
| File "/tmp/tmp3hawvg9_/tmpsg1mhrqm.py", line 9
else:
^^^^
SyntaxError: invalid syntax
| |
s853832375 | p02555 | u770293614 | 1600078918 | Python | Python (3.8.2) | py | Runtime Error | 27 | 9556 | 271 | S=1729
def f(n):
# single line to find factorial
return 1 if (n==1 or n==0) else n * f(n - 1);
possibles=0
n=10**9+7
biggest_sub=S//3
for i in range(1,biggest_sub+1):
possibles+=f(S-3*i+i-1)/f(i-1)/f(S-3*i)
possibles%=n
n=10**9+7
print(possibles%n) | Traceback (most recent call last):
File "/tmp/tmp_9bqgp_y/tmpgp21p504.py", line 13, in <module>
possibles+=f(S-3*i+i-1)/f(i-1)/f(S-3*i)
^^^^^^^^^^^^
File "/tmp/tmp_9bqgp_y/tmpgp21p504.py", line 6, in f
return 1 if (n==1 or n==0) else n * f(n - 1);
^^^^^... | |
s870781406 | p02555 | u770293614 | 1600078864 | Python | Python (3.8.2) | py | Runtime Error | 25 | 9072 | 287 | S=int(input())
def f(n):
# single line to find factorial
return 1 if (n==1 or n==0) else n * factorial(n - 1);
possibles=0
n=10**9+7
biggest_sub=S//3
for i in range(1,biggest_sub+1):
possibles+=f(S-3*i+i-1)/f(i-1)/f(S-3*i)
possibles%=n
n=10**9+7
print(possibles%n) | Traceback (most recent call last):
File "/tmp/tmprc0sjfnt/tmps6i7fzdy.py", line 1, in <module>
S=int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s694851785 | p02555 | u270144704 | 1600078582 | Python | PyPy3 (7.3.0) | py | Runtime Error | 83 | 74916 | 389 | s = int(input())
MOD = 10 ** 9 + 7
ans = 0
fact = [0] * 4000
fact[0], fact[1] = 1, 1
for i in range(2, 4000):
fact[i] = (fact[i-1] * i) % MOD
def f(n, r):
return (fact[n+(r-1)] * pow(fact[n], -1, MOD) * pow(fact[r-1], -1, MOD))%MOD
for i in range(1, s//3+1):
if i == 1:
ans += 1
else:
m... | Traceback (most recent call last):
File "/tmp/tmpy7tk2a57/tmpju3rcnou.py", line 1, in <module>
s = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s061093526 | p02555 | u770293614 | 1600078547 | Python | Python (3.8.2) | py | Runtime Error | 32 | 9216 | 259 | S=int(input())
def f(n):
# single line to find factorial
return 1 if (n==1 or n==0) else n * factorial(n - 1);
possibles=0
biggest_sub=S//3
for i in range(1,biggest_sub+1):
possibles+=f(S-2*i-1)/f(S-3*i)/f(i-1)
n=10**9+7
print(possibles%n) | Traceback (most recent call last):
File "/tmp/tmp_yqg2ub5/tmp3br62sur.py", line 1, in <module>
S=int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s482633410 | p02555 | u770293614 | 1600078525 | Python | Python (3.8.2) | py | Runtime Error | 26 | 9188 | 258 | S=int(input())
def f(n):
# single line to find factorial
return 1 if (n==1 or n==0) else n * factorial(n - 1);
possibles=0
biggest_sub=S//3
for i in range(1,biggest_sub+1):
possibles=f(S-2*i-1)/f(S-3*i)/f(i-1)
n=10**9+7
print(possibles%n) | Traceback (most recent call last):
File "/tmp/tmpc4nvleb7/tmp4kzrxgq_.py", line 1, in <module>
S=int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s776222938 | p02555 | u270144704 | 1600078521 | Python | PyPy3 (7.3.0) | py | Runtime Error | 85 | 75184 | 389 | s = int(input())
MOD = 10 ** 9 + 7
ans = 0
fact = [0] * 4000
fact[0], fact[1] = 1, 1
for i in range(2, 4000):
fact[i] = (fact[i-1] * i) % MOD
def f(n, r):
return (fact[n+(r-1)] * pow(fact[n], -1, MOD) * pow(fact[i-1], -1, MOD))%MOD
for i in range(1, s//3+1):
if i == 1:
ans += 1
else:
m... | Traceback (most recent call last):
File "/tmp/tmp3fmxjj6t/tmpnxx2ozt1.py", line 1, in <module>
s = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s667481821 | p02555 | u270144704 | 1600078192 | Python | PyPy3 (7.3.0) | py | Runtime Error | 84 | 74896 | 389 | s = int(input())
MOD = 10 ** 9 + 7
ans = 0
fact = [0] * 2001
fact[0], fact[1] = 1, 1
for i in range(2, 2001):
fact[i] = (fact[i-1] * i) % MOD
def f(n, r):
return (fact[n+(r-1)] * pow(fact[n], -1, MOD) * pow(fact[i-1], -1, MOD))%MOD
for i in range(1, s//3+1):
if i == 1:
ans += 1
else:
m... | Traceback (most recent call last):
File "/tmp/tmp3glza4i2/tmp3vcs1l19.py", line 1, in <module>
s = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s801356446 | p02555 | u770293614 | 1600072814 | Python | Python (3.8.2) | py | Runtime Error | 27 | 9120 | 274 | S=int(input())
def f(n):
# single line to find factorial
return 1 if (n==1 or n==0) else n * factorial(n - 1);
possibles=0
biggest_sub=S//3
for i in range(1,biggest_sub+1):
possibles=f(biggest_sub-3*i)/f(r)/f(biggest_sub-4*r)
n=10**9+7
print(possibles%n) | Traceback (most recent call last):
File "/tmp/tmp2f8va9jr/tmpi2ckajr9.py", line 1, in <module>
S=int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s097669009 | p02555 | u770293614 | 1600072466 | Python | Python (3.8.2) | py | Runtime Error | 26 | 9120 | 275 | S=int(input())
def f(n):
# single line to find factorial
return 1 if (n==1 or n==0) else n * factorial(n - 1);
possibles=0
biggest_sub=S//3
for i in range(1,biggest_sub+1):
left=S-3*i
possibles+=(f(left+i-1)/(f(i-1)*f(left)))
n=10**9+7
print(possibles%n) | Traceback (most recent call last):
File "/tmp/tmp0vw1l7zp/tmp1_xnszq3.py", line 1, in <module>
S=int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s543584976 | p02555 | u770293614 | 1600072300 | Python | Python (3.8.2) | py | Runtime Error | 27 | 8980 | 273 | S=int(input())
def f(n):
# single line to find factorial
return 1 if (n==1 or n==0) else n * factorial(n - 1);
possibles=1
biggest_sub=S//3
for i in range(2,biggest_sub+1):
left=S-3*i
possibles+=(f(left+i-1)/f(i-1)/f(left))
n=10**9+7
print(possibles%n) | Traceback (most recent call last):
File "/tmp/tmp6dmm5w29/tmpyqhtxo3o.py", line 1, in <module>
S=int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s090260011 | p02555 | u770293614 | 1600072263 | Python | Python (3.8.2) | py | Runtime Error | 28 | 9044 | 276 | S=int(input())
def f(n):
# single line to find factorial
return 1 if (n==1 or n==0) else n * factorial(n - 1);
possibles=0
biggest_sub=S//3
for i in range(1,biggest_sub+1):
left=S-3*i
possibles+=(f(left+i-1)/f(i-1)/f(left))
n=10**9+7
print(possibles%n) | Traceback (most recent call last):
File "/tmp/tmp2ylsso02/tmpsp7t83b2.py", line 1, in <module>
S=int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s915379274 | p02555 | u770293614 | 1600072067 | Python | Python (3.8.2) | py | Runtime Error | 26 | 9232 | 283 | S=int(input())
def f(n):
fact = 1
for i in range(1,n+1):
fact = fact * i
return fact
def nCr(n,r):
return f(n) / f(r) / f(n-r)
possibles=0
biggest_sub=S//3
for i in range(1,biggest_sub+1):
left=S-3*i
possibles+=nCr(left+i-1,i-1)
n=10**9+7
print(possibles%n) | Traceback (most recent call last):
File "/tmp/tmppc9ubocs/tmpsernf7b7.py", line 1, in <module>
S=int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s680333199 | p02555 | u770293614 | 1600072046 | Python | Python (3.8.2) | py | Runtime Error | 24 | 8684 | 284 | S=int(input())
def f(n):
fact = 1
for i in range(1,n+1):
fact = fact * i
return fact
def nCr(n,r):
return f(n) / f(r) / f(n-r)
possibles=0
biggest_sub=S//3
for i in range(1,biggest_sub+1):
left=S-3*i
possibles+=nCr(left+i-1,i-1)
n=10**9+7
print(possibles%n) | File "/tmp/tmpbm_u08es/tmpj3wcaup2.py", line 8
return fact
^
IndentationError: unindent does not match any outer indentation level
| |
s966439365 | p02555 | u770293614 | 1600071924 | Python | Python (3.8.2) | py | Runtime Error | 25 | 9116 | 230 | S=int(input())
import math
def nCr(n,r):
f = math.factorial
return f(n) / f(r) / f(n-r)
possibles=0
biggest_sub=S//3
for i in range(1,biggest_sub+1):
left=S-3*i
possibles+=nCr(left+i-1,i-1)
n=10**9+7
print(possibles%n) | Traceback (most recent call last):
File "/tmp/tmppuxspe_s/tmpdn2y1cw9.py", line 1, in <module>
S=int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s984487944 | p02555 | u729133443 | 1600071849 | Python | Python (3.8.2) | py | Runtime Error | 54 | 22480 | 64 | a,b,c=1,0,0
exec('a,b,c=b,c,a+c;'*int(input()))
print(a%(1e9+7)) | Traceback (most recent call last):
File "/tmp/tmpu0_lnm6k/tmpf6v6ad4w.py", line 2, in <module>
exec('a,b,c=b,c,a+c;'*int(input()))
^^^^^^^
EOFError: EOF when reading a line
| |
s924472156 | p02555 | u770293614 | 1600071794 | Python | Python (3.8.2) | py | Runtime Error | 30 | 9120 | 230 | S=int(input())
import math
def nCr(n,r):
f = math.factorial
return f(n) / f(r) / f(n-r)
possibles=1
biggest_sub=S//3
for i in range(2,biggest_sub+1):
left=S-3*i
possibles+=nCr(left+i-1,i-1)
n=10**9+7
print(possibles%n) | Traceback (most recent call last):
File "/tmp/tmpbuhy9w61/tmp4s9w8_6r.py", line 1, in <module>
S=int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s553081830 | p02555 | u770293614 | 1600071701 | Python | Python (3.8.2) | py | Runtime Error | 29 | 8848 | 218 | S=int(input())
import math
def nCr(n,r):
f = math.factorial
return f(n) / f(r) / f(n-r)
possibles=1
biggest_sub=S//3
for i in range(2,biggest_sub+1):
left=S-3*i
possibles+=nCr(left+i-1,i-1)
print(possibles) | Traceback (most recent call last):
File "/tmp/tmp8sylw_eg/tmp29i7ibzf.py", line 1, in <module>
S=int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s822843186 | p02555 | u688839540 | 1600069914 | Python | Python (3.8.2) | py | Runtime Error | 81 | 9344 | 209 | def f(n):
if n <= 1:
return 1
return f(n-1)*n
def h(n,m):
return f(n+m-1)//f(n)//f(m-1)
s=int(input())
res = 0
pair = s//3
for i in range(1,pair+1):
res += h(s-3*i,i)
print(res%(10**9+7)) | Traceback (most recent call last):
File "/tmp/tmpp4ipju5y/tmph9ehdhoe.py", line 9, in <module>
s=int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s213495346 | p02555 | u688839540 | 1600069213 | Python | Python (3.8.2) | py | Runtime Error | 59 | 9632 | 195 | def f(n):
if n <= 1:
return 1
return f(n-1)*n
def h(n,m):
return f(n+m-1)/f(n)/f(m-1)
s=int(input())
res = 0
pair = s//3
for i in range(1,pair+1):
res += h(s-3*i,i)
print(res)
| Traceback (most recent call last):
File "/tmp/tmpc0n75s38/tmpj_2j6dwu.py", line 9, in <module>
s=int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s577101964 | p02555 | u011220523 | 1600064720 | Python | Python (3.8.2) | py | Runtime Error | 25 | 8944 | 4903 | #ifdef mmlang_source_11_lines
S = inputInt()
@memo(size=2005)
def func(x) -> int:
if x<3:
return 0
ret = 1
ret += func(x-(3:x-3+1)) mod 1e9+7
return ret
print(func(S))
#endif
//#define NDEBUG
#include <cassert>
#include <vector>
#include <deque>
#include <string>
#include <map>
#include <q... | File "/tmp/tmpifh4h829/tmp2trcm93x.py", line 10
ret += func(x-(3:x-3+1)) mod 1e9+7
^
SyntaxError: invalid syntax
| |
s347557312 | p02555 | u583285098 | 1600063334 | Python | Python (3.8.2) | py | Runtime Error | 52 | 9104 | 342 | import math
s = int(input())
if s <= 2:
print(0)
exit()
ans = 1
mod = 10**9+7
def c(_n, _r):
child = math.prod([_i+1 for _i in range(_n-_r, _n)])
mother = math.factorial(_r)
return int(child/mother)
for i in range(2, (s // 3) + 1):
n = s - i * 3
r = i - 1
ans += c(n + r, r)
ans %... | Traceback (most recent call last):
File "/tmp/tmp9mk7r15o/tmpfvfnghhk.py", line 2, in <module>
s = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s199574074 | p02555 | u583285098 | 1600061932 | Python | Python (3.8.2) | py | Runtime Error | 87 | 9196 | 291 | import math
s = int(input())
if s <= 2:
print(0)
exit()
ans = 1
mod = 10**9+7
def c(_n, _r):
return math.factorial(_n) / (math.factorial(_r) * math.factorial(_n - _r))
for i in range(2, (s//3)+1):
n = s-i*3
r = i-1
ans += c(n+r, r)
ans %= mod
print(int(ans))
| Traceback (most recent call last):
File "/tmp/tmpp97au3zq/tmparjukk4o.py", line 2, in <module>
s = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s804122656 | p02555 | u773081031 | 1600061783 | Python | Python (3.8.2) | py | Runtime Error | 26 | 8832 | 102 | n = int(input())
s = [s[i-1] + s[i-3] if i>2 elif i<2 0 elif i==2 1 for i in range(n)]
print(s[n-1])
| File "/tmp/tmptx8ctelv/tmphpvzmudn.py", line 2
s = [s[i-1] + s[i-3] if i>2 elif i<2 0 elif i==2 1 for i in range(n)]
^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: expected 'else' after 'if' expression
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.