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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
s213594269 | p02270 | u003309334 | 1465636209 | Python | Python | py | Runtime Error | 10 | 6316 | 1200 | def moveRight(trug, start, stop):
if trug[start][1]-trug[start][0] > 1:
for i in xrange(stop-start):
trug[start+i][1] -= 1
trug[start+i+1][0] -= 1
def moveLeft(trug, start, stop):
if trug[start][1]-trug[start][0] > 1:
for i in xrange(start-stop):
trug[start-i... | File "/tmp/tmpjay9hszm/tmpeikxkdi3.py", line 50
print maxt
^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s026182379 | p02270 | u003309334 | 1465636914 | Python | Python | py | Runtime Error | 10 | 6412 | 1253 | def moveRight(trug, start, stop):
if trug[start][1]-trug[start][0] > 1:
for i in xrange(stop-start):
trug[start+i][1] -= 1
trug[start+i+1][0] -= 1
def moveLeft(trug, start, stop):
if trug[start][1]-trug[start][0] > 1:
for i in xrange(start-stop):
trug[start-i... | File "/tmp/tmpvkcj149_/tmp48aohutu.py", line 53
print maxt
^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s572610520 | p02270 | u742013327 | 1477383138 | Python | Python3 | py | Runtime Error | 0 | 0 | 500 | def cal(truck_num, cargos):
p = []
for i in range(len(cargos) - truck_num + 1):
if truck_num > 1:
p.append(max(sum(cargos[:i + 1]), cal(truck_num - 1, cargos[i + 1:])))
else:
return sum(cargos)
return min(p)
if __name__ == "__main__":
line = input()
truc... | Traceback (most recent call last):
File "/tmp/tmp0ak2azww/tmpaaw4pp6v.py", line 12, in <module>
line = input()
^^^^^^^
EOFError: EOF when reading a line
| |
s076856852 | p02270 | u742013327 | 1477383165 | Python | Python3 | py | Runtime Error | 0 | 0 | 500 | def cal(truck_num, cargos):
p = []
for i in range(len(cargos) - truck_num + 1):
if truck_num > 1:
p.append(max(sum(cargos[:i + 1]), cal(truck_num - 1, cargos[i + 1:])))
else:
return sum(cargos)
return min(p)
if __name__ == "__main__":
line = input()
truc... | Traceback (most recent call last):
File "/tmp/tmp8tmp2efr/tmpws5j7vb7.py", line 12, in <module>
line = input()
^^^^^^^
EOFError: EOF when reading a line
| |
s210396853 | p02270 | u659302741 | 1478163733 | Python | Python3 | py | Runtime Error | 60 | 7796 | 1578 | def calc_k(p, ws):
k = 1
s = 0
for w in ws:
if w > p:
return None
elif s + w <= p:
s += w
else:
k += 1
s = w
return k
def search_minimum_p_internal(lp, rp, k, ws):
"?????????P????????????????????¢?´¢??????"
cp = (lp + rp) /... | Traceback (most recent call last):
File "/tmp/tmpwaz7hn1_/tmpk2qr1x0b.py", line 45, in <module>
n, k = map(int, input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s237093572 | p02270 | u358919705 | 1478515750 | Python | Python3 | py | Runtime Error | 50 | 7732 | 516 | n, k = map(int, input().split())
ww = [int(input()) for _ in range(n)]
def chk(p):
c = 1
s = 0
for w in ww:
if w > p:
return False
if s + w <= p:
s += w
else:
c += 1
s = w
return c <= k
def search(l, r):
if r - l < 10:
f... | Traceback (most recent call last):
File "/tmp/tmpwno08dw8/tmpwi2rsqno.py", line 1, in <module>
n, k = map(int, input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s484015856 | p02270 | u358919705 | 1478516054 | Python | Python3 | py | Runtime Error | 20 | 7756 | 557 | n, k = map(int, input().split())
ww = [int(input()) for _ in range(n)]
def chk(p):
c = 1
s = 0
for w in ww:
if w > p:
return False
if s + w <= p:
s += w
else:
c += 1
s = w
if c > k:
return False
return True
def s... | Traceback (most recent call last):
File "/tmp/tmp3hmvqsg7/tmp6bzla_f8.py", line 1, in <module>
n, k = map(int, input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s769757037 | p02270 | u742013327 | 1481621719 | Python | Python3 | py | Runtime Error | 0 | 0 | 863 | #http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ALDS1_9_B
#???????????? 17:55~
def maxHeapify(heap, index):
left_index = 2 * index
right_index = 2 * index + 1
if left_index < len(heap) and heap[left_index] > heap[index]:
largest_index = left_index
else:
largest_index = index
... | Traceback (most recent call last):
File "/tmp/tmpiplyzbp0/tmppad76hot.py", line 29, in <module>
main()
File "/tmp/tmpiplyzbp0/tmppad76hot.py", line 21, in main
n_node = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s042335981 | p02270 | u923668099 | 1484475997 | Python | Python3 | py | Runtime Error | 20 | 7920 | 1557 | import sys
import math
def is_capable(n, k, w, P):
track = 0
cnt = 0
i = 0
while cnt < k:
if i == n:
return True
if track + w[i] > P:
track = 0
cnt += 1
else:
track += w[i]
i += 1
return False
pass
# ??\????... | Traceback (most recent call last):
File "/tmp/tmptfei9m0r/tmptf0g1xig.py", line 24, in <module>
n, k = map(int, sys.stdin.readline().split())
^^^^
ValueError: not enough values to unpack (expected 2, got 0)
| |
s118948428 | p02270 | u089830331 | 1484672034 | Python | Python3 | py | Runtime Error | 40 | 7776 | 719 | def get_min_p(offset, length, k, arr):
if k == 2:
min_diff = 100
p = 0
for i in range(1, length):
a = sum(arr[offset:offset + i])
b = sum(arr[offset + i:])
if abs(a - b) < min_diff:
min_diff = abs(a - b)
p = max(a, b)
#print("arr:{}, i:{}, p:{}".format(
# arr... | Traceback (most recent call last):
File "/tmp/tmpw14pz5az/tmpk13z14ai.py", line 23, in <module>
n, k = map(int, input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s730459727 | p02270 | u918276501 | 1485111812 | Python | Python3 | py | Runtime Error | 0 | 0 | 515 | import sys
n, k = map(int, input().split())
w = tuple(map(int, sys.stdin.readlines()))
w = tuple(map(int, input().split()))
p = max(w)
s = sum(w)
if n <= k:
print(p)
elif k == 1:
print(s)
else:
a = max(p, s//k)
while True:
l = [a]
for i in range(n):
d = l[-1] - w[i]
... | Traceback (most recent call last):
File "/tmp/tmp7bg4ho60/tmpwffu5gvr.py", line 2, in <module>
n, k = map(int, input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s318443766 | p02270 | u148628801 | 1487138414 | Python | Python3 | py | Runtime Error | 0 | 0 | 797 | import sys
import math
def be_able_to_convey(w, k, p):
counter = 0
cur_weight = 0
for wi in w:
if wi > p:
return False
cur_weight += wi
if(cur_weight > p):
cur_weight = wi
counter += 1
if(counter >= k):
return False
return True
fin = open("test.txt", "r")
#fin = sys.stdin
n, k = map(int,... | Traceback (most recent call last):
File "/tmp/tmp1xqvsc5p/tmp8qmtfqdg.py", line 20, in <module>
fin = open("test.txt", "r")
^^^^^^^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: 'test.txt'
| |
s094479657 | p02270 | u831244171 | 1487341046 | Python | Python3 | py | Runtime Error | 20 | 7684 | 770 | import sys
def binarySearch(t,w,p):
left = 0
right = p
while left < right:
middle = (left + right) // 2
if hantei(t,w,middle):
left = middle + 1
else:
right = middle
return left
def hantei(t,w,p):
track_on = [0]*t
j = 0
for i in r... | Traceback (most recent call last):
File "/tmp/tmp9f1xlvs7/tmp27j3uhu9.py", line 31, in <module>
nimotsu, track = map(int,input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s077455999 | p02270 | u086566114 | 1488466327 | Python | Python | py | Runtime Error | 0 | 0 | 2267 | # -*- coding: utf-8 -*-
def check_numbers(cargo_weight_list, number_of_all_cargo, number_of_tracks, maximum_weight):
"""check the numbers that are loadable in tracks
Args:
cargo_weight_list: cargo weight list
number_of_tracks: the number of tracks
Returns:
the number ... | File "/tmp/tmpfio42iyt/tmptffdg0cy.py", line 64
print find_the_minimum_of_maximum_weihgt(cargo_weight_list, number_of_all_cargo, number_of_tracks)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mea... | |
s473266969 | p02270 | u086566114 | 1488466881 | Python | Python | py | Runtime Error | 0 | 0 | 2267 | # -*- coding: utf-8 -*-
def check_numbers(cargo_weight_list, number_of_all_cargo, number_of_tracks, maximum_weight):
"""check the numbers that are loadable in tracks
Args:
cargo_weight_list: cargo weight list
number_of_tracks: the number of tracks
Returns:
the number ... | File "/tmp/tmpdue4mzbn/tmpkrug182i.py", line 64
print find_the_minimum_of_maximum_weight(cargo_weight_list, number_of_all_cargo, number_of_tracks)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mea... | |
s005436432 | p02270 | u130834228 | 1490521096 | Python | Python3 | py | Runtime Error | 0 | 0 | 219 | n, k = map(int, input().split())
w = [0 for i in range(n)]
sumw = [0 for i in range(k)]
for i in range(n):
w[i] = input()
w.sort()
w.reverse()
for i in range(w):
sumw[min(sumw.index)] += w[i]
print(min(sumw)) | Traceback (most recent call last):
File "/tmp/tmp392d1pgw/tmp3nu0lx2x.py", line 1, in <module>
n, k = map(int, input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s573185945 | p02270 | u279605379 | 1499669598 | Python | Python3 | py | Runtime Error | 0 | 0 | 512 | #ALDS1_4-D Allocation
from collections import deque
def pIsAccptbl(w,k,p):
tr = 0
c = 0
while(w):
tmp = w.popleft()
if( tr + tmp > p):
tr = 0
c += 1
else:
tr += tmp
c+=1
if c>k:return False
else:return True
n,k = input().split()
w... | Traceback (most recent call last):
File "/tmp/tmptf_ynddq/tmp2ric1utc.py", line 18, in <module>
n,k = input().split()
^^^^^^^
EOFError: EOF when reading a line
| |
s484588951 | p02270 | u279605379 | 1499669820 | Python | Python3 | py | Runtime Error | 0 | 0 | 530 | from collections import deque
def pIsAccptbl(w,k,p):
tr = 0
c = 0
while(w):
print(c,tr)
tmp = w.popleft()
if( tr + tmp > p):
tr = tmp
c += 1
else:
tr += tmp
c+=1
if c>k:return False
else:return True
n,k = input().split()
... | Traceback (most recent call last):
File "/tmp/tmpaocg05pw/tmpl260719y.py", line 19, in <module>
n,k = input().split()
^^^^^^^
EOFError: EOF when reading a line
| |
s448922612 | p02270 | u279605379 | 1499669947 | Python | Python3 | py | Runtime Error | 0 | 0 | 562 | #ALDS1_4-D Allocation
from collections import deque
def pIsAccptbl(w,k,p):
tr = 0
c = 0
while(w):
print(c,tr)
tmp = w.popleft()
if( tr + tmp > p):
tr = tmp
c += 1
else:
tr += tmp
c+=1
if c>k:return False
else:return True
... | Traceback (most recent call last):
File "/tmp/tmp19pgge78/tmpx96b8b6x.py", line 20, in <module>
n,k = input().split()
^^^^^^^
EOFError: EOF when reading a line
| |
s098973491 | p02270 | u279605379 | 1499670325 | Python | Python3 | py | Runtime Error | 0 | 0 | 508 | #ALDS1_4-D Allocation
from collections import deque
def pIsAccptbl(w,k,p):
tr = 0
c = 0
while(w):
tmp = w.popleft()
if( tr + tmp > p):
tr = tmp
c += 1
else:
tr += tmp
c+=1
if c>k:return False
else:return True
n,k = input().split(... | Traceback (most recent call last):
File "/tmp/tmpkyg_9nl_/tmpv1uh3n1p.py", line 19, in <module>
n,k = input().split()
^^^^^^^
EOFError: EOF when reading a line
| |
s010555079 | p02270 | u279605379 | 1499670356 | Python | Python3 | py | Runtime Error | 0 | 0 | 492 | #ALDS1_4-D Allocation
import collections
def pIsAccptbl(w,k,p):
tr = 0
c = 0
while(w):
tmp = w.popleft()
if( tr + tmp > p):
tr = tmp
c += 1
else:
tr += tmp
c+=1
if c>k:return False
else:return True
n,k = input().split()
w = colle... | Traceback (most recent call last):
File "/tmp/tmp6w3wfcmh/tmpdfuryn8j.py", line 19, in <module>
n,k = input().split()
^^^^^^^
EOFError: EOF when reading a line
| |
s667300575 | p02270 | u279605379 | 1499670417 | Python | Python3 | py | Runtime Error | 0 | 0 | 28 | from collectins import deque | Traceback (most recent call last):
File "/tmp/tmp4uajizfn/tmpgj43v7ph.py", line 1, in <module>
from collectins import deque
ModuleNotFoundError: No module named 'collectins'
| |
s026867857 | p02270 | u279605379 | 1499670446 | Python | Python3 | py | Runtime Error | 0 | 0 | 37 | from collectins import deque
print(1) | Traceback (most recent call last):
File "/tmp/tmp7fv544dp/tmp7pnd36oi.py", line 1, in <module>
from collectins import deque
ModuleNotFoundError: No module named 'collectins'
| |
s426923394 | p02270 | u279605379 | 1499670508 | Python | Python3 | py | Runtime Error | 0 | 0 | 538 | #ALDS1_4-D Allocation
from collections import deque
def pIsAccptbl(w,k,p):
tr = 0
c = 0
while(w):
tmp = w.popleft()
if( tr + tmp > p):
tr = tmp
c += 1
else:
tr += tmp
c+=1
if c>k:
return False
else:
return True
n,... | Traceback (most recent call last):
File "/tmp/tmp1scclo_o/tmp5_g0z185.py", line 21, in <module>
n,k = input().split()
^^^^^^^
EOFError: EOF when reading a line
| |
s858728779 | p02270 | u279605379 | 1499670685 | Python | Python3 | py | Runtime Error | 0 | 0 | 523 | from collections import deque
def pIsAccptbl(w,k,p):
tr = 0
c = 0
while(w):
tmp = w.popleft()
if( tr + tmp > p):
tr = tmp
c += 1
else:
tr += tmp
c+=1
if c>k:
return False
else:
return True
n,k = input().split()
w ... | Traceback (most recent call last):
File "/tmp/tmpuzi7i7q7/tmpvpq_2o9i.py", line 20, in <module>
n,k = input().split()
^^^^^^^
EOFError: EOF when reading a line
| |
s881376055 | p02270 | u279605379 | 1499670697 | Python | Python3 | py | Runtime Error | 0 | 0 | 524 | from collections import deque
def pIsAccptbl(w,k,p):
tr = 0
c = 0
while(w):
tmp = w.popleft()
if( tr + tmp > p):
tr = tmp
c += 1
else:
tr += tmp
c+=1
if c>k:
return False
else:
return True
n,k = input().split()
w ... | Traceback (most recent call last):
File "/tmp/tmphov0e_hy/tmpj02yws2j.py", line 20, in <module>
n,k = input().split()
^^^^^^^
EOFError: EOF when reading a line
| |
s732358109 | p02270 | u279605379 | 1499670727 | Python | Python3 | py | Runtime Error | 0 | 0 | 54 | from collections import deque
w = collections.deque() | Traceback (most recent call last):
File "/tmp/tmp1pvksc1p/tmplv4l9lxv.py", line 3, in <module>
w = collections.deque()
^^^^^^^^^^^
NameError: name 'collections' is not defined
| |
s546334886 | p02270 | u279605379 | 1499670768 | Python | Python3 | py | Runtime Error | 0 | 0 | 526 | #ALDS1_4-D Allocation
from collections import deque
def pIsAccptbl(w,k,p):
tr = 0
c = 0
while(w):
tmp = w.popleft()
if( tr + tmp > p):
tr = tmp
c += 1
else:
tr += tmp
c+=1
if c>k:
return False
else:
return True
n,... | Traceback (most recent call last):
File "/tmp/tmpw3sn809m/tmpi6_it4ls.py", line 21, in <module>
n,k = input().split()
^^^^^^^
EOFError: EOF when reading a line
| |
s973389304 | p02270 | u279605379 | 1499670841 | Python | Python3 | py | Runtime Error | 0 | 0 | 553 | #ALDS1_4-D Allocation
from collections import deque
def pIsAccptbl(w,k,p):
tr = 0
c = 0
while(w):
tmp = w.popleft()
if( tr + tmp > p):
tr = tmp
c += 1
else:
tr += tmp
c+=1
if c>k:
return False
else:
return True
n,... | Traceback (most recent call last):
File "/tmp/tmpue_ffqtu/tmpb8iiiw0z.py", line 21, in <module>
n,k = input().split()
^^^^^^^
EOFError: EOF when reading a line
| |
s868178610 | p02270 | u279605379 | 1499670877 | Python | Python3 | py | Runtime Error | 0 | 0 | 546 | #ALDS1_4-D Allocation
from collections import deque
def pIsAccptbl(w,k,p):
tr = 0
c = 0
while(w):
tmp = w.popleft()
if( tr + tmp > p):
tr = tmp
c += 1
else:
tr += tmp
c+=1
if c>k:
return False
else:
return True
n,... | Traceback (most recent call last):
File "/tmp/tmpiwix9z8s/tmp742ogeva.py", line 21, in <module>
n,k = input().split()
^^^^^^^
EOFError: EOF when reading a line
| |
s661294511 | p02270 | u279605379 | 1499740642 | Python | Python3 | py | Runtime Error | 0 | 0 | 1112 | from collections import deque
def cndP(l,n,p1,p2):
d = set()
length = len(l)
for i in range(length-n+1):
s = sum(l[i:i+n])
#print("s:",s)
if p2 == None:
if p1 < s:
d.add(s)
else:
if p1 < c < p2:
d.add(s)
return sort... | Traceback (most recent call last):
File "/tmp/tmpjyradd62/tmp3n8ei3_f.py", line 35, in <module>
n,k = [int(x) for x in input().split()]
^^^^^^^
EOFError: EOF when reading a line
| |
s184687851 | p02270 | u279605379 | 1499740672 | Python | Python3 | py | Runtime Error | 0 | 0 | 1012 | from collections import deque
def cndP(l,n,p1,p2):
d = set()
length = len(l)
for i in range(length-n+1):
s = sum(l[i:i+n])
if p2 == None:
if p1 < s:
d.add(s)
else:
if p1 < c < p2:
d.add(s)
return sorted(d)
def pIsAccptbl(w... | Traceback (most recent call last):
File "/tmp/tmprpx7ntf7/tmpfgktujov.py", line 34, in <module>
n,k = [int(x) for x in input().split()]
^^^^^^^
EOFError: EOF when reading a line
| |
s691240671 | p02270 | u279605379 | 1499825757 | Python | Python3 | py | Runtime Error | 0 | 0 | 1100 | from collections import deque
def cndP(l,n,p1,p2):
d = set()
length = len(l)
for i in range(length-n+1):
s = sum(l[i:i+n])
if p2 == None:
if p1 < s:
d.add(s)
else:
if p1 < s < p2:
d.add(s)
return sorted(d)
def pIsAccptbl(w... | Traceback (most recent call last):
File "/tmp/tmpr8miwde1/tmp1zsjepl_.py", line 34, in <module>
n,k = [int(x) for x in input().split()]
^^^^^^^
EOFError: EOF when reading a line
| |
s317196787 | p02270 | u279605379 | 1499825768 | Python | Python3 | py | Runtime Error | 0 | 0 | 1061 | from collections import deque
def cndP(l,n,p1,p2):
d = set()
length = len(l)
for i in range(length-n+1):
s = sum(l[i:i+n])
if p2 == None:
if p1 < s:
d.add(s)
else:
if p1 < s < p2:
d.add(s)
return sorted(d)
def pIsAccptbl(w... | Traceback (most recent call last):
File "/tmp/tmpx3855u6l/tmp9b0qyvkf.py", line 34, in <module>
n,k = [int(x) for x in input().split()]
^^^^^^^
EOFError: EOF when reading a line
| |
s148720496 | p02270 | u279605379 | 1499827384 | Python | Python3 | py | Runtime Error | 0 | 0 | 1061 | from collections import deque
def cndP(l,n,p1,p2):
d = set()
length = len(l)
for i in range(length-n+1):
s = sum(l[i:i+n])
if p2 == None:
if p1 < s:
d.add(s)
else:
if p1 < s < p2:
d.add(s)
return sorted(d)
def pIsAccptbl(w... | Traceback (most recent call last):
File "/tmp/tmpnlje78vu/tmpep5lnohh.py", line 34, in <module>
n,k = [int(x) for x in input().split()]
^^^^^^^
EOFError: EOF when reading a line
| |
s293570954 | p02270 | u279605379 | 1499910878 | Python | Python3 | py | Runtime Error | 0 | 0 | 798 | from collections import deque
def cndP(w):
if len(w)>1:
x = w.pop()
cndP(w.copy())
w.append(x)
s = 0
while(len(w)>0):
s += w.pop()
st.add(s)
else:
st.add(w[0])
def pIsAccptbl(w,k,p):
tr = 0
c = 0
d = w.copy()
while... | Traceback (most recent call last):
File "/tmp/tmppt9cy4xl/tmpskaj1vrb.py", line 33, in <module>
n,k = [int(x) for x in input().split()]
^^^^^^^
EOFError: EOF when reading a line
| |
s254153666 | p02270 | u279605379 | 1499910910 | Python | Python3 | py | Runtime Error | 0 | 0 | 1254 | from collections import deque
def cndP(l,n,p1,p2):
d = set()
min = sum(l[:])
length = len(l)
for i in range(length-n+1):
s = sum(l[i:i+n])
if s < min:
min = s
if p2 == None:
if p1 < s:
d.add(s)
else:
if p1 < s < p2:
... | Traceback (most recent call last):
File "/tmp/tmpw5paoe7z/tmpldadfqes.py", line 38, in <module>
n,k = [int(x) for x in input().split()]
^^^^^^^
EOFError: EOF when reading a line
| |
s338477852 | p02270 | u279605379 | 1499911043 | Python | Python3 | py | Runtime Error | 0 | 0 | 721 | from collections import deque
def cndP(w):
if len(w)>1:
x = w.pop()
cndP(w.copy())
w.append(x)
s = 0
while(len(w)>0):
s += w.pop()
st.add(s)
else:
st.add(w[0])
def pIsAccptbl(w,k,p):
tr = 0
c = 0
d = w.copy()
while... | Traceback (most recent call last):
File "/tmp/tmpoxijpzoq/tmp4q_ytbra.py", line 33, in <module>
n,k = [int(x) for x in input().split()]
^^^^^^^
EOFError: EOF when reading a line
| |
s689710759 | p02270 | u279605379 | 1499911057 | Python | Python3 | py | Runtime Error | 0 | 0 | 698 | from collections import deque
def cndP(w):
if len(w)>1:
x = w.pop()
cndP(w.copy())
w.append(x)
s = 0
while(len(w)>0):
s += w.pop()
st.add(s)
else:
st.add(w[0])
def pIsAccptbl(w,k,p):
tr = 0
c = 0
d = w.copy()
while... | Traceback (most recent call last):
File "/tmp/tmp8xjp9cww/tmp7sfaix_2.py", line 33, in <module>
n,k = [int(x) for x in input().split()]
^^^^^^^
EOFError: EOF when reading a line
| |
s582556677 | p02270 | u279605379 | 1499911071 | Python | Python3 | py | Runtime Error | 0 | 0 | 1382 | from collections import deque
def cndP(w):
if len(w)>1:
x = w.pop()
cndP(w.copy())
w.append(x)
s = 0
while(len(w)>0):
s += w.pop()
st.add(s)
else:
st.add(w[0])
def pIsAccptbl(w,k,p):
tr = 0
c = 0
d = w.copy()
while... | Traceback (most recent call last):
File "/tmp/tmpj2ishbs_/tmp7l7xsm5r.py", line 33, in <module>
n,k = [int(x) for x in input().split()]
^^^^^^^
EOFError: EOF when reading a line
| |
s705607465 | p02270 | u279605379 | 1499911077 | Python | Python3 | py | Runtime Error | 0 | 0 | 1375 | from collections import deque
def cndP(w):
if len(w)>1:
x = w.pop()
cndP(w.copy())
w.append(x)
s = 0
while(len(w)>0):
s += w.pop()
st.add(s)
else:
st.add(w[0])
def pIsAccptbl(w,k,p):
tr = 0
c = 0
d = w.copy()
while... | Traceback (most recent call last):
File "/tmp/tmpspdjpbhq/tmpgmm5tii1.py", line 33, in <module>
n,k = [int(x) for x in input().split()]
^^^^^^^
EOFError: EOF when reading a line
| |
s283773204 | p02270 | u279605379 | 1499911102 | Python | Python3 | py | Runtime Error | 0 | 0 | 1309 | from collections import deque
def cndP(w):
if len(w)>1:
x = w.pop()
cndP(w.copy())
w.append(x)
s = 0
else:
st.add(w[0])
def pIsAccptbl(w,k,p):
tr = 0
c = 0
d = w.copy()
while(d):
tmp = d.popleft()
if(tmp > p):
return ... | Traceback (most recent call last):
File "/tmp/tmpd7ky_oci/tmplx35chw7.py", line 31, in <module>
n,k = [int(x) for x in input().split()]
^^^^^^^
EOFError: EOF when reading a line
| |
s401842439 | p02270 | u279605379 | 1499911114 | Python | Python3 | py | Runtime Error | 0 | 0 | 1275 | from collections import deque
def cndP(w):
if len(w)>1:
x = w.pop()
cndP(w.copy())
else:
st.add(w[0])
def pIsAccptbl(w,k,p):
tr = 0
c = 0
d = w.copy()
while(d):
tmp = d.popleft()
if(tmp > p):
return False
if( tr + tm... | Traceback (most recent call last):
File "/tmp/tmp32ex7d7h/tmpazl80298.py", line 29, in <module>
n,k = [int(x) for x in input().split()]
^^^^^^^
EOFError: EOF when reading a line
| |
s675816552 | p02270 | u279605379 | 1499911121 | Python | Python3 | py | Runtime Error | 0 | 0 | 1358 | from collections import deque
def cndP(w):
if len(w)>1:
x = w.pop()
w.append(x)
s = 0
while(len(w)>0):
s += w.pop()
st.add(s)
else:
st.add(w[0])
def pIsAccptbl(w,k,p):
tr = 0
c = 0
d = w.copy()
while(d):
tmp = d.p... | Traceback (most recent call last):
File "/tmp/tmphg8ju7hg/tmpuf304sya.py", line 33, in <module>
n,k = [int(x) for x in input().split()]
^^^^^^^
EOFError: EOF when reading a line
| |
s085635459 | p02270 | u279605379 | 1499911150 | Python | Python3 | py | Runtime Error | 0 | 0 | 1380 | from collections import deque
def cndP(w):
if len(w)>1:
x = w.pop()
cndP(w.copy())
w.append(x)
s = 0
while(len(w)>0):
s += w.pop()
st.add(s)
else:
st.add(w[0])
def pIsAccptbl(w,k,p):
tr = 0
c = 0
d = w.copy()
while... | Traceback (most recent call last):
File "/tmp/tmp3m4inhct/tmp0165f7xf.py", line 33, in <module>
n,k = [int(x) for x in input().split()]
^^^^^^^
EOFError: EOF when reading a line
| |
s077917976 | p02270 | u279605379 | 1499911279 | Python | Python3 | py | Runtime Error | 0 | 0 | 1382 | from collections import deque
def cndP(w):
if len(w)>1:
x = w.pop()
cndP(w.copy())
w.append(x)
s = 0
while(len(w)>0):
s += w.pop()
st.add(s)
else:
st.add(w[0])
def pIsAccptbl(w,k,p):
tr = 0
c = 0
d = w.copy()
while... | Traceback (most recent call last):
File "/tmp/tmptql9qm1y/tmpgt432e67.py", line 33, in <module>
n,k = [int(x) for x in input().split()]
^^^^^^^
EOFError: EOF when reading a line
| |
s317761402 | p02270 | u279605379 | 1499912413 | Python | Python3 | py | Runtime Error | 30 | 8144 | 895 | from collections import deque
def copyDeque(d):
x = deque()
for i in d:
x.append(i)
return x
def cndP(w):
if len(w)>1:
x = w.pop()
cndP(copyDeque(w))
w.append(x)
s = 0
while(len(w)>0):
s += w.pop()
st.add(s)
else:
st.a... | Traceback (most recent call last):
File "/tmp/tmpxsl73kpn/tmpfq6d67v8.py", line 39, in <module>
n,k = [int(x) for x in input().split()]
^^^^^^^
EOFError: EOF when reading a line
| |
s941778932 | p02270 | u279605379 | 1499912426 | Python | Python3 | py | Runtime Error | 30 | 8160 | 895 | from collections import deque
def copyDeque(d):
x = deque()
for i in d:
x.append(i)
return x
def cndP(w):
if len(w)>1:
x = w.pop()
cndP(copyDeque(w))
w.append(x)
s = 0
while(len(w)>0):
s += w.pop()
st.add(s)
else:
st.a... | Traceback (most recent call last):
File "/tmp/tmp8203soaw/tmp2810fv2y.py", line 39, in <module>
n,k = [int(x) for x in input().split()]
^^^^^^^
EOFError: EOF when reading a line
| |
s151897430 | p02270 | u279605379 | 1499914229 | Python | Python3 | py | Runtime Error | 0 | 0 | 961 | from collections import deque
sys.setrecursionlimit(100000)
def copyDeque(d):
x = deque()
for i in d:
x.append(i)
return x
def cndP(w):
if len(w)>1:
x = w.pop()
cndP(copyDeque(w))
w.append(x)
s = 0
while(len(w)>0):
s += w.pop()
s... | Traceback (most recent call last):
File "/tmp/tmpnq2on4ff/tmpmgmsyia2.py", line 2, in <module>
sys.setrecursionlimit(100000)
^^^
NameError: name 'sys' is not defined
| |
s386706413 | p02270 | u279605379 | 1499914258 | Python | Python3 | py | Runtime Error | 0 | 0 | 924 | from collections import deque
import sys
sys.setrecursionlimit(100000)
def copyDeque(d):
x = deque()
for i in d:
x.append(i)
return x
def cndP(w):
if len(w)>1:
x = w.pop()
cndP(copyDeque(w))
w.append(x)
s = 0
while(len(w)>0):
s += w.pop()
... | Traceback (most recent call last):
File "/tmp/tmpq0h298ra/tmp3gjdavh5.py", line 42, in <module>
n,k = [int(x) for x in input().split()]
^^^^^^^
EOFError: EOF when reading a line
| |
s520470033 | p02270 | u279605379 | 1500345279 | Python | Python3 | py | Runtime Error | 0 | 0 | 1077 | from collections import deque
def isPa(w,k,p):
counter = 0
s = 0
n = 1
wlen = len(w)
while(True):
if( sum([s:s+n]) >= p):
s = s+n
n = 1
counter += 1
else:
n += 1
if( s+n == len(a)):
counter += 1
... | File "/tmp/tmpdpz4djcq/tmpobe87lh2.py", line 9
if( sum([s:s+n]) >= p):
^
SyntaxError: invalid syntax
| |
s516732926 | p02270 | u279605379 | 1500345428 | Python | Python3 | py | Runtime Error | 0 | 0 | 1073 | from collections import deque
def isPa(w,k,p):
counter = 0
s = 0
n = 1
wlen = len(w)
while(True):
if( sum(w[s:s+n]) >= p):
s = s+n
n = 1
counter += 1
else:
n += 1
if( s+n == len(a)):
counter += 1
... | Traceback (most recent call last):
File "/tmp/tmp6tcbptia/tmpf5bwv48p.py", line 35, in <module>
n,k = [int(x) for x in input().split()]
^^^^^^^
EOFError: EOF when reading a line
| |
s398252290 | p02270 | u519227872 | 1501760693 | Python | Python3 | py | Runtime Error | 0 | 0 | 505 | n = int(input())
S = list(map(int, input().split()))
q = int(input())
T = map(int, input().split())
def binarySearch(array, target):
l = len(array)
first_half = array[:l//2]
second_half = array[l//2:]
if first_half == []:
return False
if first_half[-1] == target:
return True
eli... | Traceback (most recent call last):
File "/tmp/tmpj6xao6ju/tmp0bdglic0.py", line 1, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s357280531 | p02270 | u856963614 | 1509984967 | Python | Python3 | py | Runtime Error | 30 | 7808 | 756 |
nk=input().split()
n=int(nk[0])
k=int(nk[1])
weight=[int(input()) for i in range(n)]
def ok(m):
load=0
track=1
# sum all the weight and count the track number we need
for i in range(n):
load+=weight[i]
if load==m:
load=0
if i!=n-1:
track+=1
... | Traceback (most recent call last):
File "/tmp/tmpd0bumhk9/tmpvkxjptan.py", line 4, in <module>
nk=input().split()
^^^^^^^
EOFError: EOF when reading a line
| |
s667737564 | p02270 | u426534722 | 1516638923 | Python | Python3 | py | Runtime Error | 0 | 0 | 465 | import sys
readline = sys.stdin.readline
N, K = map(int, input().split())
W = tuple(int(readline()) for _ in range(n))
ma = max(W)
def check(x):
if x < ma:
return False
use = 1
rest = x
for w in W:
if rest >= w:
rest -= w
else:
rest = x - w
use... | Traceback (most recent call last):
File "/tmp/tmp_fd9xm6b/tmp10mjt031.py", line 3, in <module>
N, K = map(int, input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s061977688 | p02270 | u426534722 | 1516639182 | Python | Python3 | py | Runtime Error | 0 | 0 | 466 | import sys
readline = sys.stdin.readline
N, K = map(int, input().split())
W = {map(int, sys.stdin.read().splitlines())}
ma = max(W)
def check(x):
if x < ma:
return False
use = 1
rest = x
for w in W:
if rest >= w:
rest -= w
else:
rest = x - w
us... | Traceback (most recent call last):
File "/tmp/tmp9ei_6_pj/tmpswnzrz1k.py", line 3, in <module>
N, K = map(int, input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s789863230 | p02270 | u426534722 | 1516639543 | Python | Python3 | py | Runtime Error | 0 | 0 | 464 | import sys
readline = sys.stdin.readline
N, K = map(int, input().split())
W = tuple(map(int, sys.stdin.splitlines()))
ma = max(W)
def check(x):
if x < ma:
return False
use = 1
rest = x
for w in W:
if rest >= w:
rest -= w
else:
rest = x - w
use ... | Traceback (most recent call last):
File "/tmp/tmpqxcfemqf/tmpuk8efpy3.py", line 3, in <module>
N, K = map(int, input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s062802487 | p02270 | u138546245 | 1523868937 | Python | Python3 | py | Runtime Error | 0 | 0 | 734 | def allocate(count, weights):
def loadable_counts(maxweight):
n = 0
l = 0
c = count
for w in weights:
l += w
if l > maxweight:
l = w
c -= 1
if c <= 0:
return n
n += 1
return n... | Traceback (most recent call last):
File "/tmp/tmpah5sryok/tmp20o_wpuv.py", line 42, in <module>
run()
File "/tmp/tmpah5sryok/tmp20o_wpuv.py", line 33, in run
k, n = [int(i) for i in input().split()]
^^^^^^^
EOFError: EOF when reading a line
| |
s727338188 | p02270 | u605879293 | 1523947222 | Python | Python3 | py | Runtime Error | 20 | 5656 | 594 | from itertools import combinations
def func(w, partition):
sum_list = [sum(w[0:partition[0]])]
for i in range(len(partition)):
if i < len(partition) - 1:
sum_list.append(sum(w[partition[i]:partition[i+1]]))
else:
sum_list.append(sum(w[partition[i]:]))
return max(sum... | Traceback (most recent call last):
File "/tmp/tmpcbv_vodf/tmpg_0nkmvf.py", line 14, in <module>
n, k = [int(x) for x in input().split()]
^^^^^^^
EOFError: EOF when reading a line
| |
s755468601 | p02270 | u005964097 | 1525926023 | Python | Python3 | py | Runtime Error | 0 | 0 | 542 | def min_sufficient_load(w, k):
return check(w, k, 0, sum(w))
def check(w, k, p1, p2):
trunk_no = 1
temp = 0
m = 1+(p1 + p2)>>1
for i in w:
if temp + i <= m:
temp += i
else:
trunk_no += 1
temp = i
if trunk_no > k:
return check(w, k, m,... | Traceback (most recent call last):
File "/tmp/tmpsn4b5uk2/tmphkxgjud5.py", line 22, in <module>
k,n = map(int,input())
^^^^^^^
EOFError: EOF when reading a line
| |
s431643629 | p02270 | u005964097 | 1525951873 | Python | Python3 | py | Runtime Error | 0 | 0 | 673 | def min_sufficient_load(w, k):
return check(w, k, 0, sum(w))
def check(w, k, p1, p2):
trunk_no = 1
temp = 0
m = 1+(p1 + p2)>>1
for i in w:
if temp + i <= m:
temp += i
if temp==m:
trunk_no+=1
temp = 0
else:
tr... | File "/tmp/tmps281_n7g/tmpt9xe76u1.py", line 12
if temp==m:
^
SyntaxError: invalid non-printable character U+3000
| |
s889666573 | p02270 | u005964097 | 1525951922 | Python | Python3 | py | Runtime Error | 20 | 5600 | 655 | def min_sufficient_load(w, k):
return check(w, k, 0, sum(w))
def check(w, k, p1, p2):
trunk_no = 1
temp = 0
m = 1+(p1 + p2)>>1
for i in w:
if temp + i <= m:
temp += i
if temp==m:
trunk_no+=1
temp = 0
else:
trunk_no... | Traceback (most recent call last):
File "/tmp/tmpejz5z3px/tmpe5_vnic2.py", line 25, in <module>
n,k = map(int,input().split(" "))
^^^^^^^
EOFError: EOF when reading a line
| |
s621986512 | p02270 | u005964097 | 1525952068 | Python | Python3 | py | Runtime Error | 20 | 5600 | 655 | def min_sufficient_load(w, k):
return check(w, k, 0, sum(w))
def check(w, k, p1, p2):
trunk_no = 1
temp = 0
m = 1+(p1 + p2)>>1
for i in w:
if temp + i <= m:
temp += i
if temp==m:
trunk_no+=1
temp = 0
else:
trunk_no... | Traceback (most recent call last):
File "/tmp/tmpnwr6_i27/tmp4apx8d_s.py", line 25, in <module>
n,k = map(int,input().split(" "))
^^^^^^^
EOFError: EOF when reading a line
| |
s951921904 | p02270 | u005964097 | 1525952079 | Python | Python3 | py | Runtime Error | 0 | 0 | 655 | def min_sufficient_load(w, k):
return check(w, k, 0, sum(w))
def check(w, k, p1, p2):
trunk_no = 1
temp = 0
m = 1+(p1 + p2)>>1
for i in w:
if temp + i <= m:
temp += i
if temp==m:
trunk_no+=1
temp = 0
else:
trunk_no... | Traceback (most recent call last):
File "/tmp/tmpf0bgxalb/tmp5a0xwy9t.py", line 25, in <module>
n,k = map(int,input().split(" "))
^^^^^^^
EOFError: EOF when reading a line
| |
s422198263 | p02270 | u684241248 | 1527588366 | Python | Python3 | py | Runtime Error | 190 | 5952 | 647 | n, k = [int(_) for _ in input().split()]
ary = [int(input()) for _ in range(n)]
def search_v(p):
v = 0
w = 0
tmp_k = 1
ind = 0
while True:
if tmp_k > k:
return v
if ind == n:
return n
tmp = ary[ind]
if w + tmp <= p:
w += tmp
... | Traceback (most recent call last):
File "/tmp/tmpbl8cj7gg/tmpu4opjvvp.py", line 1, in <module>
n, k = [int(_) for _ in input().split()]
^^^^^^^
EOFError: EOF when reading a line
| |
s478805389 | p02270 | u684241248 | 1527588469 | Python | Python3 | py | Runtime Error | 20 | 5604 | 642 | n, k = [int(_) for _ in input().split()]
ary = [int(input()) for _ in range(n)]
def search_v(p):
v = 0
w = 0
tmp_k = 1
ind = 0
while True:
if tmp_k > k:
return v
if ind == n:
return n
tmp = ary[ind]
if w + tmp <= p:
w += tmp
... | Traceback (most recent call last):
File "/tmp/tmpp4wb64od/tmp4e24ag6m.py", line 1, in <module>
n, k = [int(_) for _ in input().split()]
^^^^^^^
EOFError: EOF when reading a line
| |
s035255242 | p02270 | u986478725 | 1527656378 | Python | Python3 | py | Runtime Error | 370 | 7528 | 1168 | # ALDS1_4_D.
# アロケーション。
W = [0 for i in range(100000)]
def intinput():
a = input().split()
for i in range(len(a)):
a[i] = int(a[i])
return a
def canLoad(P, n, k):
# P以下の条件下ですべての荷物を積めるか否か。
# Wには荷物の情報が入ってる。nは荷物の個数、kはトラックの台数。
# i > nで返ればTrue.
sumOfLoad = 0
numOfPackage = 0
nu... | Traceback (most recent call last):
File "/tmp/tmpq8c48d8t/tmpc_nrgge0.py", line 43, in <module>
main()
File "/tmp/tmpq8c48d8t/tmpc_nrgge0.py", line 30, in main
data = intinput()
^^^^^^^^^^
File "/tmp/tmpq8c48d8t/tmpc_nrgge0.py", line 7, in intinput
a = input().split()
^^^^^^^
EOFErr... | |
s839011165 | p02270 | u436634575 | 1400893808 | Python | Python3 | py | Runtime Error | 0 | 0 | 471 | def check(p):
s = w[0]
track = 1
for i in range(1, n):
if s + w[i] <= p:
s += w[i]
else:
track += 1
if track > k: return False
s = w[i]
return True
n, k = map(int, input().strip().split())
w = []
for i in range(n):
w.append(int(input()... | File "/tmp/tmpsuo1ld59/tmpofo44ymm.py", line 19
if check(L): return L
^^^^^^^^
SyntaxError: 'return' outside function
| |
s517762655 | p02271 | u657361950 | 1530970150 | Python | Python3 | py | Runtime Error | 13690 | 5608 | 423 |
def solve(a, m):
return solve_(a, 0, m)
def solve_(a, i, m):
res = False
if m == 0:
res = True
elif i >= len(a):
res = False
else:
res1 = solve_(a, i + 1, m)
res2 = solve_(a, i + 1, m - a[i])
res = res1 or res2
return res
n = int(input())
a = list(map(int, input().split()))
q = int(input())
m = list(... | Traceback (most recent call last):
File "/tmp/tmpm5a3dkn8/tmp3qbxxwk9.py", line 17, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s153290246 | p02271 | u153665391 | 1531061379 | Python | Python3 | py | Runtime Error | 3220 | 5612 | 630 | N = int(input())
A = sorted(list(map(int, input().split())))
Q = int(input())
M = list(map(int, input().split()))
def exhastive_search(target, head, sum):
for i in range(head, N):
sum += A[i]
if target == sum:
return True
elif target > sum:
if exhastive_search(target... | Traceback (most recent call last):
File "/tmp/tmpiyntce5z/tmp_fbk6m58.py", line 1, in <module>
N = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s805049719 | p02271 | u153665391 | 1531061673 | Python | Python3 | py | Runtime Error | 3200 | 5608 | 617 | N = int(input())
A = sorted(list(map(int, input().split())))
Q = int(input())
M = list(map(int, input().split()))
def exhastive_search(target, head, sum):
for i in range(head, N):
sum += A[i]
if target == sum:
return True
elif target > sum:
if exhastive_search(target... | Traceback (most recent call last):
File "/tmp/tmpk9hjdu7x/tmp92ep4gpv.py", line 1, in <module>
N = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s609081576 | p02271 | u153665391 | 1531103004 | Python | Python3 | py | Runtime Error | 3200 | 5612 | 612 | N = int(input())
A = list(map(int, input().split()))
Q = int(input())
M = list(map(int, input().split()))
def exhastive_search(target, head, sum):
for i in range(head, N):
sum += A[i]
if target == sum:
return True
elif target > sum:
if exhastive_search(target, i+1, s... | Traceback (most recent call last):
File "/tmp/tmp69i0s2n5/tmpumn_65b7.py", line 1, in <module>
N = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s823017417 | p02271 | u153665391 | 1531103521 | Python | Python3 | py | Runtime Error | 3180 | 5608 | 621 | N = int(input())
A = sorted(list(map(int, input().split())))
Q = int(input())
M = list(map(int, input().split()))
def exhastive_search(target, head, sum):
for i in range(head, N):
sum += A[i]
if target == sum:
return True
elif target > sum:
if exhastive_search(target... | Traceback (most recent call last):
File "/tmp/tmpxmpkf_1m/tmp0mhdz24x.py", line 1, in <module>
N = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s832860466 | p02271 | u153665391 | 1531104099 | Python | Python3 | py | Runtime Error | 3290 | 5608 | 691 | N = int(input())
A = sorted(list(map(int, input().split())))
Q = int(input())
M = list(map(int, input().split()))
def exhastive_search(target, head, sum):
for i in range(head, N):
sum += A[i]
if target == sum:
return True
elif target > sum:
if exhastive_search(target... | Traceback (most recent call last):
File "/tmp/tmpdollhm6c/tmpicoj3htr.py", line 1, in <module>
N = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s219444381 | p02271 | u153665391 | 1531214482 | Python | Python3 | py | Runtime Error | 8210 | 5612 | 401 | N = int(input())
A = list(map(int, input().split()))
Q = int(input())
M = list(map(int, input().split()))
def solve(idx, target):
if target == 0:
return True
if idx >= N:
return False
if solve(idx+1, target) or solve(idx+1, target-A[idx]):
return True
return False
for target i... | Traceback (most recent call last):
File "/tmp/tmppxmd_g7c/tmpw03ithit.py", line 1, in <module>
N = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s109232328 | p02271 | u153665391 | 1531215205 | Python | Python3 | py | Runtime Error | 9250 | 5612 | 451 | N = int(input())
A = sorted(list(map(int, input().split())))
Q = int(input())
M = list(map(int, input().split()))
def solve(idx, target):
if target == 0:
return True
elif target < 0:
return False
if idx >= N:
return False
if solve(idx+1, target) or solve(idx+1, target-A[idx]):
... | Traceback (most recent call last):
File "/tmp/tmprpigpk8y/tmp4pqpwab_.py", line 1, in <module>
N = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s571492788 | p02271 | u316584871 | 1531287684 | Python | Python3 | py | Runtime Error | 13830 | 7036 | 365 | n = int(input())
seq = list(map(int, input().split()))
q = int(input())
mlist = list(map(int, input().split()))
def check(i, m):
if m == 0:
return 'yes'
elif i >= n:
return 'no'
res = check(i+1, m) + check(i+1, m - seq[i])
return res
for m in mlist:
if('yes' in check(0, m)):
... | Traceback (most recent call last):
File "/tmp/tmpsqy2a6bn/tmpcq75toip.py", line 1, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s278343865 | p02271 | u316584871 | 1531287853 | Python | Python3 | py | Runtime Error | 11600 | 5612 | 352 | n = int(input())
seq = list(map(int, input().split()))
q = int(input())
mlist = list(map(int, input().split()))
def check(i, m):
if m == 0:
return 1
elif i >= n:
return 0
res = check(i+1, m) + check(i+1, m - seq[i])
return res
for m in mlist:
if(check(0,m) > 0):
print('yes'... | Traceback (most recent call last):
File "/tmp/tmpkve7apry/tmpx6mofvli.py", line 1, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s924727950 | p02271 | u316584871 | 1531288128 | Python | Python3 | py | Runtime Error | 11640 | 5612 | 355 | n = int(input())
seq = list(map(int, input().split()))
q = int(input())
mlist = list(map(int, input().split()))
def check(i, m):
if m == 0:
return True
elif i >= n:
return False
res = check(i+1, m) + check(i+1, m - seq[i])
return res
for m in mlist:
if(check(0,m)):
print('y... | Traceback (most recent call last):
File "/tmp/tmpe62fjs6v/tmpctmzj2wt.py", line 1, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s228136819 | p02271 | u316584871 | 1531288737 | Python | Python3 | py | Runtime Error | 11830 | 5612 | 466 | n = int(input())
seq = list(map(int, input().split()))
q = int(input())
mlist = list(map(int, input().split()))
global mins
mins = min(seq)
global sums
sums = sum(mlist)
def check(i, m):
if m == 0:
return True
elif i >= n:
return False
res = check(i+1, m) + check(i+1, m - seq[i])
return... | Traceback (most recent call last):
File "/tmp/tmpcox_3vde/tmpsrd4myco.py", line 1, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s208138380 | p02271 | u316584871 | 1531288971 | Python | Python3 | py | Runtime Error | 3010 | 5608 | 485 | n = int(input())
seq = list(map(int, input().split()))
q = int(input())
mlist = list(map(int, input().split()))
global mins
mins = min(seq)
sums = 0
for a in seq:
sums += a
def check(i, m):
if m == 0:
return True
elif i >= n or mins > m:
return False
res = check(i+1, m) + check(i+1, m -... | Traceback (most recent call last):
File "/tmp/tmpal1o426i/tmpt74vcfi2.py", line 1, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s812429046 | p02271 | u316584871 | 1531289455 | Python | Python3 | py | Runtime Error | 2770 | 5612 | 489 | n = int(input())
seq = list(map(int, input().split()))
q = int(input())
mlist = list(map(int, input().split()))
mins = min(seq)
sums = 0
for a in seq:
sums += a
def check(i, m):
global mins
if m == 0:
return True
elif i >= n or mins > m:
return False
res = check(i+1, m) + check(i+1,... | Traceback (most recent call last):
File "/tmp/tmpfpolf7tc/tmpodj4090p.py", line 1, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s071810765 | p02271 | u094978706 | 1535699112 | Python | Python3 | py | Runtime Error | 0 | 0 | 574 | import numpy as np
n = int(input())
A = np.array(list(map(int, input().split() )))
q = int(input())
m = list(map(int, input().split()))
def deci_to_bin_list(num, n):
out = np.zeros(n, dtype='int')
for i in range(n-1, -1, -1):
denom = 2**i
out[i] = num // denom
num = num % denom
ret... | Traceback (most recent call last):
File "/tmp/tmppzj41q9o/tmpitzp7loo.py", line 3, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s333414324 | p02271 | u580607517 | 1421035959 | Python | Python | py | Runtime Error | 0 | 0 | 308 | def solve(i, m):
if i >= n:
return m == 0
if solve(i + 1, m):
return True
if solve(i + 1, m - A[i]):
return True
return False
n = int(raw_input())
A = map(int,raw_input().split())
q = int(raw_input())
for i in xrange(q):
m = int(raw_input())
if solve(0, m):
print "yes"
else:
print "no" | File "/tmp/tmp5sl9oizy/tmp82jod33n.py", line 20
print "yes"
^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s655861556 | p02271 | u580607517 | 1421036202 | Python | Python | py | Runtime Error | 19930 | 4220 | 311 | def solve(i, m):
if i >= n:
return m == 0
if solve(i + 1, m):
return True
if solve(i + 1, m - A[i]):
return True
return False
n = int(raw_input())
A = map(int,raw_input().split())
q = int(raw_input())
M = map(int, raw_input().split())
for m in M:
if solve(0, m):
print "yes"
else:
print "no" | File "/tmp/tmpfhfiuzoh/tmp3v_go1k3.py", line 19
print "yes"
^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s179639023 | p02271 | u580607517 | 1421036278 | Python | Python | py | Runtime Error | 19930 | 4220 | 311 | def solve(i, m):
if i >= n:
return m == 0
if solve(i + 1, m):
return True
if solve(i + 1, m - A[i]):
return True
return False
n = int(raw_input())
A = map(int,raw_input().split())
q = int(raw_input())
M = map(int, raw_input().split())
for m in M:
if solve(0, m):
print "yes"
else:
print "no" | File "/tmp/tmpf3kcx4a2/tmp317a58x1.py", line 19
print "yes"
^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s619722506 | p02271 | u567380442 | 1421406052 | Python | Python3 | py | Runtime Error | 0 | 0 | 251 | n = input()
a = list(map(int, input().split()))
q = input()
aset = set()
for i in range(1, len(a) + 1):
aset |= set(sum(combi) for combi in itertools.combinations(a, i))
for m in map(int, input().split()):
print('yes' if m in aset else 'no') | Traceback (most recent call last):
File "/tmp/tmp_ik2cu3f/tmpihk5xggc.py", line 1, in <module>
n = input()
^^^^^^^
EOFError: EOF when reading a line
| |
s692542768 | p02271 | u879226672 | 1427351875 | Python | Python | py | Runtime Error | 19930 | 74512 | 446 | n = int(raw_input())
A = map(int,raw_input().split())
q = int(raw_input())
mi = map(int,raw_input().split())
S = []
for k in range(1,2**len(A)):
S.append(map(int,list((format(k,'b').zfill(len(A))))))
for m in mi:
for k in range(len(S)):
tot = 0
for j in range(len(S[k])):
if S[k][j]... | File "/tmp/tmpbhan9gmc/tmputxjb6c2.py", line 17
print 'yes'
^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s633381200 | p02271 | u879226672 | 1430836835 | Python | Python | py | Runtime Error | 19930 | 66172 | 449 | n = int(raw_input())
A = map(int,raw_input().split())
q = int(raw_input())
mi = map(int,raw_input().split())
S = []
for k in xrange(1,2**len(A)):
S.append(map(int,list((format(k,'b').zfill(len(A))))))
for m in mi:
for k in xrange(len(S)):
tot = 0
for j in xrange(len(S[k])):
if S[k]... | File "/tmp/tmp7xmp1liv/tmpkrlretk6.py", line 17
print 'yes'
^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s675089109 | p02271 | u689297737 | 1432860481 | Python | Python | py | Runtime Error | 19930 | 4240 | 788 | # http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ALDS1_5_A
# Exhaustive Search
# Result:
import sys
def calc(target, cur_sum, ary, ary_idx):
new_sum = cur_sum + ary[ary_idx]
if new_sum == target:
return True
ary_idx += 1
if ary_idx == len(ary):
return False
return calc(tar... | File "/tmp/tmpit0spaqs/tmpvm132htx.py", line 26
print 'yes'
^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s487105985 | p02271 | u140201022 | 1434385981 | Python | Python | py | Runtime Error | 19930 | 4240 | 534 | n=int(raw_input())
a=map(int,raw_input().split())
q=int(raw_input())
m=map(int,raw_input().split())
ans=chk=0
bits=(1<<n)-1
for i in m:
p=bits
flag=0
while p:
chk=str(bin(p))[2:]
chk='0'*(n-len(chk))+chk
p-=1
h=0
for j,k in enumerate(chk):
if k=='1':
... | File "/tmp/tmpf77nb2bm/tmprdc_vyae.py", line 19
print 'yes'
^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s421903282 | p02271 | u604774382 | 1437313345 | Python | Python | py | Runtime Error | 0 | 0 | 392 | def solve( p, t ):
global isExist
global n
global A
isExist[ t ] = True
if p < n:
solve( p+1, t-A[p] )
solve( p+1, t )
isExist = [False]*2001
n = int( raw_input() )
A = map( int, raw_input().split( " " ) )
q = int( raw_input() )
M = map( int, raw_input().split( " " ) )
s = sum( A )
solve( 0, s )
for i in ran... | Traceback (most recent call last):
File "/tmp/tmpz1mhb4f9/tmpe4zztjk6.py", line 11, in <module>
n = int( raw_input() )
^^^^^^^^^
NameError: name 'raw_input' is not defined
| |
s215680089 | p02271 | u604774382 | 1437313504 | Python | Python3 | py | Runtime Error | 0 | 0 | 376 | def solve( p, t ):
global isExist
global n
global A
isExist[ t ] = True
if p < n:
solve( p+1, t-A[p] )
solve( p+1, t )
isExist = [False]*2001
n = int( input() )
A = map( int, input().split( " " ) )
q = int( input() )
M = map( int, input().split( " " ) )
s = sum( A )
solve( 0, s )
for i in range( 0, q ):
if ... | Traceback (most recent call last):
File "/tmp/tmprqb98kzo/tmpy5erq5at.py", line 11, in <module>
n = int( input() )
^^^^^^^
EOFError: EOF when reading a line
| |
s282138191 | p02271 | u604774382 | 1437313781 | Python | Python3 | py | Runtime Error | 0 | 0 | 404 | def solve( p, t ):
global isExist
global n
global A
isExist[ t ] = True
if p < n:
solve( p+1, t-A[p] )
solve( p+1, t )
isExist = [False]*2001
n = int( input() )
A = [ int( val ) for val in input().split( " " ) ]
q = int( input() )
M = [ int( val ) for val in input().split( " " ) ]
s = sum( A )
solve( 0, s )
... | Traceback (most recent call last):
File "/tmp/tmp1fmxe7os/tmp204wn361.py", line 11, in <module>
n = int( input() )
^^^^^^^
EOFError: EOF when reading a line
| |
s608212315 | p02271 | u604774382 | 1437313957 | Python | Python | py | Runtime Error | 0 | 0 | 437 | def solve( p, t ):
global isExist
global n
global A
isExist[ t ] = True
if p < n:
solve( p+1, t-A[p] )
solve( p+1, t )
else:
return
isExist = [False]*2001
n = int( raw_input() )
A = [ int( val ) for val in raw_input().split( ' ' ) ]
q = int( raw_input() )
M = [ int( val ) for val in raw_input().split( ' ... | Traceback (most recent call last):
File "/tmp/tmpr4ymkbvg/tmpf2c66c9h.py", line 14, in <module>
n = int( raw_input() )
^^^^^^^^^
NameError: name 'raw_input' is not defined
| |
s763891215 | p02271 | u604774382 | 1437314368 | Python | Python | py | Runtime Error | 0 | 0 | 373 | isExist = [False]*2001
n = int( raw_input() )
A = [ int( val ) for val in raw_input().split( ' ' ) ]
for i in A:
for j in range( 2000-i, 0, -1 ):
if isExist[j]:
isExist[ i+j ] = True
isExist[i] = True
q = int( raw_input() )
M = [ int( val ) for val in raw_input().split( ' ' ) ]
for i in range( 0, q ):
if isE... | Traceback (most recent call last):
File "/tmp/tmp5x_67r7k/tmpxkogpg6l.py", line 2, in <module>
n = int( raw_input() )
^^^^^^^^^
NameError: name 'raw_input' is not defined
| |
s590375542 | p02271 | u604774382 | 1437314430 | Python | Python3 | py | Runtime Error | 0 | 0 | 357 | isExist = [False]*2001
n = int( input() )
A = [ int( val ) for val in input().split( ' ' ) ]
for i in A:
for j in range( 2000-i, 0, -1 ):
if isExist[j]:
isExist[ i+j ] = True
isExist[i] = True
q = int( input() )
M = [ int( val ) for val in input().split( ' ' ) ]
for i in range( 0, q ):
if isExist[ M[i] ]:
... | Traceback (most recent call last):
File "/tmp/tmparqjcdv1/tmpw4ftmwkb.py", line 2, in <module>
n = int( input() )
^^^^^^^
EOFError: EOF when reading a line
| |
s064432568 | p02271 | u604774382 | 1437315348 | Python | Python3 | py | Runtime Error | 0 | 0 | 204 | isExist = [False]*2001
n = int( input() )
A = [ int( val ) for val in input().split( ' ' ) ]
q = int( input() )
M = [ int( val ) for val in input().split( ' ' ) ]
for i in range( 0, q ):
print( "yes" ) | Traceback (most recent call last):
File "/tmp/tmpyxohgr66/tmpzox8qery.py", line 2, in <module>
n = int( input() )
^^^^^^^
EOFError: EOF when reading a line
| |
s821408640 | p02271 | u604774382 | 1437315374 | Python | Python3 | py | Runtime Error | 0 | 0 | 179 | n = int( input() )
A = [ int( val ) for val in input().split( ' ' ) ]
q = int( input() )
M = [ int( val ) for val in input().split( ' ' ) ]
for i in range( 0, q ):
print( "yes" ) | Traceback (most recent call last):
File "/tmp/tmpwr0l0zyc/tmpdb9p7w0a.py", line 1, in <module>
n = int( input() )
^^^^^^^
EOFError: EOF when reading a line
| |
s557574965 | p02271 | u604774382 | 1437315490 | Python | Python3 | py | Runtime Error | 0 | 0 | 179 | d = int( input() )
c = [ int( val ) for val in input().split( " " ) ]
f = int( input() )
b = [ int( val ) for val in input().split( " " ) ]
for i in range( 0, 3 ):
print( "yes" ) | Traceback (most recent call last):
File "/tmp/tmp57xrwmpe/tmpk5sb2vas.py", line 1, in <module>
d = int( input() )
^^^^^^^
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.