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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
s641423998 | p04005 | u837286475 | 1473571553 | Python | Python (3.4.3) | py | Runtime Error | 39 | 3188 | 411 |
N,x = map(int,input().split())
lst = list( map(int,input().split() ) )
ans = sum(lst)
dp = lst[:]
#print(N,x)
#print(lst)
for i in range(1,N):
tmp = 0
for k in range(0,N):
index_ = 0
if(0 <= k-i):
index_ = k-i
else:
index_ = N-i+k
dp[k] = min(dp[k],... | Traceback (most recent call last):
File "/tmp/tmppcdu0zc7/tmpex1l_s5d.py", line 2, in <module>
N,x = map(int,input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s746003662 | p04005 | u010075034 | 1473128156 | Python | Python (3.4.3) | py | Runtime Error | 38 | 3064 | 319 | def main():
ints = (int(_) for _ in input().split(' '))
if any(_ % 2 == 0 for _ in ints):
print(0)
return
t = max(ints)
x, y, z = ints
if t == x:
print(y * z)
elif t == y:
print(x * z)
elif t == z:
print(x * y)
if __name__ == '__main__':
main()
| Traceback (most recent call last):
File "/tmp/tmp3eevon05/tmp4y7kdycd.py", line 17, in <module>
main()
File "/tmp/tmp3eevon05/tmp4y7kdycd.py", line 2, in main
ints = (int(_) for _ in input().split(' '))
^^^^^^^
EOFError: EOF when reading a line
| |
s133089835 | p04005 | u010075034 | 1473127873 | Python | Python (3.4.3) | py | Runtime Error | 38 | 3064 | 292 | if __name__ == '__main__':
x, y, z = (int(_) for _ in input().split(' '))
if x % 2 == 0 or y % 2 == 0 or z % 2 == 0:
print(0)
return
t = max((x, y, z))
if t == x:
print(y * z)
elif t == y:
print(x * z)
elif t == z:
print(x * y)
| File "/tmp/tmpy0r3dau2/tmp0srkj5jo.py", line 5
return
^^^^^^
SyntaxError: 'return' outside function
| |
s834177418 | p04005 | u091855288 | 1473101376 | Python | Python (2.7.6) | py | Runtime Error | 157 | 10420 | 205 | import numpy as np
import copy
a = map(int,raw_input().split())
def myfunc(a):
A.sort(reverse=True)
if (A[0]%2 != 0 and A[1]%2 !=0 and A[2]%2 != 0):
print A[1]*A[2]
else:
print 0
myfunc(a) | File "/tmp/tmpu4hpbn6x/tmptvzff_pf.py", line 9
print A[1]*A[2]
^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s112571289 | p04005 | u516438812 | 1473084975 | Python | Python (3.4.3) | py | Runtime Error | 42 | 3184 | 218 | A,B,C = map(int,input().split())
if A % 2 == 0 or B % 2 == 0 or C % 2 == 0:
print(0)
return
S = A * B * C
mi = min(A,min(B,C))
ma = max(A,max(B,C))
mid = S // ma // mi // 2
ans = ma * mi * mid
print(abs(S - ans * 2)) | File "/tmp/tmpl7j6xu33/tmp4_o8vfz3.py", line 4
return
^^^^^^
SyntaxError: 'return' outside function
| |
s169478662 | p04005 | u837286475 | 1473058365 | Python | Python (3.4.3) | py | Runtime Error | 38 | 3064 | 243 |
a,b,c = map(int,input().split())
lst = [a,b,c]
cnt = len(list( filter(lambda x:x%2==0,lst)))
if(0<cnt):
print(0)
else:
lst.sort()
res = 0
if(lst[2]%2 == 1):
res = lst[0]*lst[1]
else:
res = 0
prin | Traceback (most recent call last):
File "/tmp/tmploiu7d7a/tmpqk71oklj.py", line 2, in <module>
a,b,c = map(int,input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s285906466 | p04005 | u601018334 | 1473044979 | Python | Python (3.4.3) | py | Runtime Error | 37 | 3064 | 443 | N, x = list(map(int, input().split()))
a = list(map(int, input().split()))
min_index = a.index(min(a))
index_list = list(range(min_index,N)) + list(range(min_index))
cost = a.copy()
c_count = [0]*N
for i in range(1,N):
if cost[index_list[i]] > (cost[index_list[i-1]]+x):
cost[index_list[i]] = cost[index_list... | Traceback (most recent call last):
File "/tmp/tmpv5xyinj6/tmp6z6p1b5j.py", line 1, in <module>
N, x = list(map(int, input().split()))
^^^^^^^
EOFError: EOF when reading a line
| |
s959814121 | p04005 | u436484848 | 1473044171 | Python | Python (3.4.3) | py | Runtime Error | 36 | 3064 | 149 | str = input()
num = list(map(int,str.split(' ')))
if (num[0]%2)and(num[1]%2)and(num[2])==0:
print(0)
else:
num.sort()
print(num[0]*num[1])
| File "/tmp/tmpz538e0c4/tmpqt9zqbrf.py", line 7
print(num[0]*num[1])
TabError: inconsistent use of tabs and spaces in indentation
| |
s470573294 | p04005 | u436484848 | 1473043929 | Python | Python (3.4.3) | py | Runtime Error | 39 | 3064 | 152 | str = input()
num = list(map(int,str.split(' ')))
if (num[0]%2)*(num[1]%2)*(num[2])==1:
num.sort()
print(num[0]*num[1])
else:
print(0)
| File "/tmp/tmpk5pz1lpf/tmpetn0jujo.py", line 5
print(num[0]*num[1])
TabError: inconsistent use of tabs and spaces in indentation
| |
s314111636 | p04005 | u436484848 | 1473043769 | Python | Python (3.4.3) | py | Runtime Error | 37 | 3064 | 135 | str = input()
num = list(map(int,str.split(' ')))
if !(num[0]%2)*(num[1]%2)*(num[2]):
print(0)
else:
num.sort()
print(num[0]*num[1])
| File "/tmp/tmppunjo329/tmpohcui_l1.py", line 3
if !(num[0]%2)*(num[1]%2)*(num[2]):
^
SyntaxError: invalid syntax
| |
s044929033 | p04005 | u866746776 | 1473040585 | Python | Python (3.4.3) | py | Runtime Error | 39 | 3064 | 430 | def solve(n, x, a):
costs = []
cost_min = 0
for k in range(n):
if k == 0:
costs = a.copy()
else:
for i in range(n):
costs[i] = min(costs[i], a[(i-k)%n])
cost_k = sum(costs) + k*x
if k == 0:
cost_min = cost_k
else:
cost_min = min(cost_min, cost_k)
if cost_min < (k+1) *x:
break
retur... | Traceback (most recent call last):
File "/tmp/tmpdugmhw74/tmpj8byfi1_.py", line 19, in <module>
n, x = [int(i) for i in input().split()]
^^^^^^^
EOFError: EOF when reading a line
| |
s349125909 | p04005 | u010075034 | 1473039791 | Python | Python (3.4.3) | py | Runtime Error | 39 | 3064 | 222 | #!/usr/bin/env python3
if __name__ == '__main__':
N, x = (int(_) for _ in input().split(' '))
As = [int(_) for _ in input().split(' ')]
each = sum(As)
change = (N - 1) * x + N
print(min(each, change))
| Traceback (most recent call last):
File "/tmp/tmprya3wq2j/tmp557h2ci7.py", line 4, in <module>
N, x = (int(_) for _ in input().split(' '))
^^^^^^^
EOFError: EOF when reading a line
| |
s357005931 | p04005 | u010075034 | 1473038769 | Python | Python (3.4.3) | py | Runtime Error | 37 | 3064 | 294 | if __name__ == '__main__':
x = int(input())
y = int(input())
z = int(input())
lst = (x, y, z)
a = max(lst)
if a == x:
b, c = y, z
elif a == y:
b, c = x, z
elif a == z:
b, c = x, y
print(((a - (a // 2)) * b * c) - ((a // 2) * b * c))
| Traceback (most recent call last):
File "/tmp/tmpjymke76y/tmptpzvy33q.py", line 2, in <module>
x = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s530520046 | p04005 | u010075034 | 1473038345 | Python | Python (3.4.3) | py | Runtime Error | 40 | 3188 | 218 | if __name__ == '__main__':
x = int(input())
y = int(input())
z = int(input())
t = (x, y, z)
a = max(t)
b, c = [_ for _ in t if _ != a]
print(((a - (a // 2)) * b * c) - ((a // 2) * b * c))
| Traceback (most recent call last):
File "/tmp/tmpxs_7182s/tmptgzmqrce.py", line 2, in <module>
x = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s395762583 | p04005 | u177721681 | 1473038057 | Python | Python (2.7.6) | py | Runtime Error | 26 | 2568 | 425 | from sys import stdin
from sys import stdout
A,B,C = stdin.readline().split()
if A%2 == 0 or B%2 == 0 or C%2 == 0 :
print 0
exit()
AB = int(A) * int(B)
BC =... | File "/tmp/tmp5aaa8q5z/tmpk4qns5p9.py", line 7
print 0
^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s928162301 | p04005 | u132360211 | 1473038021 | Python | Python (2.7.6) | py | Runtime Error | 26 | 2568 | 152 | io = STDIN
a,b,c=io.gets.chomp.split.map(&:to_i)
p [(a*b*(c/2)-a*b*(c-(c/2))).abs,
(c*b*(a/2)-c*b*(a-(a/2))).abs,
(a*c*(b/2)-a*c*(b-(b/2))).abs].min | File "/tmp/tmpwaulq82k/tmpku8nclyy.py", line 2
a,b,c=io.gets.chomp.split.map(&:to_i)
^
SyntaxError: invalid syntax
| |
s700164432 | p04005 | u530850765 | 1473037674 | Python | Python (3.4.3) | py | Runtime Error | 42 | 3316 | 169 | a,b,c = (int(x) for x in input())
ans = abs(a*b*(c//2)-a*b*(c-c//2))
ans = min(ans, abs(a*c*(b//2)-a*c*(b-b//2)))
ans = min(ans, abs(b*c*(a//2)-b*c*(a-a//2)))
print(ans) | Traceback (most recent call last):
File "/tmp/tmp_ko75o91/tmp2t4mb57h.py", line 1, in <module>
a,b,c = (int(x) for x in input())
^^^^^^^
EOFError: EOF when reading a line
| |
s556051583 | p04006 | u493520238 | 1601347319 | Python | PyPy3 (7.3.0) | py | Runtime Error | 1270 | 71424 | 1779 | # 0-indexed
class SegTree:
def __init__(self, vals, seg_f, ide_ele):
n = len(vals)
self.seg_f = seg_f
self.ide_ele = ide_ele
self.leaf_n = 1 << (n-1).bit_length()
self.tree = [ide_ele]*(2*self.leaf_n-1)
for i in range(n): # init leaf
self.tree[i+self.leaf... | Traceback (most recent call last):
File "/tmp/tmpkabnb0lg/tmpa5t94a1a.py", line 50, in <module>
n,x = map(int, input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s594163422 | p04006 | u423585790 | 1590435983 | Python | PyPy3 (2.4.0) | py | Runtime Error | 214 | 71808 | 246 | n,x=map(int,input().split())
A=list(map(int,input().split()))
ans=0
dp=[[A[i]]*n for i in range(n)]
for l in range(n):
a=A[l:]+A[:l]
a=a[::-1]
for i in range(n):
dp[l][i+1]=min(dp[l][i],a[i]+x*(i+1))
print(sum(map(lambda x:x[-1], dp)))
| Traceback (most recent call last):
File "/tmp/tmpxg_o3kew/tmp0n0sx7x2.py", line 1, in <module>
n,x=map(int,input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s969365719 | p04006 | u423585790 | 1590434975 | Python | PyPy3 (2.4.0) | py | Runtime Error | 223 | 41180 | 268 | n,x=map(int,input().split())
A=list(map(int,input().split()))
ans=0
m=0
r=0
for l in range(n):
a=A[l:]+A[:l]
a=a[::-1]
tmp=A[l]
r=A[r]
for i in range(n):
if tmp>a[i]+x*(i+1):
r=a[i]
tmp=a[i]+x*(i+1)
m=max(i+1,m)
ans+=r
print(ans+m*x)
| Traceback (most recent call last):
File "/tmp/tmpbftx9lwk/tmpkz8e6m8s.py", line 1, in <module>
n,x=map(int,input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s095670006 | p04006 | u922449550 | 1589680494 | Python | PyPy3 (2.4.0) | py | Runtime Error | 178 | 38640 | 275 | N, x = map(int, input().split())
A = list(map(int, input().split()))
min_time = A.copy()
ans = 10**15
for t in range(N):
time = t*x
for i in range(N):
j = (i - t) % N
min_time[i] = min(min_time[i], A[j])
time += min_time[i]
ans = min(ans, time)
print(ans) | Traceback (most recent call last):
File "/tmp/tmpf2mocvqe/tmph27s1a9j.py", line 1, in <module>
N, x = map(int, input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s126596184 | p04006 | u843135954 | 1588734074 | Python | Python (3.4.3) | py | Runtime Error | 19 | 3188 | 379 | import sys
stdin = sys.stdin
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
nn = lambda: list(stdin.readline().split())
ns = lambda: stdin.readline().rstrip()
n,i = na()
a = na()
dp = [i for i in a]
ans = sum(dp)
for i in range(1,n):
for j in range(n):
dp[(j+i)%n] = min(dp[... | Traceback (most recent call last):
File "/tmp/tmpjvnsu114/tmpq6iwo2r5.py", line 9, in <module>
n,i = na()
^^^
ValueError: not enough values to unpack (expected 2, got 0)
| |
s401760883 | p04006 | u648212584 | 1587824867 | Python | PyPy3 (2.4.0) | py | Runtime Error | 185 | 39408 | 387 | import sys
input = sys.stdin.buffer.readline
def main():
N,x = map(int,input().split())
a = list(map(int,input().split()))
b = a.copy()
ans = 10**15
for i in range(N):
time = i*x+sum(b)
ans = min(ans,time)
for now in range(N):
b[now] = min(b[now],a[(now-i-1+... | Traceback (most recent call last):
File "/tmp/tmpfg6r_ask/tmpws3az7n6.py", line 19, in <module>
main()
File "/tmp/tmpfg6r_ask/tmpws3az7n6.py", line 5, in main
N,x = map(int,input().split())
^^^
ValueError: not enough values to unpack (expected 2, got 0)
| |
s852204809 | p04006 | u476604182 | 1584561583 | Python | PyPy3 (2.4.0) | py | Runtime Error | 181 | 38768 | 254 | from itertools import accumulate as acc
N, x, *A = map(int, open(0).read().split())
dp = []
for i in range(N):
dp.append(list(acc((A[(i-j)%N] for j in range(N)),min)))
ans = 10**10
for i,a in enumerate(zip(*dp)):
ans = min(ans,i*x+sum(a))
print(ans) | Traceback (most recent call last):
File "/tmp/tmply5p26j0/tmplxl5zyj2.py", line 2, in <module>
N, x, *A = map(int, open(0).read().split())
^^^^^^^^
ValueError: not enough values to unpack (expected at least 2, got 0)
| |
s799130764 | p04006 | u476604182 | 1584561573 | Python | PyPy3 (2.4.0) | py | Runtime Error | 181 | 38256 | 256 | from itertools import accumulate as acc
N, x, *A = map(int, open('0').read().split())
dp = []
for i in range(N):
dp.append(list(acc((A[(i-j)%N] for j in range(N)),min)))
ans = 10**10
for i,a in enumerate(zip(*dp)):
ans = min(ans,i*x+sum(a))
print(ans) | Traceback (most recent call last):
File "/tmp/tmppi6bjena/tmpzgyb0j_2.py", line 2, in <module>
N, x, *A = map(int, open('0').read().split())
^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: '0'
| |
s987488288 | p04006 | u186838327 | 1583367013 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3192 | 1789 | def segfunc(x, y):
return min(x, y)
class segment_():
def __init__(self, init_val, n, segfunc):
self.ide_ele = 10**9+1
# num: n以上の最小の2のべき乗
self.num = 2**(n-1).bit_length()
self.seg = [self.ide_ele]*2*self.num
self.segfunc = segfunc
# set_val
for i in rang... | Traceback (most recent call last):
File "/tmp/tmph3nresag/tmpkm5hg9z9.py", line 62, in <module>
main()
File "/tmp/tmph3nresag/tmpkm5hg9z9.py", line 46, in main
n, x = list(map(int,sys.stdin.readline().split()))
^^^
NameError: name 'sys' is not defined
| |
s033913099 | p04006 | u298297089 | 1571703959 | Python | Python (3.4.3) | py | Runtime Error | 1326 | 3316 | 384 | n,x = map(int, input().split())
a = list(map(int, input().split()))
ans = 0
mx = 0
inf = float('INF')
for i in range(n):
mn = a[i]
con = a[i]
for j in range(i-n,i+1):
idx = (i-j)%n
if mn > a[idx] + (i-j) * x:
mn = a[idx] + (i-j) * x
con = a[idx]
if mx < t... | Traceback (most recent call last):
File "/tmp/tmplrkve5ax/tmpbzvtxhe0.py", line 1, in <module>
n,x = map(int, input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s813300931 | p04006 | u623687794 | 1570654417 | Python | PyPy3 (2.4.0) | py | Runtime Error | 166 | 38768 | 327 | n,x=map(int,input().split())
a=list(map(int,input().split()))
a*=2
INF=10**15
cost=[INF]*n
b=[(c,d) for i in enumerate(a)]
b.sort(key=lambda x:x[1])
start=b[0][1]
cost[start]=a[start]
for i in range(start+1,start+n):
cost[i%n]=min(cost[(i-1)%n]+x,cost[i%n])
ans=0
for i in cost:
if i==INF:continue
ans+=i
pri... | Traceback (most recent call last):
File "/tmp/tmpb4kp5_cs/tmp4mn8oetr.py", line 1, in <module>
n,x=map(int,input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s491888180 | p04006 | u143509139 | 1570488561 | Python | PyPy3 (2.4.0) | py | Runtime Error | 215 | 40688 | 239 | n, x = map(int, input().split())
a = list(map(int, input().split()))
d = a.copy()
ans = float('inf')
for i in range(n):
ans = min(ans, sum(d) + x * i)
for j in range(n):
d[j] = min(d[j], a[(j - (i + 1) + n) % n])
print(ans) | Traceback (most recent call last):
File "/tmp/tmp1eo6fcu6/tmprifg6c2o.py", line 1, in <module>
n, x = map(int, input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s403672941 | p04006 | u532966492 | 1564980871 | Python | Python (3.4.3) | py | Runtime Error | 26 | 3572 | 625 | from copy import deepcopy as dc
#n,x=map(int,input().split())
x=int(input()) #
a=list(map(int,input().split()))
n=len(a) #
a=[[i,i,0] for i in a]
aa=dc(a)
b=[]
m=0
while(b!=a):
b=dc(a)
for _ in range(2):
for i in range(n):
j=i-1
if j==-1:
j=n-1
if a[... | Traceback (most recent call last):
File "/tmp/tmp642zlcxh/tmpnd5blk0z.py", line 3, in <module>
x=int(input()) #
^^^^^^^
EOFError: EOF when reading a line
| |
s651188657 | p04006 | u532966492 | 1564980127 | Python | Python (3.4.3) | py | Runtime Error | 22 | 3444 | 603 | from copy import deepcopy as dc
#n,x=map(int,input().split())
x=int(input()) #
a=list(map(int,input().split()))
n=len(a) #
a=[[i,i,0] for i in a]
b=[]
m=0
while(b!=a):
b=dc(a)
for _ in range(2):
for i in range(n):
j=i-1
if j==-1:
j=n-1
if a[i][1]!=a[j... | Traceback (most recent call last):
File "/tmp/tmp7n7xz19h/tmpykv6ejsi.py", line 3, in <module>
x=int(input()) #
^^^^^^^
EOFError: EOF when reading a line
| |
s861315379 | p04006 | u623687794 | 1557517269 | Python | Python (3.4.3) | py | Runtime Error | 18 | 2940 | 104 | N,x = int(input().split())
a = sorted(list(map(int,input().split())))
print(min(N*a[0]+(N-1)*x,sum(a)))
| Traceback (most recent call last):
File "/tmp/tmpgu7x9z_a/tmpc048um9h.py", line 1, in <module>
N,x = int(input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s533169261 | p04006 | u095426154 | 1556331104 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 532 | n,x=map(int,input().split())
a=list(map(int,input().split()))
t=[a[i] for i in range(n)]
sp_cnt=[0 for i in range(n)]
for i in range(1,n):
if a[n-i]+i*x<t[0]:
t[0]=a[n-i]
sp_cnt[0]=i
for i in range(1,n):
for j in range(n):
if i-j>=0:
if a[i-j]+j*x<t[i]:
t[i]=... | File "/tmp/tmpf4c05w24/tmpe1qearlk.py", line 18
t[i]=a[n+(i-j)]
^
IndentationError: expected an indented block after 'if' statement on line 17
| |
s171621829 | p04006 | u095426154 | 1556331039 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 534 | n,x=map(int,input().split())
a=list(map(int,input().split()))
t=[a[i] for i in range(n)]
sp_cnt=[0 for i in range(n)]
for i in range(1,n):
if a[n-i]+i*x<t[0]:
t[0]=a[n-i]
sp_cnt[0]=i
for i in range(1,n):
for j in range(n):
if i-j>=0:
if a[i-j]+j*x<t[i]:
t[i]=... | File "/tmp/tmpzmi7hp49/tmp4uorqi6r.py", line 18
t[i]=a[n-(i-j)]
^
IndentationError: expected an indented block after 'if' statement on line 17
| |
s170961821 | p04006 | u095426154 | 1556329160 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 459 | n,x=map(int,input().split())
a=list(map(int,input().split()))
dp=[a[i] for i in range(n)]
sp_cnt[0 for i in range(n)]
for i in range(1,n):
if a[n-i]+i*x<dp[0]:
dp[0]=a[n-1]+i*x
sp_cnt[0]=i
for i in range(1,n):
for j in range(i):
if a[i-j]+j*x<dp[0]:
dp[i]=a[i-j]+j*x
... | File "/tmp/tmp74e18_sh/tmp90r_3x8m.py", line 4
sp_cnt[0 for i in range(n)]
^^^
SyntaxError: invalid syntax
| |
s887876342 | p04006 | u069838609 | 1554690964 | Python | PyPy3 (2.4.0) | py | Runtime Error | 172 | 38804 | 668 | import sys
fin = sys.stdin.readline
N, x = [int(elem) for elem in fin().split()]
a_list = [int(elem) for elem in fin().split()]
min_cost_for = a_list.copy()
this_is_from = list(range(N))
max_num_magics = 0
for i, a in enumerate(a_list):
for j, other_a in enumerate(a_list):
if i == j: continue
n... | Traceback (most recent call last):
File "/tmp/tmpsctv4l5b/tmphosvy39q.py", line 5, in <module>
N, x = [int(elem) for elem in fin().split()]
^^^^
ValueError: not enough values to unpack (expected 2, got 0)
| |
s263694653 | p04006 | u572144347 | 1554690779 | Python | PyPy3 (2.4.0) | py | Runtime Error | 212 | 39152 | 278 | N,X = map(int, input().split())
A = list(map(int, input().split()))
# ans = 10**13
ans = float("inf")
for k in range(N):
tmp = k * X
for i in range(2*N):
j = (i-k+N*4) % N
A[i] = min(A[i], A[j])
tmp += sum(A)
ans = min(ans, tmp)
print(ans)
| Traceback (most recent call last):
File "/tmp/tmpi9zdzft1/tmpfyh_k291.py", line 1, in <module>
N,X = map(int, input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s320733535 | p04006 | u555962250 | 1554420281 | Python | PyPy3 (2.4.0) | py | Runtime Error | 166 | 38384 | 289 | import numpy as np
N, x = map(int, input().split())
a = np.array(list(map(int, input().split())))
min_a = a.copy()
ans = 10 ** 18
for i in range(N):
s = x * i
for j in range(N):
min_a[j] = min(min_a[j], a[(i + j) % N])
s += min_a[j]
ans = min(ans, s)
print(ans) | Traceback (most recent call last):
File "/tmp/tmp_h3c9jz7/tmp98nxdqc8.py", line 2, in <module>
N, x = map(int, input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s792290457 | p04006 | u785578220 | 1552361207 | Python | Python (3.4.3) | py | Runtime Error | 163 | 12500 | 233 | import numpy as np
N, x = map(int, input().split())
a = np.array(map(int, input().split()))
b = np.copy(a)
ans = float('inf')
for i in range(N):
c = np.roll(a,i)
b = np.minimum(b,c)
ans = min(ans, sum(b)+i*x)
print(ans)
| Traceback (most recent call last):
File "/tmp/tmp5_xnt324/tmpckpdm9dm.py", line 2, in <module>
N, x = map(int, input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s582122424 | p04006 | u785578220 | 1552361192 | Python | PyPy3 (2.4.0) | py | Runtime Error | 184 | 38384 | 234 |
import numpy as np
N, x = map(int, input().split())
a = np.array(map(int, input().split()))
b = np.copy(a)
ans = float('inf')
for i in range(N):
c = np.roll(a,i)
b = np.minimum(b,c)
ans = min(ans, sum(b)+i*x)
print(ans)
| Traceback (most recent call last):
File "/tmp/tmpj_a3ox9v/tmpwwtttwc7.py", line 3, in <module>
N, x = map(int, input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s417303129 | p04006 | u785578220 | 1552361023 | Python | PyPy3 (2.4.0) | py | Runtime Error | 191 | 39664 | 248 | def inpl(): return [int(i) for i in input().split()]
import numpy as np
N, x = inpl()
a = np.array(inpl())
b = np.copy(a)
ans = float('inf')
for i in range(N):
c = np.roll(a,i)
b = np.minimum(b,c)
ans = min(ans, sum(b)+i*x)
print(ans)
| Traceback (most recent call last):
File "/tmp/tmpafxuktly/tmpupr8s9wf.py", line 3, in <module>
N, x = inpl()
^^^^^^
File "/tmp/tmpafxuktly/tmpupr8s9wf.py", line 1, in inpl
def inpl(): return [int(i) for i in input().split()]
^^^^^^^
EOFError: EOF when readi... | |
s903772612 | p04006 | u223904637 | 1551986927 | Python | Python (3.4.3) | py | Runtime Error | 22 | 3188 | 291 | n,x=map(int,input().split())
li=list(map(int,input().split()))
mi=min(li)
ind=-1
for i in range(n):
if mi==li[i]:
ind=i
ans=[0]*n
ans[0]=li[ind]
k=0
for i in range(1,n):
if ind+i>=n:
k=ind+i-n
else:
k=ind+i
ans[i]=min(li[k],ans[i-1]+x)
print(sun(ans)) | Traceback (most recent call last):
File "/tmp/tmp_z7pbw1z/tmpp5jvsila.py", line 1, in <module>
n,x=map(int,input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s729309097 | p04006 | u594567187 | 1551132421 | Python | PyPy3 (2.4.0) | py | Runtime Error | 189 | 39408 | 353 | loop, magic_cost = map(int, input().split(" "))
cost = [n for n in map(int, input().split(" "))]
answer = float("inf")
min_costs = [float(inf) for n in range(loop)]
for i in range(loop):
for j in range(loop):
min_costs[j] = min(min_costs[j], cost[(i - j) % loop])
answer = min(answer, sum(min_costs) + (m... | Traceback (most recent call last):
File "/tmp/tmpdoyin0x4/tmpkd_tr_63.py", line 1, in <module>
loop, magic_cost = map(int, input().split(" "))
^^^^^^^
EOFError: EOF when reading a line
| |
s864728423 | p04006 | u427344224 | 1548368896 | Python | PyPy3 (2.4.0) | py | Runtime Error | 177 | 38768 | 293 | N, x = map(int, input().split())
a_list = list(map(int, input().split()))
ex_list = a_list.copy()
ex_list.extend(a_list)
ans = float("inf")
for i in range(N):
cost = 0
for j in range(N):
cost += min(ex_list[N-i+j:N+1+j])
cost += x * i
ans = min(ans, cost)
print(ans)
| Traceback (most recent call last):
File "/tmp/tmp5crjjgwl/tmpr3ff03yh.py", line 1, in <module>
N, x = map(int, input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s059139194 | p04006 | u732285858 | 1531505124 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 1091 | #include <iostream>
#include <algorithm>
#include <cmath>
#include <map>
#include <vector>
#include <queue>
#include <functional>
#include <string>
#include <stack>
#include <set>
#include <sstream>
#include <iomanip>
#include <limits>
using namespace std;
using ll = long long;
typedef unsigned long long ull;
typedef p... | File "/tmp/tmpluocx6_9/tmpulr74335.py", line 14
using namespace std;
^^^^^^^^^
SyntaxError: invalid syntax
| |
s519734963 | p04006 | u582763758 | 1528567566 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 626 | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int mx = 4005;
const ll inf = 4e18;
ll dp[mx], rdp[mx];
ll a[mx];
ll x;
int n;
int main(){
ios_base::sync_with_stdio(false);cin.tie(0);
cin >> n >> x;
for(int i = 0; i < n; i++) cin >> a[i];
copy(a,a+n,a+n);
for(int i = 0; i... | File "/tmp/tmpsy0gcgmb/tmpxybsbxpt.py", line 2
using namespace std;
^^^^^^^^^
SyntaxError: invalid syntax
| |
s343344576 | p04006 | u132291455 | 1477170022 | Python | Python (2.7.6) | py | Runtime Error | 18 | 2812 | 195 | n,x=map(int,raw_input().split(" "))
a=map(int,raw_input().split(" "))
t=[i for i in a]
ans=10**10
for m in range(n):
t=[min(t[j],a[(j-m)%n]) for j in range(n)]
s=min(x*m+sum(t),s)
print s | File "/tmp/tmp_611eaeu/tmp01v6zm5u.py", line 8
print s
^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s770991907 | p04006 | u442810826 | 1473156612 | Python | Python (2.7.6) | py | Runtime Error | 1931 | 139240 | 232 | N, x = map(int, raw_input().split())
A = map(int, raw_input().split())
A = A+A
b = [[A[i-j]+x*j for i in range(N,2*N)] for j in range(N)]
c = [min(bb) for bb in b]
d = [bb.index(cc) for cc in c]
print sum(c) - x * (sum(d)-max(d))
| File "/tmp/tmpcqgn81nv/tmp6j2925z9.py", line 9
print sum(c) - x * (sum(d)-max(d))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s231282511 | p04006 | u124139453 | 1473136244 | Python | Python (3.4.3) | py | Runtime Error | 38 | 3064 | 396 | n, x = map(int, raw_input().split())
a = map(int, raw_input().split())
ans = 0
b = []
for k in range(n):
if k == 0:
b = a[:]
else:
for i in range(n):
b[i] = min(a[(i-k)%n],b[i])
cost = k*x+sum(b)
if k == 0:
ans = cost
else:
ans = min(ans,cost)
if a... | Traceback (most recent call last):
File "/tmp/tmpy_a0cx84/tmpyxe8oeq1.py", line 1, in <module>
n, x = map(int, raw_input().split())
^^^^^^^^^
NameError: name 'raw_input' is not defined
| |
s299481916 | p04006 | u124139453 | 1473135920 | Python | Python (2.7.6) | py | Runtime Error | 30 | 2804 | 399 | n, x = map(int, raw_input().split())
a = map(int, raw_input().split())
ans = 0
b = []
for k in range(n):
if k == 0:
b = a.copy()
else:
for i in range(n):
b[i] = min(a[(i-k)%n],b[i])
cost = k*x+sum(b)
if k == 0:
ans = cost
else:
ans = min(ans,cost)
... | File "/tmp/tmpf625xhhk/tmp9uwz483k.py", line 20
print ans
^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s499957980 | p04006 | u124139453 | 1473134714 | Python | Python (2.7.6) | py | Runtime Error | 32 | 2812 | 193 | n, x = map(int, raw_input().split())
a = map(int, raw_input().split())
b = a[:]
for k in range(n):
for i in range(n):
b[i] = min(a[i-k],b[i])
ans = min(ans,k*x+sum(b))
print ans | File "/tmp/tmpxs3nuadm/tmppeg5gw8n.py", line 8
print ans
^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s906934679 | p04006 | u601018334 | 1473129274 | Python | Python (3.4.3) | py | Runtime Error | 39 | 3064 | 412 | def solve_():
import itertools
N, x = map(int, input().split())
a = list(map(int, input().split()))
s_cost = a.copy()
cost = sum(s_cost)
for k, i in itertools.product(range(1, N), range(N)):
s_cost[i] = a[(i - k) % N] if s_cost > a[(i - k) % N] else s_cost[i]
if i == N - 1 and c... | Traceback (most recent call last):
File "/tmp/tmpuiep9uxi/tmp0q44ok18.py", line 15, in <module>
solve()
^^^^^
NameError: name 'solve' is not defined. Did you mean: 'solve_'?
| |
s804922815 | p04006 | u443010331 | 1473084208 | Python | Python (2.7.6) | py | Runtime Error | 31 | 2820 | 274 | import math
N, x = map(int, raw_input().split())
A = map(int, raw_input().split())
ans = 1e18
b = [[ans for i in range(N)]]
for k in range(N):
sum = k*x
for i in range(N):
b[i] = min(b[i], A[(i+N-k)%N])
sum += b[i]
ans = min(ans, sum)
print ans
| File "/tmp/tmpgo34y14c/tmpwn8tmxg6.py", line 13
print ans
^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s029745429 | p04006 | u601018334 | 1473069533 | Python | Python (3.4.3) | py | Runtime Error | 40 | 3188 | 290 | N, x = list(map(int, input().split()))
a = list(map(int, input().split()))
s_cost = a
cost = sum(s_cost)
for k in xrange(0,N):
s_cost = [min(s_cost[x],a[y]) for (x,y) in zip( list(xrange(N)), list(xrange(N-k,N))+list(xrange(N-k)) )]
cost = min(cost, k*x + sum(s_cost))
print(cost)
| Traceback (most recent call last):
File "/tmp/tmpb1rrzffj/tmp1dt8x21u.py", line 1, in <module>
N, x = list(map(int, input().split()))
^^^^^^^
EOFError: EOF when reading a line
| |
s755121868 | p04006 | u601018334 | 1473059257 | Python | Python (3.4.3) | py | Runtime Error | 38 | 3064 | 444 | N, x = list(map(int, input().split()))
a = list(map(int, input().split()))
min_index = a.index(min(a))
index_list = list(range(min_index,N)) + list(range(min_index))
cost = a.copy()
c_count = [0]*N
for i in range(1,N):
if cost[index_list[i]] => (cost[index_list[i-1]]+x):
cost[index_list[i]] = cost[index_lis... | File "/tmp/tmp8l9s3xna/tmp6xb44hsx.py", line 8
if cost[index_list[i]] => (cost[index_list[i-1]]+x):
^
SyntaxError: invalid syntax
| |
s464339687 | p04006 | u226155577 | 1473043350 | Python | Python (2.7.6) | py | Runtime Error | 30 | 2804 | 561 | n, x = map(int, raw_input().split())
A = map(int, raw_input().split())*2
ans = 10**18
for l in xrange(1, n+1):
deq = [0]*n
s = t = 0
res = 0
for i in xrange(n):
while s<t and A[deq[t-1]] >= A[i]:
t -= 1
deq[t] = i
t += 1
if deq[s] == i-l+1:
s += 1
... | File "/tmp/tmpp48j4rlc/tmpkhtn0pvh.py", line 26
print ans
^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s531836362 | p04006 | u457552420 | 1473040040 | Python | Python (2.7.6) | py | Runtime Error | 27 | 2568 | 536 | ef cast(curr, num):
arr = [(x+num) % N for x in curr]
return arr
def transform(curr, val):
ret = 0
while ((val-ret + N) % N) in curr:
ret += 1
return ret
N, x = map(int, raw_input().split())
a = map(int, raw_input().split())
curr = []
ans = 0
while len(curr) < N:
cost = list(a)
t... | File "/tmp/tmphqui3iyy/tmpn0grn1rt.py", line 1
ef cast(curr, num):
^^^^
SyntaxError: invalid syntax
| |
s475371819 | p04007 | u785989355 | 1560153592 | Python | Python (3.4.3) | py | Runtime Error | 19 | 3316 | 770 |
H,W = list(map(int,input().split()))
a = [input() for i in range(H)]
b = [[] for i in range(H)]
r = [[] for i in range(H)]
for i in range(H):
for j in range(W):
if i==0:
b[i].append("#")
r[i].append(".")
elif i==H-1:
b[i].append(".")
r[i].append("#"... | Traceback (most recent call last):
File "/tmp/tmpsd191cda/tmpke8_7hsx.py", line 2, in <module>
H,W = list(map(int,input().split()))
^^^^^^^
EOFError: EOF when reading a line
| |
s572223935 | p04007 | u091855288 | 1473104898 | Python | Python (2.7.6) | py | Runtime Error | 28 | 2696 | 679 | import numpy as np
import copy
a = map(int,raw_input().split())
H = a[0]
W = a[1]
A = []
for idx in xrange(H):
A.append( list(raw_input()) )
def textMap(A):
A = np.array(A, dtype='S')
A[A!='0'] = '#'
A[A=='0'] = '.'
texts = []
for vec in A:
texts.append( ''.join(vec) )
return '\n'.join(texts)
def m... | File "/tmp/tmp2x5yjhg0/tmpagxdbi_g.py", line 36
O[idx
^
SyntaxError: '[' was never closed
| |
s494501457 | p04008 | u794173881 | 1591232248 | Python | PyPy3 (2.4.0) | py | Runtime Error | 185 | 43000 | 1073 | import sys
def query(num):
# output
print("?", num)
sys.stdout.flush()
# input
res = input()
return res
ans = ""
while True:
if len(ans) == 0:
# 最上位桁のときは1からスタート
min_lim = 1
else:
min_lim = 0
for char in range(min_lim, 10):
tmp = ans + str(char)
... | Traceback (most recent call last):
File "/tmp/tmpuimaro0v/tmpl717_015.py", line 23, in <module>
res = query(tmp)
^^^^^^^^^^
File "/tmp/tmpuimaro0v/tmpl717_015.py", line 10, in query
res = input()
^^^^^^^
EOFError: EOF when reading a line
| ? 1
|
s296855272 | p04008 | u423585790 | 1590165133 | Python | PyPy3 (2.4.0) | py | Runtime Error | 1064 | 208616 | 406 | import sys
sys.setrecursionlimit(10**6)
n,k = map(int,input().split())
a = [int(i)-1 for i in input().split()]
edg = [[] for i in range(n)]
for i in range(1,n):
edg[a[i]].append(i)
ans = [0] * n
ans[0] = a[0] != 0
def dfs(now):
res = 0
for e in edg[now]:
res = max(res, dfs(e))
if res == k - 1 and a[e] != 0 ... | Traceback (most recent call last):
File "/tmp/tmpxpzothbi/tmp7l9jvusr.py", line 3, in <module>
n,k = map(int,input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s133781054 | p04008 | u423585790 | 1590163943 | Python | PyPy3 (2.4.0) | py | Runtime Error | 754 | 183276 | 413 | import sys
sys.setrecursionlimit(10**6)
n,k = map(int,input().split())
a = [int(i)-1 for i in input().split()]
edg = [[] for i in range(n)]
for i in range(n):
edg[a[i]].append(i)
ans = [0] * n
ans[0] = a[0] != 0
c = [1] * n
def dfs(now, rank):
c[now] = 0
for e in edg[now]:
if c[e]:
if rank == k:
... | Traceback (most recent call last):
File "/tmp/tmp7t79uogf/tmp4zws7pxq.py", line 3, in <module>
n,k = map(int,input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s267170474 | p04008 | u423585790 | 1590163470 | Python | PyPy3 (2.4.0) | py | Runtime Error | 172 | 38384 | 410 | import sys
sys.recursionlimit(10**6)
n,k = map(int,input().split())
a = [int(i)-1 for i in input().split()]
edg = [[] for i in range(n)]
for i in range(n):
edg[a[i]].append(i)
ans = [0] * n
ans[0] = a[0] != 0
c = [1] * n
def dfs(now, time):
c[now] = 0
for e in edg[now]:
if c[e]:
if time == k:
an... | Traceback (most recent call last):
File "/tmp/tmpk73qrpdn/tmp86pur_1u.py", line 2, in <module>
sys.recursionlimit(10**6)
^^^^^^^^^^^^^^^^^^
AttributeError: module 'sys' has no attribute 'recursionlimit'. Did you mean: 'getrecursionlimit'?
| |
s672630112 | p04008 | u423585790 | 1590163380 | Python | PyPy3 (2.4.0) | py | Runtime Error | 583 | 106608 | 373 | n,k = map(int,input().split())
a = [int(i)-1 for i in input().split()]
edg = [[] for i in range(n)]
for i in range(n):
edg[a[i]].append(i)
ans = [0] * n
ans[0] = a[0] != 0
c = [1] * n
def dfs(now, time):
c[now] = 0
for e in edg[now]:
if c[e]:
if time == k:
ans[e] = 1
dfs(e, 1)
else... | Traceback (most recent call last):
File "/tmp/tmpxhdcdevi/tmpozi_q9mc.py", line 1, in <module>
n,k = map(int,input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s817289383 | p04008 | u423585790 | 1590163020 | Python | PyPy3 (2.4.0) | py | Runtime Error | 564 | 103920 | 366 | n,k = map(int,input().split())
a = [int(i)-1 for i in input().split()]
edg = [[] for i in range(n)]
for i in range(n):
edg[a[i]].append(i)
ans = a[0] != 0
c = [1] * n
def dfs(now, time):
global ans
c[now] = 0
for e in edg[now]:
if c[e]:
if time == k:
ans += 1
dfs(e, 1)
else:
... | Traceback (most recent call last):
File "/tmp/tmp6qiqviao/tmptfjjow4_.py", line 1, in <module>
n,k = map(int,input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s692400564 | p04008 | u423585790 | 1590162888 | Python | PyPy3 (2.4.0) | py | Runtime Error | 569 | 103920 | 361 | n,k = map(int,input().split())
a = [int(i)-1 for i in input().split()]
edg = [[] for i in range(n)]
for i in range(n):
edg[a[i]].append(i)
ans = a[0] != 0
c = [1] * n
def dfs(now, time):
global ans
c[now] = 0
for e in edg[now]:
if c[e]:
if time == k:
ans += 1
dfs(e, 1)
else:
... | Traceback (most recent call last):
File "/tmp/tmpd0jvynp2/tmp8tked524.py", line 1, in <module>
n,k = map(int,input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s387298159 | p04008 | u488401358 | 1589624994 | Python | PyPy3 (2.4.0) | py | Runtime Error | 420 | 86640 | 512 | N,K=map(int,input().split())
a=list(map(int,input().split()))
a=[a[i]-1 for i in range(N)]
ans=int((a[0]!=0))
a[0]=0
depth=[-1 for i in range(N)]
depth[0]=0
def dfs(v):
if depth[v]!=-1:
return depth[v]
depth[v]=dfs(a[v])+1
return depth[v]
for i in range(1,N):
depth[i]=dfs(i)
if K!=1:
for i... | Traceback (most recent call last):
File "/tmp/tmp2ccjkm77/tmp9yjy6z2g.py", line 1, in <module>
N,K=map(int,input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s914803608 | p04008 | u528388170 | 1586294140 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 1189 | #include<bits/stdc++.h>
using namespace std;
const int SIZE = 100001;
priority_queue<pair<int, int>> D;//pair(depth, id)j
int P[SIZE];//parent, depth
vector<int> C[SIZE];//children
set<int> S;
void make_D(int id = 1, int depth = 0){
D.push(make_pair(depth, id));
for (int i = 0; i < C[id].size(); i++){
... | File "/tmp/tmpe6ckrcb3/tmp525h955t.py", line 2
using namespace std;
^^^^^^^^^
SyntaxError: invalid syntax
| |
s828945171 | p04008 | u638795007 | 1584759065 | Python | Python (3.4.3) | py | Runtime Error | 206 | 23660 | 3594 | def examA():
A, B, C = LI()
ans = min(A*B*(C%2),A*C*(B%2),B*C*(A%2))
print(ans)
return
def examB():
class segment_():
def __init__(self, A, n, segfunc):
#####単位元######要設定0or1orinf
self.ide_ele = inf
####################
self.num = 1 << (n - 1)... | Traceback (most recent call last):
File "/tmp/tmpwbbq8aou/tmpi1wlp88d.py", line 137, in <module>
examD()
File "/tmp/tmpwbbq8aou/tmpi1wlp88d.py", line 85, in examD
N, K = LI()
^^^^
ValueError: not enough values to unpack (expected 2, got 0)
| |
s422784900 | p04008 | u141610915 | 1584560794 | Python | PyPy3 (2.4.0) | py | Runtime Error | 190 | 38384 | 4380 | import sys
from collections import defaultdict as dd
from collections import deque as dq
input = sys.stdin.readline
sys.setrecursionlimimt(10 ** 6)
N, K = map(int, input().split())
a = list(map(int, input().split()))
if K >= N - 1:
print(int(a[0] != 1))
exit(0)
res = 0
if a[0] != 1:
a[0] = 1
res += 1
e = dd(set... | Traceback (most recent call last):
File "/tmp/tmpv1ic2f31/tmpl2e7eejr.py", line 5, in <module>
sys.setrecursionlimimt(10 ** 6)
^^^^^^^^^^^^^^^^^^^^^^
AttributeError: module 'sys' has no attribute 'setrecursionlimimt'. Did you mean: 'setrecursionlimit'?
| |
s503969334 | p04008 | u141610915 | 1584560751 | Python | PyPy3 (2.4.0) | py | Runtime Error | 1063 | 139156 | 4348 | import sys
from collections import defaultdict as dd
from collections import deque as dq
input = sys.stdin.readline
N, K = map(int, input().split())
a = list(map(int, input().split()))
if K >= N - 1:
print(int(a[0] != 1))
exit(0)
res = 0
if a[0] != 1:
a[0] = 1
res += 1
e = dd(set)
for i in range(N):
e[a[i]].a... | Traceback (most recent call last):
File "/tmp/tmpzuoiefaf/tmp9xrpprrd.py", line 5, in <module>
N, K = map(int, input().split())
^^^^
ValueError: not enough values to unpack (expected 2, got 0)
| |
s301392105 | p04008 | u693716675 | 1583624445 | Python | Python (3.4.3) | py | Runtime Error | 189 | 22892 | 493 | #d tree
n,k = [int(i) for i in input().split()]
a = [int(i)-1 for i in input().split()]
#this is directed tree so every node is not reached yet
def dfs(u, d):
change = 0
if d>k:
d = 1
change += 1
for v in edges[u]:
if u!=v:
change += dfs(v, d+1)
return change
... | Traceback (most recent call last):
File "/tmp/tmpp8dyksp6/tmpqy30mc2p.py", line 2, in <module>
n,k = [int(i) for i in input().split()]
^^^^^^^
EOFError: EOF when reading a line
| |
s261641075 | p04008 | u693716675 | 1583624395 | Python | Python (3.4.3) | py | Runtime Error | 186 | 22896 | 510 | #d tree
n,k = [int(i) for i in input().split()]
a = [int(i)-1 for i in input().split()]
#this is directed tree so every node is not reached yet
def dfs(u, d):
change = 0
if d>k:
d = 1
change += 1
for v in edges[u]:
if u==v:
continue
change += dfs(v, d+1)
... | Traceback (most recent call last):
File "/tmp/tmpkxl_f8pv/tmpndez2dsm.py", line 2, in <module>
n,k = [int(i) for i in input().split()]
^^^^^^^
EOFError: EOF when reading a line
| |
s245349810 | p04008 | u693716675 | 1583624173 | Python | Python (3.4.3) | py | Runtime Error | 184 | 22896 | 459 | #d tree
n,k = [int(i) for i in input().split()]
a = [int(i)-1 for i in input().split()]
#this is directed tree so every node is not reached yet
def dfs(u, d):
change = 0
if d>k:
d = 1
change += 1
for v in edges[u]:
change += dfs(v, d+1)
return change
cnt = 0
if a[0]!=0:
... | Traceback (most recent call last):
File "/tmp/tmps0d2mh24/tmpe4_66rv1.py", line 2, in <module>
n,k = [int(i) for i in input().split()]
^^^^^^^
EOFError: EOF when reading a line
| |
s670454131 | p04008 | u310678820 | 1572400112 | Python | PyPy3 (2.4.0) | py | Runtime Error | 422 | 83948 | 2346 | class BIT:
def __init__(self, n):
self.N = n
self.n = 1<<n.bit_length()
self.data = [0] * (self.n + 1)
self.num = 0#要素の個数(multisetの代用として使う場合のみ)
def sum(self, i):
s = 0
while i > 0:
s += self.data[i]
i -= i & -i
return s
def add... | Traceback (most recent call last):
File "/tmp/tmp8j4_nxy7/tmpiyu5sv9l.py", line 46, in <module>
N, K = map(int, input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s145677221 | p04008 | u102461423 | 1569053874 | Python | Python (3.4.3) | py | Runtime Error | 577 | 60900 | 1125 | import sys
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10 ** 7)
N,K = map(int,readline().split())
A = [int(x)-1 for x in readline().split()]
desc_edge = [set() for _ in range(N)]
parent = [0] * N
for i,x in enumerate(A[1:],1):
# 根から葉に向かう向きに辺を持つ
desc_edge[x].add(i)
p... | Traceback (most recent call last):
File "/tmp/tmp6m4c37lo/tmpsqnnefs_.py", line 6, in <module>
N,K = map(int,readline().split())
^^^
ValueError: not enough values to unpack (expected 2, got 0)
| |
s356756873 | p04008 | u229621546 | 1555374201 | Python | Python (3.4.3) | py | Runtime Error | 190 | 22904 | 344 | N,M = map(int,input().split())
L = list(map(int,input().split()))
l = [[] for i in range(N)]
ans = 0 if L[0] == 1 else 1
L[0] = 0
for i in range(1,len(L)):
l[L[i] - 1].append(i)
def search(ind,a):
global ans
if a > M:
ans += 1
a = 0
if len(l[ind]) == 0:
return
for i in l[ind]:
search(i,a+1)... | Traceback (most recent call last):
File "/tmp/tmpdutlt2a6/tmpr9e2oxu1.py", line 1, in <module>
N,M = map(int,input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s226688517 | p04008 | u316386814 | 1553370889 | Python | Python (3.4.3) | py | Runtime Error | 596 | 143468 | 899 | import sys
sys.setrecursionlimit(10**7)
INF = 10 ** 18
MOD = 10 ** 9 + 7
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x) - 1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
de... | Traceback (most recent call last):
File "/tmp/tmpjsry6nbc/tmp5jed2tw3.py", line 36, in <module>
print(main())
^^^^^^
File "/tmp/tmpjsry6nbc/tmp5jed2tw3.py", line 15, in main
N, K = LI()
^^^^
ValueError: not enough values to unpack (expected 2, got 0)
| |
s558774156 | p04008 | u745087332 | 1551860939 | Python | Python (3.4.3) | py | Runtime Error | 277 | 29216 | 1197 | # coding:utf-8
import sys
from collections import defaultdict, deque
INF = float('inf')
MOD = 10 ** 9 + 7
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x) - 1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): r... | Traceback (most recent call last):
File "/tmp/tmp_90fjmeb/tmpxdl8w0gs.py", line 51, in <module>
print(main())
^^^^^^
File "/tmp/tmp_90fjmeb/tmpxdl8w0gs.py", line 19, in main
n, k = LI()
^^^^
ValueError: not enough values to unpack (expected 2, got 0)
| |
s338050014 | p04008 | u884982181 | 1543722795 | Python | PyPy3 (2.4.0) | py | Runtime Error | 1069 | 206372 | 670 | import sys
sys.setrecursionlimit(200000)
n,k = map(int,input().split())
a = list(map(int,input().split()))
ans = 0
if a[0] != 1:
a[0] = 1
ans += 1
b = [[]for i in range(n)]
for i in range(n):
b[a[i]-1].append(i)
b[0].remove(0)
huka = 0
kyo = [float("inf")] * n
def dfs(x,y):
kyo[x] = y
for i in b[x]:
dfs(i... | Traceback (most recent call last):
File "/tmp/tmpgg9783m9/tmp4y283hzy.py", line 3, in <module>
n,k = map(int,input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s469457677 | p04008 | u884982181 | 1543720565 | Python | PyPy3 (2.4.0) | py | Runtime Error | 556 | 103024 | 391 | n,k = map(int,input().split())
a = list(map(int,input().split()))
ans = 0
if a[0] != 1:
a[0] = 1
ans += 1
b = [[]for i in range(n)]
for i in range(n):
b[a[i]-1].append(i)
b[0].remove(0)
kyo = [float("inf")] * n
def dfs(x,y,z):
if y>k and z == 0:
y= 0
z = 1
if y > k-1 and z == 1:
y = 0
kyo[x] = y... | Traceback (most recent call last):
File "/tmp/tmpyjlr7yne/tmp7usi6zwf.py", line 1, in <module>
n,k = map(int,input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s048039210 | p04011 | u910358825 | 1601287319 | Python | Python (3.8.2) | py | Runtime Error | 23 | 8968 | 93 | n,k,x,y=[int(input()) for i in range(n)]
if k<=x:
print(n*k)
else:
print(k*x+(n-k)*y) | Traceback (most recent call last):
File "/tmp/tmp9ghirf2n/tmp_3_7isbb.py", line 1, in <module>
n,k,x,y=[int(input()) for i in range(n)]
^
NameError: name 'n' is not defined
| |
s629893841 | p04011 | u401183062 | 1601226552 | Python | Python (3.8.2) | py | Runtime Error | 23 | 8940 | 182 | n, k, price, special = map(int, input().split())
result = 0
for i in range(n):
if i < k:
result += price
else:
result += special
| File "/tmp/tmpjfylg0ha/tmpj9qv4can.py", line 1
n, k, price, special = map(int, input().split())
IndentationError: unexpected indent
| |
s292877404 | p04011 | u401183062 | 1601226494 | Python | Python (3.8.2) | py | Runtime Error | 27 | 9000 | 205 | n, k, price, special = map(int, input().split())
result = 0
for i in range(n):
if i < k:
result += price
else:
result += special
print(result)
| File "/tmp/tmp7yq5hdsi/tmpgpsnpjrg.py", line 1
n, k, price, special = map(int, input().split())
IndentationError: unexpected indent
| |
s028146518 | p04011 | u401183062 | 1601226450 | Python | Python (3.8.2) | py | Runtime Error | 25 | 9064 | 271 | def iroha():
n, k, price, special = map(int, input().split())
result = 0
for i in range(n):
if i < k:
result += price
else:
result += special
print(result)
if __name__ == "__main__":
iroha()
| Traceback (most recent call last):
File "/tmp/tmp3wodfu25/tmpgriu45ba.py", line 14, in <module>
iroha()
File "/tmp/tmp3wodfu25/tmpgriu45ba.py", line 2, in iroha
n, k, price, special = map(int, input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s736676162 | p04011 | u401183062 | 1601226308 | Python | Python (3.8.2) | py | Runtime Error | 24 | 9080 | 269 | def iroha():
n, k, price, special = map(int, input().split())
result = 0
for i in range(n):
if i < k:
result += price
else:
result += special
print(result)
if __name__ == "__main__":
iroha() | Traceback (most recent call last):
File "/tmp/tmpiesrjm3o/tmpr0k4bpsx.py", line 14, in <module>
iroha()
File "/tmp/tmpiesrjm3o/tmpr0k4bpsx.py", line 2, in iroha
n, k, price, special = map(int, input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s915700251 | p04011 | u401183062 | 1601226264 | Python | Python (3.8.2) | py | Runtime Error | 25 | 8944 | 199 | n, k, price, special = map(int, input().split())
result = 0
for i in range(n):
if i < k:
result += price
else:
result += special
print(result) | File "/tmp/tmpiryppwdx/tmpdilh0c8b.py", line 2
result = 0
IndentationError: unexpected indent
| |
s437177764 | p04011 | u847033024 | 1599987880 | Python | Python (3.8.2) | py | Runtime Error | 23 | 8956 | 145 | a = int(input())
b = int(input())
c = int(input())
d = int(input())
x = a - b
y = b * c
z = x * d
if a > b:
print(y + z)
else:
print(y) | File "/tmp/tmp123a6c60/tmpta1fejs3.py", line 5
x = a - b
IndentationError: unexpected indent
| |
s629950488 | p04011 | u231198419 | 1599333978 | Python | Python (3.8.2) | py | Runtime Error | 26 | 8800 | 89 | N,K,X,Y=[int(input()) for i in range(4)]
if(K>N):
N=K
else:
Z=K*X+(N-K)*Y
print(Z) | File "/tmp/tmpv3_30xq1/tmpohkuux_h.py", line 8
Z=K*X+(N-K)*Y
^
IndentationError: expected an indented block after 'else' statement on line 5
| |
s608595389 | p04011 | u546132222 | 1599101840 | Python | Python (3.8.2) | py | Runtime Error | 28 | 9160 | 340 | # abc044_a
# https://atcoder.jp/contests/abc044/tasks/abc044_a
# 最初のK泊までは、X円
# K+1泊目以降は、Y円
# N泊連続で宿泊した際の宿泊費
# 入力
n, k, x, y = map(int, input().split())
# 処理
# x円とy円
if n > k:
answer = k * x + (n - k) * y
# x円のみ
else:
answer = n * x
print(answer)
| Traceback (most recent call last):
File "/tmp/tmp6g5ealgo/tmp51gobdnc.py", line 10, in <module>
n, k, x, y = map(int, input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s493889273 | p04011 | u147912476 | 1598621439 | Python | Python (3.8.2) | py | Runtime Error | 22 | 9032 | 141 | k, x, y, n = map(int, input().split())
if n <= k:
print(n * x)
else:
print(k*x+(n-k)*y)
# 演算子の左右に空白を入れる! | Traceback (most recent call last):
File "/tmp/tmprrtyuebn/tmp791pv_26.py", line 1, in <module>
k, x, y, n = map(int, input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s806870973 | p04011 | u668271522 | 1598589442 | Python | Python (3.8.2) | py | Runtime Error | 24 | 9096 | 85 | N,K,X,Y= map(int, input().split())
yen1 = K * X
yen2 = (N - K) * Y
print(yen1 + yen2) | Traceback (most recent call last):
File "/tmp/tmpiwmp18hr/tmpby2xxjo6.py", line 1, in <module>
N,K,X,Y= map(int, input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s381321669 | p04011 | u003505857 | 1598532614 | Python | Python (3.8.2) | py | Runtime Error | 27 | 9020 | 120 |
N, K, X, Y = map(int, input().split())
a = N * X
b = K * X + (N - K) * Y
if N <= K:
print(a)
else:
print(b) | Traceback (most recent call last):
File "/tmp/tmpf5k6ih1n/tmpxy0ye4rc.py", line 3, in <module>
N, K, X, Y = map(int, input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s055856568 | p04011 | u003505857 | 1598532518 | Python | Python (3.8.2) | py | Runtime Error | 27 | 9148 | 118 |
N, K, X, Y = map(int, input().split())
a = N * X
b = K * X + (N - K) * Y
if N < K:
print(a)
else:
print(b) | Traceback (most recent call last):
File "/tmp/tmp6k_lu95v/tmpzfycilf1.py", line 2, in <module>
N, K, X, Y = map(int, input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s536662385 | p04011 | u808569469 | 1598404118 | Python | Python (3.8.2) | py | Runtime Error | 25 | 9084 | 104 | N, K, X, Y = map(int, input().split())
if N <= K:
print(N * X)
else:
print(K * X + (N - K) * Y) | Traceback (most recent call last):
File "/tmp/tmpt6u5g07p/tmp578sumzm.py", line 1, in <module>
N, K, X, Y = map(int, input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s174070998 | p04011 | u808569469 | 1598403962 | Python | Python (3.8.2) | py | Runtime Error | 24 | 8960 | 104 | n, k, x, y = map(int, input().split())
if n <= k:
print(n * x)
else:
print(k * x + (n - k) * y) | Traceback (most recent call last):
File "/tmp/tmpcxh_2lcr/tmpi7z1d8g0.py", line 1, in <module>
n, k, x, y = map(int, input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s788929143 | p04011 | u808569469 | 1598403416 | Python | Python (3.8.2) | py | Runtime Error | 26 | 9160 | 110 | n, k, x, y = map(int, input().split())
if n <= k:
print(n * x)
else:
print(k * x + (n - k) * y)
| Traceback (most recent call last):
File "/tmp/tmpufn2pd3i/tmpf0a9f5nj.py", line 1, in <module>
n, k, x, y = map(int, input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s601660667 | p04011 | u808569469 | 1598402843 | Python | Python (3.8.2) | py | Runtime Error | 23 | 9060 | 105 | n, k, x, y = map(int, input().split())
if n <= k:
print(k * x)
else:
print(k * x + (n - k) * y)
| Traceback (most recent call last):
File "/tmp/tmpl1vx4tah/tmpam8nvt0a.py", line 1, in <module>
n, k, x, y = map(int, input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s229333446 | p04011 | u003505857 | 1598365512 | Python | Python (3.8.2) | py | Runtime Error | 26 | 9156 | 107 | N, K, X, Y, = map(int, input().split())
if N <= K:
print(N * X)
else:
print(K * X + (N - K) * Y)
| Traceback (most recent call last):
File "/tmp/tmppe8f_t9b/tmp4obfrp7t.py", line 1, in <module>
N, K, X, Y, = map(int, input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s242513630 | p04011 | u003505857 | 1598365369 | Python | Python (3.8.2) | py | Runtime Error | 27 | 9148 | 148 | N, K, X, Y, = map(int, input().split())
if N <= K:
answer = N * X
print(answer)
else:
answer = K * X + (N - K) * Y
print(answer)
| Traceback (most recent call last):
File "/tmp/tmpkhsy669q/tmpmige5sme.py", line 1, in <module>
N, K, X, Y, = map(int, input().split())
^^^^^^^
EOFError: EOF when reading a line
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.