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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
s687273539 | p02555 | u573234244 | 1600028473 | Python | Python (3.8.2) | py | Runtime Error | 191 | 42332 | 261 | s = int(input())
from scipy.special import comb
ans = 0
for i in range(x):
Box = i + 1
Nokori = s - 3 * Box
ans_ = comb(Nokori + Box - 1, Nokori, exact=True) % (10 ** 9 + 7)
ans += ans_
#ans = ans % (10 ** 9 + 7)
print(ans % (10 ** 9 + 7)) | Traceback (most recent call last):
File "/tmp/tmps470uvo9/tmpvgavrs5l.py", line 1, in <module>
s = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s884198204 | p02555 | u801576633 | 1600028454 | Python | PyPy3 (7.3.0) | py | Runtime Error | 342 | 128344 | 617 | N=int(input())
sp=[[-1 for i in range(2000)] for j in range(2000)]
mod=10**9+7
def spnum(n, l):
global sp
if sp[n][l] != -1:
return sp[n][l]
if n==l:
sp[n][l]=1
return 1
if n-l < 3:
sp[n][l]=0
return 0
if n-l == 3:
sp[n][l]=1
return 1
i... | Traceback (most recent call last):
File "/tmp/tmphsz2j_yc/tmptfbmyqkf.py", line 1, in <module>
N=int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s951648478 | p02555 | u951289777 | 1600028429 | Python | Python (3.8.2) | py | Runtime Error | 239 | 42400 | 293 | from scipy.special import comb
s = int(input())
if s < 3:
print(0)
else:
count = 0
total = 0
while True:
s = s-3
count += 1
if s >= 0:
total += comb(s+count-1, count-1)
else:
break
print(int(total % (10**9+7)))
| Traceback (most recent call last):
File "/tmp/tmpafd6_4bc/tmp6sxp3yio.py", line 4, in <module>
s = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s020150564 | p02555 | u905029819 | 1600028317 | Python | Python (3.8.2) | py | Runtime Error | 85 | 9188 | 259 | import math
S = int(input())
divider = 10**9 + 7
sum = 0
if S > 5:
for i in range(1, S//3 + 1):
sum += math.factorial(S-2*i-1) / (math.factorial(S-3*i) * math.factorial(i-1))
print(int(sum % divider))
elif 3 <= S <= 5 :
print(1)
else:
print(0) | Traceback (most recent call last):
File "/tmp/tmp7xkftb47/tmpztq78v5q.py", line 3, in <module>
S = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s030639159 | p02555 | u905029819 | 1600028296 | Python | Python (3.8.2) | py | Runtime Error | 81 | 9216 | 254 | import math
S = int(input())
divider = 10**9 + 7
sum = 0
if S > 5:
for i in range(1, S//3 + 1):
sum += math.factorial(S-2*i-1) / (math.factorial(S-3*i) * math.factorial(i-1))
print(sum % divider)
elif 3 <= S <= 5 :
print(1)
else:
print(0) | Traceback (most recent call last):
File "/tmp/tmp3ng5s5ak/tmpcs2a3ca3.py", line 3, in <module>
S = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s581069325 | p02555 | u809495242 | 1600028287 | Python | Python (3.8.2) | py | Runtime Error | 26 | 9192 | 286 | S = int(input())
from math import factorial
ans = 0
m = S // 3 #最大桁数
print(m)
for p in range(1,m+1):
x = S - 3*(p) #p桁 自由度x
a = factorial(x+p-1)
b = factorial(p-1)
c = factorial(x)
ans += ( a / b / c )%(10**9+7)
print(int((ans)%(10**9+7)))
| Traceback (most recent call last):
File "/tmp/tmplytxo3ov/tmp61r9767y.py", line 1, in <module>
S = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s632577494 | p02555 | u137346245 | 1600028261 | Python | Python (3.8.2) | py | Runtime Error | 85 | 9064 | 290 | import math
N = int(input())
a = 1
k = 1
s = 1
o = 5
b = N // 3
for i in range (b - 1):
u = int(math.factorial(N-o))
k = int(math.factorial(N - o - a))
p = int(math.factorial(a))
a = a + 1
s = s + u / (k * p)
o = o + 2
if N < 3:
s = 0
print(int(s) % 1000000007)
| Traceback (most recent call last):
File "/tmp/tmpuufrdghv/tmp_ev8ze97.py", line 2, in <module>
N = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s072842101 | p02555 | u905029819 | 1600028250 | Python | Python (3.8.2) | py | Runtime Error | 86 | 9212 | 255 | import math
S = int(input())
divider = 10**9 + 7
sum = 0
if S > 5:
for i in range(1, S//3):
sum += math.factorial(S-2*i-1) / (math.factorial(S-3*i) * math.factorial(i-1))
print(int(sum % divider))
elif 3 <= S <= 5 :
print(1)
else:
print(0) | Traceback (most recent call last):
File "/tmp/tmpnzt7ps8e/tmp1oyr50fx.py", line 3, in <module>
S = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s728971010 | p02555 | u237380198 | 1600028243 | Python | Python (3.8.2) | py | Runtime Error | 27 | 9124 | 244 | s = int(input())
maxcount = int(s / 3)
amari = s % 3
count = 0
if amari == 0 and maxcount > 0:
count = 1
for i in range(maxcount):
amari = s - (i + 1) * 3
count += comb(amari + i, i, exact=True)
count %= 1000000007
print(count) | Traceback (most recent call last):
File "/tmp/tmpx56_34hx/tmpd2_mdb_f.py", line 1, in <module>
s = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s657204530 | p02555 | u002765126 | 1600028233 | Python | PyPy3 (7.3.0) | py | Runtime Error | 82 | 68796 | 230 | import sys
input = sys.stdin.readline
n=int(input())
X=[]
Y=[]
#P=np.ndarray((0,2))
for i in range(n):
x,y = map(int,input().split())
X.append(x+y)
Y.append(x-y)
ans = max(max(X)-min(X),max(Y)-min(Y))
print(ans) | Traceback (most recent call last):
File "/tmp/tmpp74rnqdd/tmpu4c96_0k.py", line 3, in <module>
n=int(input())
^^^^^^^^^^^^
ValueError: invalid literal for int() with base 10: ''
| |
s108918104 | p02555 | u024568043 | 1600028204 | Python | Python (3.8.2) | py | Runtime Error | 85 | 9496 | 204 | import math
def calc(n, d):
if (n == 0):
return 0
return calc(n-1, d+3) + math.factorial(n-1+d)/(math.factorial(n-1)*math.factorial(d))
S = int(input())
print(int(calc(int(S/3), S%3)%(10**9+7))) | Traceback (most recent call last):
File "/tmp/tmplf3plk4h/tmpxw6saurv.py", line 6, in <module>
S = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s821765955 | p02555 | u842033632 | 1600028198 | Python | Python (3.8.2) | py | Runtime Error | 266 | 42508 | 215 | from scipy.special import comb
S = int(input())
slen = int(S/3)
Ans = 0
for i in range(1,slen+1):
szan = S - 3*i
c = int(comb(szan+i-1,szan))
# print(szan, szan+i-1,c)
Ans += c
print((Ans%(10**9+7))) | Traceback (most recent call last):
File "/tmp/tmp_06am546/tmp9im0ciip.py", line 2, in <module>
S = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s430853231 | p02555 | u137346245 | 1600028183 | Python | Python (3.8.2) | py | Runtime Error | 89 | 9080 | 312 | import math
N = int(input())
a = 1
k = 1
s = 1
o = 5
b = N // 3
for i in range (b - 1):
u = int(math.factorial(N-o))
k = int(math.factorial(N - o - a))
p = int(math.factorial(a))
a = a + 1
print(u / (k * p))
s = s + u / (k * p)
o = o + 2
if N < 3:
s = 0
print(int(s) % 1000000007) | Traceback (most recent call last):
File "/tmp/tmp062nyy4x/tmp355arks8.py", line 2, in <module>
N = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s438961491 | p02555 | u567225946 | 1600028181 | Python | PyPy3 (7.3.0) | py | Runtime Error | 133 | 68544 | 153 | mod=10**9+7
s=int(input())
dp=[1]*(s+1)
dp[0]=0
dp[2]=0
dp[1]=0
for i in range(3,s+1):
for j in range(3,i-2):
dp[i]+=dp[j]
print(dp[s]%mod)
| Traceback (most recent call last):
File "/tmp/tmp9k21_yyn/tmpf7gt24f_.py", line 2, in <module>
s=int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s752778437 | p02555 | u455354923 | 1600028109 | Python | PyPy3 (7.3.0) | py | Runtime Error | 173 | 79608 | 332 | import math
S=int(input())
n=S//3
ans = 0
for i in range(1,n+1):
x = S-(i*3)
#print("i",i,"x",x)
#print(math.factorial(x+i-1),math.factorial(x),math.factorial(i-1))
ans += math.factorial(x+i-1)/(math.factorial(x)*math.factorial(i-1))
#print(ans)
print(int((ans%((10**9)+7))))
#print("ans",int(ans%((... | Traceback (most recent call last):
File "/tmp/tmpu3cfsux9/tmp6a_oatz4.py", line 2, in <module>
S=int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s416902020 | p02555 | u931394483 | 1600028104 | Python | Python (3.8.2) | py | Runtime Error | 122 | 9148 | 352 | import math
s = int(input())
if s < 6:
print("0")
else:
bar = (s // 3) - 1
ans = 0
for i in range(bar+1):
if i == 0:
ans += 1
else:
val = s - 3 * (i+1)
count = math.factorial(val+i) // (math.factorial(val) * math.factorial(i))
ans += count ... | Traceback (most recent call last):
File "/tmp/tmpbnyz4y5z/tmp_ipxkev7.py", line 2, in <module>
s = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s859089506 | p02555 | u905029819 | 1600027990 | Python | Python (3.8.2) | py | Runtime Error | 88 | 9160 | 249 | import math
S = int(input())
divider = 10**9 + 7
sum = 0
if S > 5:
for i in range(1, S//3):
sum += math.factorial(S-2*i-1) / (math.factorial(S-3*i) * math.factorial(i-1))
elif 3 <= S <= 5 :
sum = 1
else:
sum = 0
print(sum % divider) | Traceback (most recent call last):
File "/tmp/tmp7nvx371b/tmpq0wwolk3.py", line 3, in <module>
S = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s412046247 | p02555 | u364555831 | 1600027984 | Python | Python (3.8.2) | py | Runtime Error | 512 | 8848 | 633 | S = int(input())
mod = 10 ** 9 + 7
if S <= 2:
print(0)
exit()
ans = 0
max_items = S // 3
# print("max_items", max_items)
for item in range(1, max_items + 1):
# print("---------------------------")
n = S - 3 * item
modinv_table = [-1] * (n + 1)
modinv_table[1] = 1
for i in range(2, n + 1)... | Traceback (most recent call last):
File "/tmp/tmp0gzdpuh8/tmpti3d7vet.py", line 1, in <module>
S = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s019354696 | p02555 | u729245484 | 1600027919 | Python | Python (3.8.2) | py | Runtime Error | 85 | 9244 | 474 | n = int(input())
maxi = n//3
#print(maxi)
import math
if maxi == 0:
print("0")
elif maxi == 1:
print("1")
else:
ans = 1
for i in range(1,maxi):
#iがbarの数
#i + 1が要素の数
#要素の数のmax = maxi
amari = n - 3*(i+1)
total = math.factorial(i + amari)
bar = math.factorial(i)
ball = math.factoria... | Traceback (most recent call last):
File "/tmp/tmpl6l26frq/tmpdsyuyt03.py", line 1, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s737806793 | p02555 | u097852911 | 1600027852 | Python | Python (3.8.2) | py | Runtime Error | 82 | 9208 | 366 | import math
s = int(input())
def com(a,b):
return math.factorial(a)/(math.factorial(a-b)*math.factorial(b))
maxi = s//3
ans = 0
div = 10**9 + 7
if maxi == 0:
print(0)
else:
for i in range(maxi):
n=1+i
sumation = s-3*n
kosu= com(n-1+sumation,n-1)
ans += kosu
#print("n=",n,"sumation=",sumation,... | Traceback (most recent call last):
File "/tmp/tmp2hlnba_0/tmp08uarzq9.py", line 2, in <module>
s = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s222527872 | p02555 | u184421630 | 1600027847 | Python | Python (3.8.2) | py | Runtime Error | 26 | 9116 | 296 | s = int(input())
if s <= 2:
print(0)
lst = []
counter = 0
for i in range(3, s+1):
lst.append([])
lst[counter].append(i)
if i != s:
lst[counter].append[s - i]
counter += 1
for j in range(len(lst)):
for k in range(len(lst[0])):
if lst[j][k] <= 2:
lst.pop(j)
print(len(lst)) | Traceback (most recent call last):
File "/tmp/tmpl1t9ipo5/tmp_vz80h11.py", line 1, in <module>
s = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s969841406 | p02555 | u905029819 | 1600027824 | Python | Python (3.8.2) | py | Runtime Error | 84 | 9232 | 250 | import math
S = int(input())
divider = 10**9 + 7
sum = 0
if S > 5:
for i in range(1, S//3):
sum += math.factorial(S-2*i-1) / (math.factorial(S-3*i) * math.factorial(i-1))
print(sum % divider)
elif 3 <= S <= 5 :
print(1)
else:
print(0) | Traceback (most recent call last):
File "/tmp/tmp_gcyi6e4/tmpyb88hg4d.py", line 3, in <module>
S = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s012038692 | p02555 | u905029819 | 1600027787 | Python | Python (3.8.2) | py | Runtime Error | 86 | 9232 | 250 | import math
S = int(input())
divider = 10**9 + 7
sum = 0
if S > 5:
for i in range(1, S//3):
sum += math.factorial(S-2*i-1) / (math.factorial(S-3*i) * math.factorial(i-1))
print(sum / divider)
elif 3 <= S <= 5 :
print(1)
else:
print(0) | Traceback (most recent call last):
File "/tmp/tmpcpw69mtf/tmpl1_4p1t3.py", line 3, in <module>
S = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s853987127 | p02555 | u961223096 | 1600027753 | Python | PyPy3 (7.3.0) | py | Runtime Error | 136 | 68604 | 461 | import sys
import numpy as np
def dump(x):
print(x, file=sys.stderr)
MOD = 10**9+7
N = int(input())
arr = np.zeros((N+1,N+1),dtype=int)
for i in range(3,N+1):
arr[0,i] = 1
for i in range(1,N+1):
sum_ = 0
for j in range(3*i,N+1):
sum_ += arr[i-1,j]
sum_ %= MOD
if j+3 >= N + 1... | Traceback (most recent call last):
File "/tmp/tmp6v3ohkb2/tmppin1uurq.py", line 10, in <module>
N = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s368330107 | p02555 | u610042046 | 1600027735 | Python | Python (3.8.2) | py | Runtime Error | 114 | 9168 | 262 | import math
def comb(n, r):
return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))
s = int(input())
a = s//3
if a == 0:
print(0)
else:
m = 10**9+7
cnt = 1
for i in range(2, a+1):
cnt += comb(s-2*i-1, i-1)
print(cnt%m) | Traceback (most recent call last):
File "/tmp/tmpnireygk6/tmp867se4h0.py", line 4, in <module>
s = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s542723789 | p02555 | u905029819 | 1600027684 | Python | Python (3.8.2) | py | Runtime Error | 50 | 9220 | 262 | import math
S = int(input())
divider = 10**9 + 7
sum = 0
if S > 5:
for i in range(1, S//3):
sum += math.factorial(S-2*i-1) / math.factorial(S-3*i) * math.factorial(i-1)
print(sum / divider)
elif 2 < S < 6 :
print(1/divider)
else:
print(0/divider) | Traceback (most recent call last):
File "/tmp/tmpetkt26dz/tmpx26iyd64.py", line 3, in <module>
S = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s572813213 | p02555 | u458412487 | 1600027553 | Python | Python (3.8.2) | py | Runtime Error | 26 | 9112 | 217 | N=int(input())
X=[]
for i in range(N):
array = list(map(int,input().split()))
X.append(array)
D=[]
for i in range(N):
for j in range(N-i):
D.append(abs(X[i][0]-X[j][0])+abs(X[i][1]-X[j][1]))
print(max(D))
| Traceback (most recent call last):
File "/tmp/tmpfgwam3pr/tmpff7eupdy.py", line 1, in <module>
N=int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s011995841 | p02555 | u905029819 | 1600027489 | Python | Python (3.8.2) | py | Runtime Error | 46 | 9200 | 248 | import math
S = int(input())
divider = 10**9 + 7
sum = 0
if S > 5:
for i in range(1, S//3):
sum += math.factorial(S-2*i-1) / math.factorial(S-3*i) * math.factorial(i-1)
print(sum / divider)
elif 3 <= S <= 5 :
print(1)
else:
print(0) | Traceback (most recent call last):
File "/tmp/tmpq1_io_o9/tmpm7mcotp5.py", line 3, in <module>
S = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s498831971 | p02555 | u905029819 | 1600027476 | Python | Python (3.8.2) | py | Runtime Error | 30 | 9028 | 247 | import math
S = int(input())
divider = 10**9 + 7
sum = 0
if S > 5:
for i in range(1, S//3):
sum += math.factorial(S-2*i-1) / math.factorial(S-3*i) * math.factorial(i-1)
print(sum / divider
elif 3 <= S <= 5 :
print(1)
else:
print(0) | File "/tmp/tmphk4c0alu/tmpng_tfw8p.py", line 12
print(sum / divider
^
SyntaxError: '(' was never closed
| |
s644249933 | p02555 | u525589885 | 1600027474 | Python | Python (3.8.2) | py | Runtime Error | 26 | 8868 | 223 | s = int(input())
l = 10**9+7
list_1 = [0, 1, 1, 1]
list_2 = [0, 1, 2]
for i in range(3, s):
list_2.append((list_2[i-1] + list_1[i])%l)
list_1.append(list_2[i-2])
if s = 1 or s = 2:
print(0)
else:
print(list_1[s-1])
| File "/tmp/tmp9y656rrb/tmp_sw48gv9.py", line 8
if s = 1 or s = 2:
^^^^^
SyntaxError: invalid syntax. Maybe you meant '==' or ':=' instead of '='?
| |
s993957388 | p02555 | u534610124 | 1600027448 | Python | Python (3.8.2) | py | Runtime Error | 236 | 42488 | 180 | S = int(input())
L = S//3
mod = 10**9+7
res = 0
from scipy.special import comb
for l in range(1,L+1):
s = S - l*3
a = comb(s+l-1, l-1)
res += a
print(int(res%mod)) | Traceback (most recent call last):
File "/tmp/tmpxar0mo7x/tmpekqh3566.py", line 1, in <module>
S = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s855585754 | p02555 | u755056246 | 1600027429 | Python | PyPy3 (7.3.0) | py | Runtime Error | 187 | 111644 | 357 | nCr = {}
def cmb(n, r):
if r == 0 or r == n: return 1
if r == 1: return n
if (n,r) in nCr: return nCr[(n,r)]
nCr[(n,r)] = cmb(n-1,r) + cmb(n-1,r-1)
return nCr[(n,r)]
S = int(input())
sho = S // 3
ans = 1
S -= 5
if sho > 0:
for i in range(1,sho):
ans += cmb(S, i)
S -= 2
prin... | Traceback (most recent call last):
File "/tmp/tmpt4bmt0z8/tmpsfwvdxkj.py", line 9, in <module>
S = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s134369993 | p02555 | u729679908 | 1600027372 | Python | Python (3.8.2) | py | Runtime Error | 32 | 9212 | 401 | import sys
N = int(input())
A = list(map(int,input().split()))
B = list(map(int,input().split()))
C = B
for i in range(1,N+1):
i = A.count(i) + B.count(i)
if i > N:
print("No")
sys.exit()
print("Yes")
for j in range(0,N):
for k in range(0,N):
if B[k] != A[j] and B[k] != 0:
... | Traceback (most recent call last):
File "/tmp/tmpbnenh_6e/tmpankui7vf.py", line 2, in <module>
N = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s952403530 | p02555 | u273914730 | 1600027369 | Python | Python (3.8.2) | py | Runtime Error | 28 | 8908 | 221 | S=int(input())
def hiteku(S,a)
while S>=3:
a=[]
m=0
for i in range(3,S):
(a).append(S-i)
S=S-i
m=m+1
hiteku(S,a)
print((m)%(10**9+7))
| File "/tmp/tmpra1ccmpc/tmp2uz_i4kr.py", line 3
def hiteku(S,a)
^
SyntaxError: expected ':'
| |
s949601279 | p02555 | u947664173 | 1600027356 | Python | PyPy3 (7.3.0) | py | Runtime Error | 88 | 68332 | 413 | s=int(input())
import math
ketamax=math.floor(s/3)
def kaijo(a,b):
x=a
for i in range(a+1,b+1):
x=x*i
return x
def comb(n, r):
if r==0:
return 1
elif r==1:
return n
else:
a=kaijo(n-r+1,n)/kaijo(1,r)
return a
ans=0
for i in range(1,ketamax+1):
nokori=s-3*i... | Traceback (most recent call last):
File "/tmp/tmp8doiqb2a/tmpo73exujj.py", line 1, in <module>
s=int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s139809156 | p02555 | u273914730 | 1600027348 | Python | Python (3.8.2) | py | Runtime Error | 25 | 8948 | 222 | S=int(input())
def hiteku(S,a)
while S>=3:
a=[]
m=0
for i in range(3,S):
(a).append(S-i)
S=S-i
m=m+1
hiteku(S,a)
print((m)%(10**9+7))
| File "/tmp/tmpv21s6jz3/tmpam08_41n.py", line 3
def hiteku(S,a)
^
SyntaxError: expected ':'
| |
s216422317 | p02555 | u905029819 | 1600027337 | Python | Python (3.8.2) | py | Runtime Error | 52 | 9160 | 249 | import math
S = int(input())
divider = 10**9 + 7
sum = 0
if S > 5:
for i in range(1, S//3):
sum += math.factorial(S-2*i-1) / math.factorial(S-3*i) * math.factorial(i-1)
elif 3 <= S <= 5 :
print(1)
else:
print(0)
print(sum / divider) | Traceback (most recent call last):
File "/tmp/tmpet9x5wc4/tmp75nm91n6.py", line 3, in <module>
S = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s325542005 | p02555 | u578441226 | 1600027331 | Python | Python (3.8.2) | py | Runtime Error | 2206 | 9808 | 306 | def dfs(i,sum,box):
global ans
if i == s-2:
if sum == s:
ans += 1
if box == s:
ans += 1
else:
dfs(i + 1, sum + sl[i],sl[i])
dfs(i + 1, sum,box)
s = int(input())
sl = list(range(3,s+1))
# print(sl)
ans = 0
dfs(0,0,0)
print(ans) | Traceback (most recent call last):
File "/tmp/tmppwittoai/tmpeuffsgbs.py", line 15, in <module>
s = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s877182019 | p02555 | u905029819 | 1600027275 | Python | Python (3.8.2) | py | Runtime Error | 51 | 9036 | 243 | import math
S = int(input())
divider = 10**9 + 7
sum = 0
if S > 3:
for i in range(1, S//3):
sum += math.factorial(S-2*i-1) / math.factorial(S-3*i) * math.factorial(i-1)
elif S == 3:
print(1)
else:
print(0)
print(sum / divider) | Traceback (most recent call last):
File "/tmp/tmp35g0633s/tmp2oxhxp4s.py", line 3, in <module>
S = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s954097736 | p02555 | u836080851 | 1600027265 | Python | Python (3.8.2) | py | Runtime Error | 86 | 9200 | 217 | import math
S = int(input())
d = 10**9+7
n = int(S/3)
co = 0
for i in range(n):
a = i+1
if a == 1:
co += 1
else:
co += math.factorial(S-2*a-1)/(math.factorial(S-3*a)*math.factorial(a-1))
print(int(co%d)) | Traceback (most recent call last):
File "/tmp/tmp_q69xmve/tmpsse2vbs5.py", line 2, in <module>
S = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s774248006 | p02555 | u475402977 | 1600027259 | Python | Python (3.8.2) | py | Runtime Error | 27 | 8904 | 545 | S=int(input())
def cmb(n, r, mod):
if ( r<0 or r>n ):
return 0
r = min(r, n-r)
return g1[n] * g2[r] * g2[n-r] % mod
mod = 10**9+7 #出力の制限
N = 10**4
g1 = [1, 1] # 元テーブル
g2 = [1, 1] #逆元テーブル
inverse = [0, 1] #逆元テーブル計算用テーブル
for i in range( 2, N + 1 ):
g1.append( ( g1[-1] * i ) % mod )
inverse.... | File "/tmp/tmpleyf6w_w/tmpxgjkmb5v.py", line 25
ans+=cmb(S-2*
^
SyntaxError: '(' was never closed
| |
s714728964 | p02555 | u905029819 | 1600027225 | Python | Python (3.8.2) | py | Runtime Error | 50 | 9184 | 220 | import math
S = int(input())
divider = 10**9 + 7
sum = 0
if S >= 3:
for i in range(1, S//3):
sum += math.factorial(S-2*i-1) / math.factorial(S-3*i) * math.factorial(i-1)
else:
print(0)
print(sum / divider) | Traceback (most recent call last):
File "/tmp/tmpj9v0uvji/tmpye7m8l2j.py", line 3, in <module>
S = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s207981049 | p02555 | u373047809 | 1600027216 | Python | PyPy3 (7.3.0) | py | Runtime Error | 101 | 72048 | 752 | #!/usr/bin/env python3
class Factorial:
def __init__(self, n, mod):
self.f = f =[0] * (n + 1)
f[0] = b = 1
for i in range(1, n + 1):f[i] = b = b * i % mod
self.inv = inv = [0] * (n + 1)
inv[n] = b = pow(self.f[n], -1, mod)
for i in range(n,0,-1):inv[i-1] = b = b * i %... | Traceback (most recent call last):
File "/tmp/tmpdhoxiki2/tmpcmtpx98r.py", line 21, in <module>
s = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s559906401 | p02555 | u923507896 | 1600027145 | Python | PyPy3 (7.3.0) | py | Runtime Error | 173 | 73392 | 301 | import math
s = int(input())
n = s//3
ans = 0
if n == 0:
print(0)
else:
for i in range(n):
res = s-(3*(i+1))
fact1 = math.factorial(res+i)
fact2 = math.factorial(res)
fact3 = math.factorial(i)
ans += int(fact1/(fact2*fact3))
print(ans % (10**9 + 7)) | Traceback (most recent call last):
File "/tmp/tmpctvnj17_/tmpw30tynex.py", line 2, in <module>
s = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s762510540 | p02555 | u905029819 | 1600027130 | Python | Python (3.8.2) | py | Runtime Error | 53 | 9188 | 188 | import math
S = int(input())
divider = 10**9 + 7
sum = 0
for i in range(1, S//3):
sum += math.factorial(S-2*i-1) / math.factorial(S-3*i) * math.factorial(i-1)
print(sum / divider) | Traceback (most recent call last):
File "/tmp/tmpd5hax2lr/tmpy83quvfp.py", line 3, in <module>
S = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s451710007 | p02555 | u273914730 | 1600027130 | Python | Python (3.8.2) | py | Runtime Error | 25 | 9000 | 218 | S=int(input())
def hiteku(a)
while S>=3:
a=[]
m=0
for i in range(3,S):
(a).append(S-i)
S=S-i
m=m+1
hiteku(a)
print((m)%(10**9+7))
| File "/tmp/tmpp1j9oq5d/tmplcg34x50.py", line 3
def hiteku(a)
^
SyntaxError: expected ':'
| |
s536708756 | p02555 | u905029819 | 1600027079 | Python | Python (3.8.2) | py | Runtime Error | 50 | 9164 | 188 | import math
S = int(input())
divider = 10**9 + 7
sum = 0
for i in range(1, S//3):
sum += math.factorial(S-2*i-1) / math.factorial(S-3*i) * math.factorial(i-1)
print(num / divider) | Traceback (most recent call last):
File "/tmp/tmp4te0atc3/tmppo71fj9v.py", line 3, in <module>
S = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s312731990 | p02555 | u323453628 | 1600027049 | Python | PyPy3 (7.3.0) | py | Runtime Error | 167 | 79448 | 195 | from math import factorial
s = int(input())
n = s // 3
sum = 0
for i in range(1, n + 1):
sum += factorial(s - 2 * i - 1) / (factorial(s - 3 * i) * factorial(i - 1))
print(sum % (10 ** 9 + 7)) | Traceback (most recent call last):
File "/tmp/tmp3jxywajh/tmpdkt8g1vd.py", line 2, in <module>
s = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s177526823 | p02555 | u836080851 | 1600027047 | Python | Python (3.8.2) | py | Runtime Error | 90 | 9008 | 217 | import math
S = int(input())
d = 10**9+7
n = int(S/3)
co = 0
for i in range(n):
a = i+1
if a == 1:
co += 1
else:
co += math.factorial(S-2*a-1)/(math.factorial(S-3*a)*math.factorial(a-1))
print(int(co%d)) | Traceback (most recent call last):
File "/tmp/tmpq9jeouqo/tmpo2mdv3uk.py", line 2, in <module>
S = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s661907821 | p02555 | u273914730 | 1600026893 | Python | Python (3.8.2) | py | Runtime Error | 27 | 9000 | 218 | S=int(input())
def hiteku(a)
while S>=0:
a=[]
m=0
for i in range(3,S):
(a).append(S-i)
S=S-i
m=m+1
hiteku(a)
print((m)%(10**9+7))
| File "/tmp/tmpbeuu6oj0/tmpn8bun5dz.py", line 3
def hiteku(a)
^
SyntaxError: expected ':'
| |
s829541157 | p02555 | u273914730 | 1600026878 | Python | Python (3.8.2) | py | Runtime Error | 34 | 8940 | 221 | S=int(input())
def hiteku(a)
while S>=0:
a=[]
m=0
for i in range(3,S):
(a).append(S-i)
S=S-i
m=m+1
hiteku(a)
print((m)%(10**9+7))
| File "/tmp/tmpp8ya1gv2/tmpur9jznng.py", line 3
def hiteku(a)
^
SyntaxError: expected ':'
| |
s202692210 | p02555 | u587370992 | 1600026827 | Python | PyPy3 (7.3.0) | py | Runtime Error | 2208 | 104276 | 607 | S = int(input())
MOD = 10 ** 9 + 7
memo = []
for _ in range(2000):
memo.append([None] * 2000)
def f(n, s):
if memo[n][s] is not None:
return memo[n][s]
ans = f_(n, s)
memo[n][s] = ans
return ans
def f_(n, s):
# print(n, s)
if n == 1 and s >= 3:
return 1
if n < 1 or 3 *... | Traceback (most recent call last):
File "/tmp/tmpdf72iegr/tmpvnzj8vcv.py", line 1, in <module>
S = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s210207641 | p02555 | u895758916 | 1600026788 | Python | Python (3.8.2) | py | Runtime Error | 85 | 9184 | 159 | import math
S=int(input())
MOD=(10**9)+7
if S<3:
print(0)
else :
lim=(S//3)
ans=0
for i in range(lim):
S=S-3;
ans=(ans+math.comb(i+S,i))%MOD
print(ans) | Traceback (most recent call last):
File "/tmp/tmpay3edrv0/tmpaq5amzy_.py", line 2, in <module>
S=int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s776462500 | p02555 | u912556688 | 1600026751 | Python | PyPy3 (7.3.0) | py | Runtime Error | 97 | 68656 | 188 | S=int(input())
ans=0
for i in range(S // 3):
ans+=(math.factorial(S-2*i)%1000000007)//((math.factorial(i)%1000000007)*(math.factorial(S-3*i))%1000000007)%1000000007
print(ans%1000000007) | Traceback (most recent call last):
File "/tmp/tmpaymiqxf2/tmpnuj0247w.py", line 1, in <module>
S=int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s071991478 | p02555 | u419978514 | 1600026750 | Python | Python (3.8.2) | py | Runtime Error | 27 | 9104 | 247 | n=int(input)
a=list()
for i in range(n):
a.append(list(map(int,input().strip().split())))
a=list(set(a))
ans=0
for i in range(len(a)):
for j in range(i+1,len(a)):
ans=max(ans,abs(a[i][0]-a[j][0])+abs(a[j][1],a[i][1]))
print(ans) | Traceback (most recent call last):
File "/tmp/tmp4p1gekv6/tmppt7js7h_.py", line 1, in <module>
n=int(input)
^^^^^^^^^^
TypeError: int() argument must be a string, a bytes-like object or a real number, not 'builtin_function_or_method'
| |
s578193429 | p02555 | u561615664 | 1600026725 | Python | PyPy3 (7.3.0) | py | Runtime Error | 108 | 68732 | 158 | S = int(input())
mod = 10**9+7
s = s%3
n = (S-s)/3
for i in range(n):
jj = 1
for j in range(n-i,2*i+s+n-1):
jj *= j
ss += jj
print(ss%mod) | Traceback (most recent call last):
File "/tmp/tmplgzk4irm/tmpyuzby0ks.py", line 1, in <module>
S = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s734319919 | p02555 | u875584014 | 1600026702 | Python | Python (3.8.2) | py | Runtime Error | 80 | 9184 | 182 | import math
S=int(input())
N=S//3
t=S%3
ans=0
for i in reversed(range(N)):
ans+=int(math.factorial(i+t)/(math.factorial(i)*math.factorial(t)))
ans=ans%(10**9+7)
t+=3
print(ans) | Traceback (most recent call last):
File "/tmp/tmpdrvxtxl2/tmp6xujm_b_.py", line 2, in <module>
S=int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s725367529 | p02555 | u628285938 | 1600026623 | Python | Python (3.8.2) | py | Runtime Error | 227 | 42468 | 344 | # -*- coding: utf-8 -*-
"""
Created on Sun Sep 13 20:41:22 2020
@author: liang
"""
from scipy.special import comb
#D
key = 10**9 + 7
S = int(input())
#かご
n = S//3
ans = 0
for i in range(1,n+1):
#玉
a = S - 3*i
tmp = int(comb(i-1+a,i-1))
tmp %= key
ans += tmp
ans %= key
#print("print:",i,a... | Traceback (most recent call last):
File "/tmp/tmpdp5uxh53/tmp8whndtka.py", line 10, in <module>
S = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s254631986 | p02555 | u392996478 | 1600026590 | Python | PyPy3 (7.3.0) | py | Runtime Error | 95 | 68312 | 546 | from collections import Counter
from collections import deque
from sys import stdin
from bisect import *
from heapq import *
import math
g = lambda : stdin.readline().strip()
gl = lambda : g().split()
gil = lambda : [int(var) for var in gl()]
gfl = lambda : [float(var) for var in gl()]
gcl = lambda : list(g())
gbs ... | Traceback (most recent call last):
File "/tmp/tmpx0ls1d3b/tmpl2e96320.py", line 18, in <module>
n, = gil()
^^
ValueError: not enough values to unpack (expected 1, got 0)
| |
s361402712 | p02555 | u742129941 | 1600026545 | Python | Python (3.8.2) | py | Runtime Error | 654 | 9136 | 170 | S = int(input())
a = [0 for _ in range(S+1)]
a[3] = 1
for n in range(4, S+1):
sm = 0
for i in range(3, S):
sm += a[n-i]
a[n] = sm+1
print(a[S] % ((10**9) + 7)) | Traceback (most recent call last):
File "/tmp/tmpm4tqiszk/tmpmpsg4hyu.py", line 1, in <module>
S = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s638326714 | p02555 | u694665829 | 1600026409 | Python | Python (3.8.2) | py | Runtime Error | 119 | 9160 | 471 | n = int(input())
mod = 10**9 + 7
import math
def cnt(n, i):
if i == 1:
return 1
else:
l = n - 3*i
m = i-1
return math.factorial(l + m)//(math.factorial(l)*math.factorial(m))
if n == 2 or n == 1:
print(0)
if n == 3:
print(1)
if n > 3:
ans = 0
iter = n /... | Traceback (most recent call last):
File "/tmp/tmp7_bbars6/tmpobjzv4ce.py", line 1, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s510158452 | p02555 | u158380546 | 1600026380 | Python | Python (3.8.2) | py | Runtime Error | 34 | 9196 | 173 | s = int(input())
red = [None]*s
red[0]= 0
red[1]= 0
red[2]= 0
for x in range(3,s):
red[x] = (red[x-1] + red[x-3] + 1) % 1000000007
print((red[s-3]+1) % 1000000007) | Traceback (most recent call last):
File "/tmp/tmpvhho2881/tmpr6ldsjd3.py", line 1, in <module>
s = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s446230746 | p02555 | u934119021 | 1600026375 | Python | Python (3.8.2) | py | Runtime Error | 119 | 9256 | 419 | import math
s = int(input())
p = s // 3
q = s % 3
ans = 0
if s < 3:
ans = 0
else:
if q == 0:
ans += 1
elif q == 1:
ans += p
elif q == 2:
ans += p + math.factorial(p) // (math.factorial(p - 2) * math.factorial(2))
for i in range(1, p):
ans += math.factorial((s - 3 * (p - i)) + (p - i - 1)) // (... | Traceback (most recent call last):
File "/tmp/tmpqrr5tbgh/tmpl0opixp7.py", line 2, in <module>
s = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s387065680 | p02555 | u793821463 | 1600026348 | Python | Python (3.8.2) | py | Runtime Error | 1594 | 62344 | 212 | S = int(input())
mod = 10**9 + 7
d = [[0 for i in range(S + 1)] for j in range(S + 1)]
d[3][1] = 1
for j in range(S - 3):
for i in range(S):
d[j+4][i+1] = (d[j+3][i+1] + d[j+1][i]) %mod
print(sum(d[S])%mod) | Traceback (most recent call last):
File "/tmp/tmpsh9ka55w/tmp8ur2laj3.py", line 1, in <module>
S = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s650207288 | p02555 | u062691227 | 1600026304 | Python | PyPy3 (7.3.0) | py | Runtime Error | 150 | 68700 | 155 | from math import comb
MOD = 10**9+7
n = int(input())
mdiv = n // 3
ans = 0
for i in range(mdiv):
ans += comb(n - 3 * (i + 1) + i, i)
print(ans % MOD) | Traceback (most recent call last):
File "/tmp/tmpahblp_2v/tmphqfo41ok.py", line 3, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s505492668 | p02555 | u550146922 | 1600026302 | Python | PyPy3 (7.3.0) | py | Runtime Error | 137 | 68716 | 182 | s = int(input())
import sys
p = 10**9+7
dp = [0]*100#2003
dp[2]=1
if s<=3:
print(dp[s-1])
sys.exit()
for i in range(3,s):
dp[i] = (dp[i-1]%p+dp[i-3]%p)%p
print(dp[s-1]) | Traceback (most recent call last):
File "/tmp/tmph7yhwwx3/tmpvcmu2f5n.py", line 1, in <module>
s = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s775613276 | p02555 | u273914730 | 1600026280 | Python | Python (3.8.2) | py | Runtime Error | 27 | 8936 | 163 | S=int(input())
def hiteku(a)
a=[]
m=0
while S>=0:
for i in range(3,S):
(a).append(S-i)
S=S-i
m=m+1
hiteku(a)
print((m)%(10**9+7))
| File "/tmp/tmpinzbdslv/tmp7i5jaksu.py", line 3
def hiteku(a)
^
SyntaxError: expected ':'
| |
s065793844 | p02555 | u273914730 | 1600026222 | Python | Python (3.8.2) | py | Runtime Error | 27 | 8908 | 167 | S=int(input())
def hiteku(a)
a=[]
m=0
while S>=0:
for i in range(3,S):
(a).append(S-i)
S=S-i
m=m+1
hiteku(a)
print((m)%(10**9+7))
| File "/tmp/tmpib3_2f6z/tmp8tlzpmb7.py", line 3
def hiteku(a)
^
SyntaxError: expected ':'
| |
s278264613 | p02555 | u273914730 | 1600026192 | Python | Python (3.8.2) | py | Runtime Error | 25 | 9000 | 155 | S=int(input())
def hiteku(a)
a=[]
m=0
while S>=0:
for i in range(3,S):
(a).append(S-i)
S=S-i
m=m+1
hiteku(a)
print(m)
| File "/tmp/tmpyvf9uy5x/tmp6ozfgl1f.py", line 3
def hiteku(a)
^
SyntaxError: expected ':'
| |
s595776090 | p02555 | u794066762 | 1600026002 | Python | Python (3.8.2) | py | Runtime Error | 532 | 9220 | 177 | n=int(input())
dp=[1 for i in range(n+1)]
dp[0]=dp[1]=dp[2]=0
modd=1e9+7
for i in range(3,n):
for j in range(3,n-i+1):
dp[i+j]=(dp[i+j]+dp[i])%modd
print(int(dp[n])) | Traceback (most recent call last):
File "/tmp/tmpscvjek47/tmp1igobpcz.py", line 1, in <module>
n=int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s099378823 | p02555 | u985929170 | 1600025984 | Python | PyPy3 (7.3.0) | py | Runtime Error | 116 | 68684 | 263 | mod = 10**9+7
from scipy.special import comb
s = int(input())
if s==1 or s==2:
print(0)
exit()
pk_num = s//3-1
ans = 1
for i in range(pk_num):
pk = (i+2)*3
g = s - pk
b = i+2
ans += comb(g+b-1,b-1, exact=True)
ans %= mod
print(ans) | Traceback (most recent call last):
File "/tmp/tmpfwfu3ln1/tmpxb_nyfjk.py", line 5, in <module>
s = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s582331027 | p02555 | u280978334 | 1600025977 | Python | Python (3.8.2) | py | Runtime Error | 29 | 8864 | 1107 | from math import log10
class Mod:
fac = []
inv = []
finv = []
mod = 0
def __init__(self,maxi:int ,mod:int):
self.mod = mod
self.fac = [1]*maxi
self.inv = [1]*maxi
self.finv = [1]*maxi
for i in range(2,maxi):
... | File "/tmp/tmpry5aqye3/tmproy67w0o.py", line 1
from math import log10
IndentationError: unexpected indent
| |
s122363855 | p02555 | u628335443 | 1600025876 | Python | PyPy3 (7.3.0) | py | Runtime Error | 151 | 68500 | 222 | S = int(input())
if S < 3:
print(0)
exit()
x = [0] * (S + 1)
x[3] = x[4] = x[5] = 1
for i in range(6, S + 1):
x[i] += 1
for j in range(3, i - 3 + 1):
x[i] += x[i - j]
print(x[S] % (10 ** 9 + 7))
| Traceback (most recent call last):
File "/tmp/tmprbbozzsa/tmp7keu2vyu.py", line 1, in <module>
S = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s399425679 | p02555 | u348805958 | 1600025862 | Python | PyPy3 (7.3.0) | py | Runtime Error | 86 | 68608 | 882 | #!python3
import sys
iim = lambda: map(int, sys.stdin.readline().rstrip().split())
def cmb_mod(N, mod=10**9+7):
N1 = N + 1
g1 = [0] * N1
g2 = [0] * N1
inv = [0] * N1
g1[0] = g1[1] = g2[0] = g2[1] = inv[1] = 1
for i in range(2, N1):
g1[i] = g1[i-1] * i % mod
inv[i] = -inv[mod %... | Traceback (most recent call last):
File "/tmp/tmpzpqkunb_/tmpevggpki6.py", line 44, in <module>
resolve()
File "/tmp/tmpzpqkunb_/tmpevggpki6.py", line 27, in resolve
S = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s756746760 | p02555 | u268750247 | 1600025712 | Python | Python (3.8.2) | py | Runtime Error | 27 | 9000 | 1574 | #include <bits/stdc++.h>
using namespace std;
// #include <ext/pb_ds/assoc_container.hpp>
// #include <ext/pb_ds/tree_policy.hpp>
// using namespace __gnu_pbds;
#define ll long long
#define ull unsigned long long
#define ld long double
// #define ordered_set tree<pair<ll, ll>, null_type, less<pair<ll, ll>>, rb_tre... | File "/tmp/tmpo9fc0d_8/tmp1t4a73qm.py", line 28
// To compile--> g++ -std=c++0x -o output one.cpp
^
SyntaxError: invalid hexadecimal literal
| |
s184365631 | p02555 | u642012866 | 1600025639 | Python | Python (3.8.2) | py | Runtime Error | 497 | 9212 | 201 | S = int(input())
mod = 10**9+7
ans = 0
x = [0]*(S+1)
x[3] = 1
x[4] = 1
x[5] = 1
for i in range(6, S+1):
x[i] += 1
for j in range(3, i-2):
x[i] += x[j]
x[i] %= mod
print(x[S]) | Traceback (most recent call last):
File "/tmp/tmpw0nmbwbz/tmp3wjpcx7u.py", line 1, in <module>
S = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s939730944 | p02555 | u019685451 | 1600025594 | Python | PyPy3 (7.3.0) | py | Runtime Error | 103 | 68728 | 178 | N = int(input())
M = 10**9 + 7
dp = [0] * (N + 1)
dp[3] = 1
dp[4] = 1
dp[5] = 1
for i in range(6, N + 1):
dp[i] = sum(dp[3:i - 3 + 1]) + 1
dp[i] %= M
print(dp[-1] % M) | Traceback (most recent call last):
File "/tmp/tmp14o4n38w/tmpkspc4wwt.py", line 1, in <module>
N = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s865415608 | p02555 | u851125702 | 1600025496 | Python | Python (3.8.2) | py | Runtime Error | 30 | 9080 | 140 | S=int(input())
x=10**9+7
a=[0 for i in range(S+1)]
a[3]=1
a[4]=1
a[5]=1
a[6]=2
for i in range(7,S+1):
a[i]=(a[i-1]+a[i-3])%x
print(a[S]) | Traceback (most recent call last):
File "/tmp/tmpq_81d6g_/tmp65n7bdij.py", line 1, in <module>
S=int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s991049952 | p02555 | u240444124 | 1600025494 | Python | Python (3.8.2) | py | Runtime Error | 32 | 9068 | 234 | n=int(input())
if n<6:print(int(n>2));quit()
M=10**9+7
ln,hn,dp=n-6,n-5,2
s=n-4
n,d=n-5,1
while n:
for i in range(3):n=(n*ln)%M;ln-=1
for i in range(2):n=(n*pow(hn,-1,M))%M;hn-=1
d=(d*pow(dp,-1,M))%M;dp+=1
s=(s+n*d)%M
print(s) | Traceback (most recent call last):
File "/tmp/tmp68cjj8d2/tmp1_86qlso.py", line 1, in <module>
n=int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s843042687 | p02555 | u240444124 | 1600025181 | Python | Python (3.8.2) | py | Runtime Error | 30 | 9224 | 232 | n=int(input())
if n<6:print(int(n>2));quit()
M=10**9+7
ln,hn,dp=n-6,n-5,2
s=0
n,d=n-5,1
while n:
for i in range(3):n=(n*ln)%M;ln-=1
for i in range(2):n=(n*pow(hn,-1,M))%M;hn-=1
d=(d*pow(dp,-1,M))%M;dp+=1
s=(s+n*d)%M
print(s) | Traceback (most recent call last):
File "/tmp/tmpenxsv4_s/tmpokcqkjib.py", line 1, in <module>
n=int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s834808175 | p02555 | u240444124 | 1600025118 | Python | Python (3.8.2) | py | Runtime Error | 23 | 9048 | 232 | n=int(input())
if n<6:print(int(n>2));quit()
M=10**9+7
ln,hn,dp=n-6,n-5,2
s=0
n,d=n-5,1
while n:
for i in range(3):n=(n*ln)%M;ln-=1
for i in range(2):n=(n*pow(hn,-1,M))%M;hn-=1
d=(d*pow(dp,-1,M))%M,dp+=1
s=(s+n*d)%M
print(s) | File "/tmp/tmpyu5x_a1r/tmpoj0eq1n9.py", line 10
d=(d*pow(dp,-1,M))%M,dp+=1
^^
SyntaxError: invalid syntax
| |
s575366343 | p02555 | u431573188 | 1600025001 | Python | PyPy3 (7.3.0) | py | Runtime Error | 112 | 68524 | 221 | S = int(input())
mod = 10**9+7
table = [1]*(S+1)
table[0] = 0
table[1] = 0
table[2] = 0
for s in range(6,S+1):
for i in range(3,s-2):
table[s] += table[i]
table[s] %= mod
print(table[S]%mod) | Traceback (most recent call last):
File "/tmp/tmpvodb5tsi/tmpanv6fsa6.py", line 1, in <module>
S = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s116559512 | p02555 | u098012509 | 1600024784 | Python | PyPy3 (7.3.0) | py | Runtime Error | 100 | 68412 | 380 | import sys
sys.setrecursionlimit(10 ** 8)
input = sys.stdin.readline
def main():
S = int(input())
MOD = 10 ** 9 + 7
dp = [1] * (S + 1)
dp[0] = 0
dp[1] = 0
dp[2] = 0
for i in range(3, S + 1):
for j in range(i - 3, 1, -1):
dp[i] += dp[j]
dp[i] %= MOD
... | Traceback (most recent call last):
File "/tmp/tmpcy9fys3y/tmpb4y6graz.py", line 26, in <module>
main()
File "/tmp/tmpcy9fys3y/tmpb4y6graz.py", line 9, in main
S = int(input())
^^^^^^^^^^^^
ValueError: invalid literal for int() with base 10: ''
| |
s929116005 | p02555 | u029000441 | 1600024694 | Python | PyPy3 (7.3.0) | py | Runtime Error | 272 | 68344 | 1133 | def main():
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**7)
from collections import Counter, deque
from collections import defaultdict
from itertools import combinations, permutations, accumulate, groupby, product
from bisect import bisect_left,bisect_right
from heapq ... | Traceback (most recent call last):
File "/tmp/tmp8lzd5k8m/tmp_ch1svzq.py", line 40, in <module>
main()
File "/tmp/tmp8lzd5k8m/tmp_ch1svzq.py", line 23, in main
n=I()
^^^
File "/tmp/tmp8lzd5k8m/tmp_ch1svzq.py", line 12, in I
def I(): return int(input())
^^^^^^^^^^^^
ValueError... | |
s113527313 | p02555 | u792078574 | 1600024692 | Python | Python (3.8.2) | py | Runtime Error | 305 | 9408 | 438 | from itertools import accumulate
MOD = 10 ** 9 + 7
S = int(input())
# dp[a][b]: 長さaで、合計bである数列の数
dp = [0] * (S+4)
dp[0] = 1
acc = list(accumulate(dp))
acc[-1] = acc[-2] = acc[-3] = 0
ans = 0
for a in range(700):
ndp = []
for b in range(S+1):
ndp.append(acc[b-3] % MOD)
ans += ndp[S]
ans %= MOD
... | Traceback (most recent call last):
File "/tmp/tmpyd8p5zsq/tmpngrr50ih.py", line 3, in <module>
S = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s915265265 | p02555 | u764066313 | 1600024586 | Python | Python (3.8.2) | py | Runtime Error | 28 | 8892 | 584 | import sys
sys.setrecursionlimit(10**7)
def input(): return sys.stdin.readline()[:-1]
mod = 10**9 + 7
def readInt():return int(input())
def readIntList():return list(map(int,input().split()))
def readStringList():return list(input())
def readStringListWithSpace():return list(input().split())
def readString():return in... | File "/tmp/tmptqm_z9xi/tmp0duny5m0.py", line 23
print(dp[-1]%mod
^
SyntaxError: '(' was never closed
| |
s206357866 | p02555 | u144913062 | 1600024586 | Python | PyPy3 (7.3.0) | py | Runtime Error | 190 | 69160 | 285 | from itertools import accumulate
S = int(input())
mod = 10**9 + 7
dp = [0] * (S + 1)
dp[0] = 1
ans = 0
for i in range(S):
cum = list(accumulate(dp))
for j in range(S, 2, -1):
dp[j] = cum[j-3] % mod
dp[0] = dp[1] = dp[2] = 0
ans = (ans + dp[S]) % mod
print(ans) | Traceback (most recent call last):
File "/tmp/tmprubbf7h4/tmp5vxsbfey.py", line 3, in <module>
S = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s889607048 | p02555 | u827202523 | 1600024535 | Python | Python (3.8.2) | py | Runtime Error | 46 | 10508 | 1434 | import sys
import re
import random
import math
import copy
from heapq import heappush, heappop, heapify
from functools import cmp_to_key
from bisect import bisect_left, bisect_right
from collections import defaultdict, deque, Counter
# sys.setrecursionlimit(1000000)
# input aliases
input = sys.stdin.readline
getS = la... | Traceback (most recent call last):
File "/tmp/tmpm5dxv46a/tmp9s_m_5ri.py", line 63, in <module>
solve()
File "/tmp/tmpm5dxv46a/tmp9s_m_5ri.py", line 39, in solve
n = getN()
^^^^^^
File "/tmp/tmpm5dxv46a/tmp9s_m_5ri.py", line 15, in <lambda>
getN = lambda: int(input())
^^^^^^... | |
s050459252 | p02555 | u719840207 | 1600024494 | Python | Python (3.8.2) | py | Runtime Error | 25 | 9160 | 120 | s=int(input())
ans=0
wakeru=0
while s>0:
s=s-3
ans=ans+cmb(s+wakeru,wakeru,p)
wakeru+=1
print(ans%(10**9+7)) | Traceback (most recent call last):
File "/tmp/tmpbi6fpdfa/tmp0w4e1x14.py", line 1, in <module>
s=int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s452137643 | p02555 | u877470159 | 1600024490 | Python | PyPy3 (7.3.0) | py | Runtime Error | 112 | 68484 | 468 | import sys
input=sys.stdin.readline
s=int(input())
INF=10**9+7
def modcomb(n,k,m):
fac=[0]*(n+1)
finv=[0]*(n+1)
inv=[0]*(n+1)
fac[0]=fac[1]=1
finv[0]=finv[1]=1
inv[1]=1
for i in range(2,n+1):
fac[i]=fac[i-1]*i%m
inv[i]=m-inv[m%i]*(m//i)%m
finv[i]=finv[i-1]*inv[i]%m... | Traceback (most recent call last):
File "/tmp/tmpg2kvy0cd/tmpwg73tzmy.py", line 4, in <module>
s=int(input())
^^^^^^^^^^^^
ValueError: invalid literal for int() with base 10: ''
| |
s523927768 | p02555 | u054274920 | 1600024440 | Python | PyPy3 (7.3.0) | py | Runtime Error | 91 | 68620 | 206 | S=int(input())
A=[0 for i in range(S+1)]
B=[0 for i in range(S+1)]
A[3]=1
B[3]=1
A[4]=1
B[4]=2
A[5]=1
B[5]=3
for i in range(6,S+1):
A[i]=(B[i-3]+1)%(10**9+7)
B[i]=(B[i-1]+A[i])%(10**9+7)
print(A[S]) | Traceback (most recent call last):
File "/tmp/tmpljliwy8i/tmp__lho1bk.py", line 1, in <module>
S=int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s480410289 | p02555 | u607075479 | 1600024322 | Python | PyPy3 (7.3.0) | py | Runtime Error | 176 | 68736 | 976 | import sys
import math
from collections import deque
sys.setrecursionlimit(1000000)
MOD = 10 ** 9 + 7
input = lambda: sys.stdin.readline().strip()
NI = lambda: int(input())
NMI = lambda: map(int, input().split())
NLI = lambda: list(NMI())
SI = lambda: input()
def make_grid(h, w, num): return [[int(num)] * w for _ in... | Traceback (most recent call last):
File "/tmp/tmpe7quvzy9/tmp3slvbu83.py", line 45, in <module>
main()
File "/tmp/tmpe7quvzy9/tmp3slvbu83.py", line 31, in main
S = NI()
^^^^
File "/tmp/tmpe7quvzy9/tmp3slvbu83.py", line 8, in <lambda>
NI = lambda: int(input())
^^^^^^^^^^^^
Valu... | |
s273816650 | p02556 | u644265148 | 1600716578 | Python | Python (3.8.2) | py | Runtime Error | 439 | 24500 | 298 | n = int(input())
z_vec = [0] * n
w_vec = [0] * n
for i in range(0, n + 1):
line = input()
tmp = line.split()
z_vec[i] = int(tmp[0]) + int(tmp[1])
w_vec[i] = int(tmp[0]) - int(tmp[1])
z_ans = max(z_vec) - min(z_vec)
w_ans = max(w_vec) - min(w_vec)
print(f'{max(z_ans, w_ans)}') | Traceback (most recent call last):
File "/tmp/tmpltvnvma9/tmplqxekpk5.py", line 1, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s905831159 | p02556 | u644265148 | 1600716320 | Python | Python (3.8.2) | py | Runtime Error | 429 | 24492 | 282 | n = int(input())
z_vec = [0] * n
w_vec = [0] * n
for i in range(0, n + 1):
tmp = input().split()
z_vec[i] = int(tmp[0]) + int(tmp[1])
w_vec[i] = int(tmp[0]) - int(tmp[1])
z_ans = max(z_vec) - min(z_vec)
w_ans = max(w_vec) - min(w_vec)
print(f'{max(z_ans, w_ans)}') | Traceback (most recent call last):
File "/tmp/tmpmznhg_kr/tmplpauwhhr.py", line 1, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s177137192 | p02556 | u548272916 | 1600629106 | Python | Python (3.8.2) | py | Runtime Error | 2213 | 214592 | 359 | n = int(input())
x = []
y = []
distance = []
for i in range(n):
x1, y1 = input().split()
x1 = int(x1)
y1 = int(y1)
x.append(x1)
y.append(y1)
for i in range(len(x)):
for j in range(i+1,len(x)):
temp = abs(x[i] - x[j]) + abs(y[i] - y[j])
distance.append(temp)
max = distance[0]
if distance[i-... | Traceback (most recent call last):
File "/tmp/tmpww5sw47d/tmp1a3sn6kg.py", line 1, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s948522675 | p02556 | u548272916 | 1600627492 | Python | Python (3.8.2) | py | Runtime Error | 653 | 48516 | 406 | n = int(input())
x = []
y = []
distance = []
for i in range(n):
x1, y1 = input().split()
x1 = int(x1)
y1 = int(y1)
x.append(x1)
y.append(y1)
for i in range(len(x)-1):
for j in range(i, len(x)-1):
temp = abs(x[i] - x[j+i]) + abs(y[i] - y[j+i])
distance.append(temp)
max = distance[0]
for i in... | Traceback (most recent call last):
File "/tmp/tmp87fz44wg/tmp0hhmceck.py", line 1, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s295162540 | p02556 | u699522269 | 1600547994 | Python | Python (3.8.2) | py | Runtime Error | 27 | 8980 | 155 | N,X,M = map(int,input().split())
dps = [0,X%M]+[0 for i in range(N)]
rt = 0
for i in range(2,N+1):
dps[i] = (dps[i-1]**2)%M
rt+= dps[i]
print(sum(dps)) | Traceback (most recent call last):
File "/tmp/tmpkbps51ds/tmpri12dlku.py", line 1, in <module>
N,X,M = map(int,input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s941331231 | p02556 | u699522269 | 1600547972 | Python | Python (3.8.2) | py | Runtime Error | 28 | 9184 | 154 | N,X,M = map(int,input().split())
dps = [0,X%M]+[0 for i in range(N)]
rt = 0
for i in range(2,N+1):
dps[i] = (dps[i-1]**2)%M
rt+= dp[i]
print(sum(dps)) | Traceback (most recent call last):
File "/tmp/tmpqg260xqc/tmplxog16eu.py", line 1, in <module>
N,X,M = map(int,input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s689064981 | p02556 | u337264920 | 1600540789 | Python | PyPy3 (7.3.0) | py | Runtime Error | 113 | 74292 | 437 | # -*- coding: utf-8 -*-
# E
import sys
from collections import defaultdict, deque
from heapq import heappush, heappop
import math
import bisect
import numpy as np
input = sys.stdin.readline
# 再起回数上限変更
# sys.setrecursionlimit(1000000)
n = int(input())
d1 = [] * n
d2 = [] * n
for i in range(n):
x, y = map(int, in... | Traceback (most recent call last):
File "/tmp/tmpynasae9_/tmpkjsp3ec8.py", line 15, in <module>
n = int(input())
^^^^^^^^^^^^
ValueError: invalid literal for int() with base 10: ''
| |
s226122621 | p02556 | u231570044 | 1600517663 | Python | PyPy3 (7.3.0) | py | Runtime Error | 158 | 74696 | 1305 | from dataclasses import dataclass
from operator import itemgetter, attrgetter
@dataclass
class P:
x: float
y: float
def __add__(self, p: P): return P(self.x + p.x, self.y + p.y)
def __sub__(self, p: P): return P(self.x - p.x, self.y - p.y)
def dot(self, p: P): return (self.x*p.x + self.y*p.y)
d... | Traceback (most recent call last):
File "/tmp/tmpia74aequ/tmpcswupwt_.py", line 5, in <module>
class P:
File "/tmp/tmpia74aequ/tmpcswupwt_.py", line 8, in P
def __add__(self, p: P): return P(self.x + p.x, self.y + p.y)
^
NameError: name 'P' is not defined
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.