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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
s032820946 | p02269 | u096922415 | 1469338753 | Python | Python3 | py | Runtime Error | 0 | 0 | 3369 | # http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ALDS1_4_C&lang=jp
sample_input = list(range(4))
sample_input[0] = '''6
insert AAA
insert AAC
find AAA
find CCC
insert CCC
find CCC'''
sample_input[1] = '''13
insert AAA
insert AAC
insert AGA
insert AGG
insert TTT
find AAA
find CCC
find CCC
insert CCC
find CCC
insert T
find TTT
find T'''
sample_input[2] = '''20
find CTT
find TAG
insert AA
insert CTC
find G
insert TGT
find AAC
find TTG
insert AA
insert TTG
insert G
insert A
insert GG
insert C
insert TT
find T
insert C
find GG
find G
insert CG'''
sample_input[3]='''15
insert AAA
insert AAC
insert AGA
insert AGG
insert TTT
find AAA
find CCC
find CCC
insert CCC
find CCC
find CC
insert T
find TTT
find T
find A'''
give_sample_input = None
if give_sample_input is not None:
sample_input_list = sample_input[give_sample_input].split('\n')
def input():
return sample_input_list.pop(0)
# main
from collections import deque
def convert_ACGT_to_int(acgt_str):
result = 0
for char in acgt_str:
result *= 5
if char == 'A':
result += 1
elif char == 'C':
result += 2
elif char == 'G':
result += 3
elif char == 'T':
result += 4
else:
assert False
return result
def binary_search(increasing_list, elem):
index_min = 0
index_max = len(increasing_list) - 1
while index_max - index_min >= 2:
index_middle = int((index_min + index_max) / 2)
if increasing_list[index_middle] == elem:
return (True, index_middle + 1)
elif increasing_list[index_middle] > elem:
index_max = index_middle
else:
index_min = index_middle
if index_max >= index_min:
if increasing_list[index_max] == elem:
return (True, index_max + 1)
elif increasing_list[index_min] == elem:
return (True, index_min + 1)
elif increasing_list[index_max] < elem:
return (False, index_max + 1)
elif increasing_list[index_min] > elem:
return (False, index_min)
elif increasing_list[index_min] < increasing_list[index_max]:
return (False, index_max)
elif increasing_list[index_min] == increasing_list[index_max]:
val = increasing_list[index_min]
if elem < val:
return (False, index_min)
else:
return (False, index_max + 1)
if index_max < index_min:
return (False, None)
class Dict (object):
def __init__(self):
self.data = deque()
pass
def insert(self, item):
index = binary_search(list(self.data), item)[1]
if index is None:
self.data.append(item)
else:
self.data.insert(index, item)
def find(self, item):
return binary_search(list(self.data), item)[0]
dict = Dict()
num_of_commands = int(input())
for n in range(num_of_commands):
input_str = input()
command, data = input_str.split(' ')
if command == 'insert':
dict.insert(convert_ACGT_to_int(data))
else:
if dict.find(convert_ACGT_to_int(data)):
print('yes')
else:
print('no')
| Traceback (most recent call last):
File "/tmp/tmpqf8k66qv/tmpu0c5467y.py", line 141, in <module>
num_of_commands = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s167464640 | p02269 | u096922415 | 1469339241 | Python | Python3 | py | Runtime Error | 0 | 0 | 3321 | # http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ALDS1_4_C&lang=jp
sample_input = list(range(4))
sample_input[0] = '''6
insert AAA
insert AAC
find AAA
find CCC
insert CCC
find CCC'''
sample_input[1] = '''13
insert AAA
insert AAC
insert AGA
insert AGG
insert TTT
find AAA
find CCC
find CCC
insert CCC
find CCC
insert T
find TTT
find T'''
sample_input[2] = '''20
find CTT
find TAG
insert AA
insert CTC
find G
insert TGT
find AAC
find TTG
insert AA
insert TTG
insert G
insert A
insert GG
insert C
insert TT
find T
insert C
find GG
find G
insert CG'''
sample_input[3]='''15
insert AAA
insert AAC
insert AGA
insert AGG
insert TTT
find AAA
find CCC
find CCC
insert CCC
find CCC
find CC
insert T
find TTT
find T
find A'''
give_sample_input = None
if give_sample_input is not None:
sample_input_list = sample_input[give_sample_input].split('\n')
def input():
return sample_input_list.pop(0)
# main
from collections import deque
def convert_ACGT_to_int(acgt_str):
result = 0
for char in acgt_str:
result *= 5
if char == 'A':
result += 1
elif char == 'C':
result += 2
elif char == 'G':
result += 3
elif char == 'T':
result += 4
else:
assert False
return result
def binary_search(increasing_list, elem):
index_min = 0
index_max = len(increasing_list) - 1
while index_max - index_min >= 2:
index_middle = int((index_min + index_max) / 2)
if increasing_list[index_middle] == elem:
return (True, index_middle + 1)
elif increasing_list[index_middle] > elem:
index_max = index_middle
else:
index_min = index_middle
if index_max >= index_min:
if increasing_list[index_max] == elem:
return (True, index_max + 1)
elif increasing_list[index_min] == elem:
return (True, index_min + 1)
elif increasing_list[index_max] < elem:
return (False, index_max + 1)
elif increasing_list[index_min] > elem:
return (False, index_min)
elif increasing_list[index_min] < increasing_list[index_max]:
return (False, index_max)
elif increasing_list[index_min] == increasing_list[index_max]:
val = increasing_list[index_min]
if elem < val:
return (False, index_min)
else:
return (False, index_max + 1)
if index_max < index_min:
return (False, None)
class Dict (object):
def __init__(self):
self.data = deque()
pass
def insert(self, item):
index = binary_search(list(self.data), item)[1]
if index is None:
self.data.append(item)
else:
self.data.insert(index, item)
def find(self, item):
return binary_search(list(self.data), item)[0]
dict = Dict()
num_of_commands = int(input())
for n in range(num_of_commands):
input_str = input()
command, data = input_str.split(' ')
if command == 'insert':
dict.insert(convert_ACGT_to_int(data))
else:
if dict.find(convert_ACGT_to_int(data)):
print('yes')
else:
print('no')
| Traceback (most recent call last):
File "/tmp/tmphoiajldq/tmpdp3vo7ux.py", line 141, in <module>
num_of_commands = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s763385345 | p02269 | u589886885 | 1471353455 | Python | Python3 | py | Runtime Error | 0 | 0 | 241 | mport sys
n = int(input())
dic = {}
input_ = sys.stdin.readlines()
for i in input_:
c, s = i.split()
if c == 'insert':
dic[s] = 0
else:
if s in dic:
print('yes')
else:
print('no') | File "/tmp/tmpqzywq2_p/tmpsddh8fq_.py", line 1
mport sys
^^^
SyntaxError: invalid syntax
| |
s287158011 | p02269 | u135273382 | 1476160018 | Python | Python3 | py | Runtime Error | 0 | 0 | 282 | import sys
dict = {}
l = []
line = map(lambda x: x.split(), sys.stdin.readlines())
s = ""
for (c, arg) in line:
if c == "insert":
dict[arg] = 0
elif c == "find":
if arg in dict:
s += "yes\n"
else:
s += "no\n"
print(s, end="") | ||
s337076763 | p02269 | u135273382 | 1476160071 | Python | Python3 | py | Runtime Error | 0 | 0 | 306 | import sys
??
n = int(input())
dic = {}
input_ = sys.stdin.readlines()
??
for i in input_:
????????c, s = i.split()
????????if c == 'insert':
????????????????dic[s] = 0
????????else:
????????????????if s in dic:
????????????????????????print('yes')
????????????????else:
????????????????????????print('no') | File "/tmp/tmpnussyb1t/tmp1w3t6slp.py", line 2
??
^
SyntaxError: invalid syntax
| |
s039726043 | p02269 | u742013327 | 1480309741 | Python | Python3 | py | Runtime Error | 0 | 0 | 400 | #http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ALDS1_4_C&lang=jp
#??????
if __name__ == "__main__":
n_line = int(input())
input_list = [tuple(input.split()) for i in range(n_line)]
l = []
for c, s in input_list:
if c == "insert":
l.append(s)
else:
if s in c:
print("yes")
else:
print("no") | Traceback (most recent call last):
File "/tmp/tmp8f91kqqt/tmpu7ln4s61.py", line 4, in <module>
n_line = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s843508992 | p02269 | u923668099 | 1484391964 | Python | Python3 | py | Runtime Error | 0 | 0 | 973 | import sys
def h1(key):
return key % M
def h2(key):
return 1 + key % (M - 1)
def H(key, i):
return (h1(key) + i * h2(key)) % M
def my_insert(dic, key):
i = 0
while 1:
j = H(key, i)
if dic[j] is None:
dic[j] = key
return j
else:
i += 1
def my_search(dic, key):
i = 0
while 1:
j = H(key, i)
if dic[j] == key:
return True
elif dic[j] is None or i >= M:
return False
else:
i += 1
def str2int(s):
res = s
res = res.replace("A", "1")
res = res.replace("C", "2")
res = res.replace("G", "3")
res = res.replace("T", "4")
return int(res)
M = 1_000_003
dic = [None] * M
n = int(sys.stdin.readline())
for k in range(n):
cmd, s = sys.stdin.readline().split()
if cmd == "insert":
my_insert(dic, str2int(s))
else:
print("yes" if my_search(dic, str2int(s)) else "no") | Traceback (most recent call last):
File "/tmp/tmpok3syk0w/tmplesvcwu0.py", line 48, in <module>
n = int(sys.stdin.readline())
^^^^^^^^^^^^^^^^^^^^^^^^^
ValueError: invalid literal for int() with base 10: ''
| |
s413538531 | p02269 | u086566114 | 1488197944 | Python | Python | py | Runtime Error | 0 | 0 | 2101 | # -*- coding: utf-8 -*-
def input_converter(key_string):
key_string = key_string.replace('A', '1')
key_string = key_string.replace('T', '2')
key_string = key_string.replace('C', '3')
key_string = key_string.replace('G', '4')
return int(key_string)
class HashTable(object):
def __init__(self, hash_size = 2 ** 30):
self.hash_size = hash_size
self.hash_array = [None] * self.hash_size
def insert_value(self, data, key):
collision_number = 0
next_index = self.hash_function(key, collision_number)
while self.hash_array[next_index] is not None:
collision_number += 1
next_index = self.hash_function(key, collision_number)
# print self.hash_array[next_index]
self.hash_array[next_index] = data
def search_value(self, data, key):
collision_number = 0
next_index = self.hash_function(key, collision_number)
next_data = self.hash_array[next_index]
while True:
if (next_data is None) or (collision_number > self.hash_size):
return False
elif next_data == data:
return True
else:
collision_number +=1
next_index = self.hash_function(key, collision_number)
next_data = self.hash_array[next_index]
def hash_function(self, key, collision_number):
def h1(key):
return key % self.hash_size
def h2(key):
return key % (self.hash_size - 1)
return (h1(key) + collision_number * h2(key)) % self.hash_size
def main():
input_size = int(raw_input())
hash_table = HashTable()
counter = 0
while counter < input_size:
command, key = raw_input().split(' ')
if command == 'insert':
hash_table.insert_value(key, input_converter(key))
else:
if hash_table.search_value(key, input_converter(key)):
print 'yes'
else:
print 'no'
counter += 1
if __name__ == '__main__':
main() | File "/tmp/tmpzrxu5nsw/tmp3riqxap8.py", line 59
print 'yes'
^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s234230849 | p02269 | u086566114 | 1488199047 | Python | Python | py | Runtime Error | 0 | 0 | 431 | # -*- coding: utf-8 -*-
def main():
dictionary = {}
input_num = int(raw_input())
counter = 0
while counter < input_num:
command, key = raw_input().split(' ')
if command[0] == 'i':
dictionary[key] = None
else:
if key in dictionary:
print 'yes'
else:
???print 'no'
counter += 1
if __name__ == '__main__':
main() | File "/tmp/tmp0cq0yldo/tmpwmz39tsk.py", line 13
print 'yes'
^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s858125189 | p02269 | u227438830 | 1488273025 | Python | Python3 | py | Runtime Error | 0 | 0 | 250 | n = int(input())
dic = []
l = [list(i) for i in input().split]
for i in range(n):
if l[i][0] == "insert":
dic.append(l[i][1])
else:
if l[i][1] in dic:
print("yes")
else:
print("no")
| Traceback (most recent call last):
File "/tmp/tmpjrwcc3ib/tmpks3ox_vv.py", line 1, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s025634628 | p02269 | u548155360 | 1489052536 | Python | Python3 | py | Runtime Error | 0 | 0 | 204 | from collection import deque
D = deque()
N = int(input())
for i in range(N):
c, s = input().split()
if c == "insert":
d.append(s)
elif c == "find":
if (s in d):
print(Yes)
else:
print(No) | Traceback (most recent call last):
File "/tmp/tmpzipimil3/tmp9b7bvfah.py", line 1, in <module>
from collection import deque
ModuleNotFoundError: No module named 'collection'
| |
s648644998 | p02269 | u548155360 | 1489052588 | Python | Python3 | py | Runtime Error | 0 | 0 | 205 | from collections import deque
D = deque()
N = int(input())
for i in range(N):
c, s = input().split()
if c == "insert":
d.append(s)
elif c == "find":
if (s in d):
print(Yes)
else:
print(No) | Traceback (most recent call last):
File "/tmp/tmp1cck7mew/tmpq_wp_06r.py", line 4, in <module>
N = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s965547887 | p02269 | u548155360 | 1489053067 | Python | Python3 | py | Runtime Error | 0 | 0 | 207 | from collections import deque
D = set()
N = int(input())
for i in range(N):
c, s = input().split()
if c == "insert":
D.append(s)
elif c == "find":
if (s in D):
print("yes")
else:
print("no") | Traceback (most recent call last):
File "/tmp/tmpar2uukrz/tmpi23_v7vb.py", line 4, in <module>
N = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s842852951 | p02269 | u130834228 | 1490518993 | Python | Python3 | py | Runtime Error | 0 | 0 | 194 | n = int(input())
dict = []
for i in range(n):
order = input().split()
if order[0] == "insert":
dict.append(order[1])
else:
if order[1] in dict:
print(Yes) | Traceback (most recent call last):
File "/tmp/tmpwfto2myx/tmpa9oun9ia.py", line 1, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s550400181 | p02269 | u796784914 | 1494655397 | Python | Python | py | Runtime Error | 10 | 6384 | 473 | def main():
n = input()
D = []
O = []
for i in range(n):
c, k = raw_input().split()
if c == 'insert':
D.append(k)
else:
O.append(search(D,k))
for item in O:
print item
def search(D,k):
Dc = D[:]
if D == []:
return 'no'
else:
d = Dc.pop()
if d == k:
return 'yes'
else:
return search(Dc,k)
if __name__ == "__main__":
main() | File "/tmp/tmp09nend_1/tmpdbi880yf.py", line 13
print item
^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s973734423 | p02269 | u796784914 | 1494657424 | Python | Python | py | Runtime Error | 10 | 6352 | 474 | def main():
n = input()
D = []
O = []
for i in range(n):
c, k = raw_input().split()
if c == 'insert':
D.append(k)
else:
O.append(search(D,k))
for item in O:
print item
def search(D,k):
Dc = D[:]
if Dc == []:
return 'no'
else:
d = Dc.pop()
if d == k:
return 'yes'
else:
return search(Dc,k)
if __name__ == "__main__":
main() | File "/tmp/tmpnw8k775t/tmpri3c8az_.py", line 13
print item
^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s135914489 | p02269 | u796784914 | 1494658840 | Python | Python | py | Runtime Error | 10 | 6388 | 489 | def main():
n = input()
D = []
O = []
for i in range(n):
c, k = raw_input().split()
if c == 'insert':
D.append(k)
else:
O.append(search(D,k))
for item in O:
print item
return 0
def search(D,k):
Dc = D[:]
if Dc == []:
return 'no'
else:
d = Dc.pop()
if d == k:
return 'yes'
else:
return search(Dc,k)
if __name__ == "__main__":
main() | File "/tmp/tmp3yhe3qz8/tmp2rcvehpu.py", line 13
print item
^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s080918926 | p02269 | u796784914 | 1494660034 | Python | Python | py | Runtime Error | 0 | 0 | 503 | from collections import deque
def main():
n = input()
D = deque([])
O = deque([])
for i in range(n):
c, k = raw_input().split()
if c == 'insert':
D.append(k)
else:
O.append(search(D,k))
for item in O:
print item
return 0
def search(D,k):
Dc = D[:]
o = 'no'
while Dc != []:
d = Dc.pop()
if d == k:
o = 'yes'
break
return o
if __name__ == "__main__":
main() | File "/tmp/tmpbuzlk1fb/tmp06n120og.py", line 15
print item
^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s644645295 | p02269 | u782850499 | 1498313093 | Python | Python3 | py | Runtime Error | 0 | 0 | 795 | d_list = set()
times = int(input())
for i in range(times):
elm = input().split()
code = elm[1].replace("A","1")
code = code.replace("C","2")
code = code.replace("G","3")
code = code.replace("T","4")
if elm[0] == "insert":
d_list.add(code)
d_list = sorted(d_list)
elif elm[0] == "find":
lower_bound = 0
upper_bound = len(d_list)-1
found = False
while lower_bound <= upper_bound and not found:
mid = (lower_bound + upper_bound)//2
if d_list[mid] < code:
lower_bound = mid + 1
elif d_list[mid] > code:
upper_bound = mid - 1
else:
found = True
if found:
print("yes")
else:
print("no") | Traceback (most recent call last):
File "/tmp/tmpg1_v3c2y/tmpre2e4aey.py", line 3, in <module>
times = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s187638535 | p02269 | u591588652 | 1499003968 | Python | Python3 | py | Runtime Error | 0 | 0 | 191 | n = int(input())
dic = set()
for i in range(n):
Cmd, Key = input().split()
if Cmd == "insert":
dic.add(Key)
else:
if Key in dic:
print("yes")
else:
print("no") | File "/tmp/tmp2zk9x0_3/tmphbo0zckj.py", line 6
dic.add(Key)
TabError: inconsistent use of tabs and spaces in indentation
| |
s894953521 | p02269 | u264972437 | 1500448737 | Python | Python3 | py | Runtime Error | 0 | 0 | 205 | n = int(input())
dictionary = dict()
for i in range(n):
command,data = input().split()
if command = 'insert':
dictionary[data] = 1
else:
if data in dictionary:
print('yes')
else:
print('no') | File "/tmp/tmpytn4vf6k/tmpe0vbc2t_.py", line 5
if command = 'insert':
^^^^^^^^^^^^^^^^^^
SyntaxError: invalid syntax. Maybe you meant '==' or ':=' instead of '='?
| |
s049435595 | p02269 | u193453446 | 1500537692 | Python | Python3 | py | Runtime Error | 30 | 7800 | 5306 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
??\????????????????????????????°?????????????????????????????£??????????????????????
insert str: ????????? str ??????????????????
find str: ????????? str ?????????????????´??? 'yes'??¨????????????????????´??? 'no'??¨???????????????
??????????????????????????????'A', 'C', 'G', 'T' ???????¨????????????????????§????????????????
1 ??? ?????????????????? ??? 12 n ??? 1,000,000
"""
import sys
# ????´??????¢?????¬????????????
NoVal = -1
# ????????¨????????????
Black = 0
Red = 1
class Node:
""" ???????????? """
def __init__(self, pnode, color, value):
""" ????????????????????? """
self.P = pnode # ????????????
self.V = value # ???
self.C = color # ???
self.L = NoVal # ??????
self.R = NoVal # ??????
def Find(r,value):
""" ????????¨??¢?´¢ """
if value == r.V:
# print("Finded p:'{}' v:'{}'".format(r.V, value))
return True
if value < r.V: # ?°????????????§??????
if isinstance(r.L, Node) == True:
# print("Left Search p:'{}' v:'{}'".format(r.V, value))
return Find(r.L, value)
elif value > r.V: # ??§???????????§??????
if isinstance(r.R, Node) == True:
# print("Right Search p:'{}' v:'{}'".format(r.V, value))
return Find(r.R, value)
# print("Not Exists r:{} v:'{}'".format(r.V, value))
return False
def Insert(r, value):
""" ????????¨???????????? """
if isinstance(r, Node) == False: # ???????????????
# print("Root Insert '{}'".format(value))
return Node(NoVal, Black, value) # ????´??????\
if value == r.V: # ???????????????????????????????????§??????
# print("Exists p:'{}' v:'{}'".format(r.V, value))
return NoVal
if value < r.V: # ?°???????
if isinstance(r.L, Node) == False: # ??????????????????
r.L = Node(r, Red, value) # ??????????´??????\
# print("Left Insert '{}'".format(value))
return r.L
else:
# print("Next Left p'{}' v'{}'".format(r.V, value))
Insert(r.L, value) # ?????????
elif value > r.V: # ??§??????
if isinstance(r.R, Node) == False: # ??????????????????
# print("Right Insert '{}'".format(value))
r.R = Node(r, Red, value) # ??????????´??????\
return r.R
else:
# print("Next Right p:'{}' v:'{}'".format(r.V, value))
Insert(r.R, value) # ?????????
def RotateR(a):
""" ????????¨???????????¢ a:????????? ?????????:??°????????? """
b = a.L # a ???????????? b ??¨??????
b.P = a.P # b ????????? a ???????????????
a.P = b # a ????????? b ?????????
a.L = b.R # a ???????????? b ??????????????????
a.L.P = a # a ?????????????????? a ?????????
b.R = a # b ???????????? a ?????????
if b.P != NoVal: # b ??????????´????????????????
if b.P.L == a: # b ?????????????????? a ??????
b.P.L = b # b ?????????????????? b ?????????
elif b.P.R == a: # b ?????????????????? a ??????
b.P.R = b # b ?????????????????? b ?????????
return b
def RotateL(a):
""" ????????¨???????????¢ r:????????? """
b = a.R # a ???????????? b ??¨??????
b.P = a.P # b ????????? a ???????????????
a.P = b # a ????????? b ?????????
a.R = b.L # a ???????????? b ??????????????????
a.R.P = a # a ?????????????????? a ?????????
b.L = a # b ???????????? a ?????????
if b.P != NoVal: # b ??????????´????????????????
if b.P.L == a: # b ?????????????????? a ??????
b.P.L = b # b ?????????????????? b ?????????
elif b.P.R == a: # b ?????????????????? a ??????
b.P.R = b # b ?????????????????? b ?????????
return b
def Restruct(r):
""" ????§???? """
if isinstance(r, Node) == False: # ?????§??????
return
if r.C == Black: # ???????????????????????????????????????
return
p = r.P
if p == NoVal: # ???????????????
r.C = Black # ???????????????????????????
return
if p.C == Red: # ????????????
if p.P.L == p: # ????????????
if p.L == r: # ???????????????
p = RotateR(p) # LL:????????¢
else: # ???????????????
RotateL(r) # LR: 1.????????¢
p = RotateR(p) # LR: 2.????????¢
else: # ????????????
if r.P.L == r: # ???????????????
RotateR(r) # RL: 1.????????¢
p = RotateL(p) # RL: 2.????????¢
else: # ???????????????
p = RotateL(p) ## LR: ????????¢
if p.C == Red: # ??°???????????????????????°???????????????????§????
Restruct(p)
def main():
""" ????????? """
num = int(input().strip())
istr = sys.stdin.read()
cmds = list(istr.splitlines())
root = NoVal
for i in cmds:
if i[0] == "i":
r = Insert(root, i[7:])
if isinstance(root, Node) == False:
root = r
elif i[0] == "f":
ret = Find(root, i[5:])
if ret == True:
print("yes")
else:
print("no")
if __name__ == '__main__':
main() | Traceback (most recent call last):
File "/tmp/tmp_55ahl6n/tmpczpig0m5.py", line 156, in <module>
main()
File "/tmp/tmp_55ahl6n/tmpczpig0m5.py", line 138, in main
num = int(input().strip())
^^^^^^^
EOFError: EOF when reading a line
| |
s959849607 | p02269 | u519227872 | 1501953277 | Python | Python3 | py | Runtime Error | 0 | 0 | 1103 | n = int(input())
class Hash:
def __init__(self):
self.m = 1000003
self.T = [None] * self.m
def insert(self, key):
i = 0
while True:
j = self.h(key, i)
if i >0:
if self.T[j] == None:
self.T[j] = key
break
else:
i = i + 1
def search(self, key):
i = 0
while True:
j = self.h(key, i)
if self.T[j] == key:
return j
elif self.T[j] == None:
return None
else:
i += 1
return self.T[self.h(key)]
def h(self, key, i):
ki = self.key2int(key)
h1 = ki % self.m
h2 = i * (1 + (ki % (self.m - 1)))
return (h1 + h2) % self.m
def key2int(self, key):
return sum([['A', 'C', 'G', 'T'].index(s) + 1 for s in key])
h = Hash()
for i in range(n):
op, st = input().split()
if op == 'insert':
h.insert(st)
else:
if h.search(st):
print('yes')
else:
print('no') | File "/tmp/tmpyq8v_yzp/tmp8v2gzz3d.py", line 12
if self.T[j] == None:
^
IndentationError: expected an indented block after 'if' statement on line 11
| |
s742722158 | p02269 | u510829608 | 1502248824 | Python | Python3 | py | Runtime Error | 0 | 0 | 129 | 13
insert AAA
insert AAC
insert AGA
insert AGG
insert TTT
find AAA
find CCC
find CCC
insert CCC
find CCC
insert T
find TTT
find T | File "/tmp/tmpbd11fot9/tmp5m57g8ih.py", line 2
insert AAA
^^^
SyntaxError: invalid syntax
| |
s310686763 | p02269 | u350064373 | 1502612574 | Python | Python3 | py | Runtime Error | 0 | 0 | 191 | import sys
ls = []
line = map(lambda x:x.split(), sys.stdin.readlines())
for i in line:
if i[0] == "insert":
ls.append(i[1])
else:
print("yes" if i[1] in ls else "no") | ||
s942593541 | p02269 | u659034691 | 1503172766 | Python | Python3 | py | Runtime Error | 20 | 7780 | 1410 | def f(s,t):
# As="ABCDEFGHIJKLMNOPQRSTUVWXYZ"
As="ACGT"
if s==t:
return 0
else:
i=0
while i<4 and s!=As[i]:
i+=1
while i<4 and t!=As[i]:
i+=1
if i<4:
return -1
else:
return 1
def f3(u,v):
m=len(u)
if len(v)<m:
m=len(v)
i=0
while i<m and u[i]==v[i]:
i+=1
if i>=m:
if len(u)==len(v):
return 0
elif m==len(u):
return -1
else:
return 1
else:
return f(u[i],v[i])
n=int (input ())
D=[]
for i in range(n):
Od=input (). split ()
l=len(D)
gs=Od[1]
j=0
ts=0
if l>0:
r=1
r=l%2
p=1
l//=2
j+=l
ts=f3(gs,D[j])
# print(ts)
while l>1 and ts!=0:#light over
if ts*p>0 and r==0:
l-=1
l//=2
if ts<0:
j-=l+1
p=-1
else:
j+=l+1
p=1
ts=f3(gs,D[j])
r=1
r=l%2
if ts*p>0 and r==0:
l-=1
if l==1 and ts!=0:
j+=ts
ts=f3(gs,D[j])
if Od[0]=="insert":
# print(gs)
if ts==-1:
ts=0
D.insert(j+ts,gs)
# print(D)
elif ts==0:
print("yes")
else:
print("no") | Traceback (most recent call last):
File "/tmp/tmphlhnns7d/tmp59646tht.py", line 32, in <module>
n=int (input ())
^^^^^^^^
EOFError: EOF when reading a line
| |
s031329897 | p02269 | u146816547 | 1506163842 | Python | Python | py | Runtime Error | 0 | 0 | 226 | n = int(raw_input())
L = []
for i in xrange(n):
a, b = map(raw_input().split())
if a == "insert":
L.append(b)
if a == "find":
if b in L:
print "yes"
else:
print "no" | File "/tmp/tmpbzo7is2n/tmplq5d9ln4.py", line 10
print "yes"
^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s525604737 | p02269 | u588555117 | 1507990351 | Python | Python3 | py | Runtime Error | 30 | 7728 | 841 | n = int(input())
dic = [0]*n
def hash1(x):
return x % n
def hash2(x):
return x % (n-1)
for i in range(n):
line = input().split()
com = line[0]
st = str(line[1])
su = 0
for i in st:
if i == 'A':
su += 1
elif i == 'C':
su += 2
elif i == 'G':
su += 3
else:
su += 4
if com == 'insert':
ind = hash1(su)
while True:
if dic[ind] == 0:
dic[ind] = st
break
else:
ind += hash2(su)
else:
ind = hash1(su)
while True:
if dic[ind] == st:
print('yes')
break
elif dic[ind] == 0:
print('no')
break
else:
ind += hash2(su) | Traceback (most recent call last):
File "/tmp/tmp4f4u6x0u/tmp8alea99x.py", line 1, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s317664068 | p02269 | u845015409 | 1512460739 | Python | Python | py | Runtime Error | 0 | 0 | 224 | if __name__ == '__main__':
n = int(input())
dic = set()
for i in range(n):
Cmd, Key = input().split()
if Cmd == "insert":
dic.add(Key)
else:
if Key in dic:
print("yes")
else:
print("no")
view raw | File "/tmp/tmpmrn2xtf8/tmpmrktk4xd.py", line 16
view raw
^^^
SyntaxError: invalid syntax
| |
s903005450 | p02269 | u845015409 | 1512460748 | Python | Python3 | py | Runtime Error | 0 | 0 | 224 | if __name__ == '__main__':
n = int(input())
dic = set()
for i in range(n):
Cmd, Key = input().split()
if Cmd == "insert":
dic.add(Key)
else:
if Key in dic:
print("yes")
else:
print("no")
view raw | File "/tmp/tmp7r9xqa4g/tmp8ixkc_nh.py", line 16
view raw
^^^
SyntaxError: invalid syntax
| |
s100254556 | p02269 | u845015409 | 1512460800 | Python | Python | py | Runtime Error | 0 | 0 | 219 | n = int(input())
dic = set()
for i in range(n):
cmd, key = input().split()
if cmd == "find":
if key in dic:
print("yes")
else:
print("no")
else:
dic.add(key) | Traceback (most recent call last):
File "/tmp/tmpcajitfg3/tmptb8y60rk.py", line 1, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s180992584 | p02269 | u530663965 | 1513837728 | Python | Python3 | py | Runtime Error | 0 | 0 | 345 | import sys
def main():
_ = int(input())
imps = sys.stdin.readlines()
db = []
for imp in imps:
command = imp.split(' ')
if command[0] == 'insert':
db.append(command[1])
else
if command[1] in db:
print('yes')
else:
print('no')
main() | File "/tmp/tmppuagmnew/tmpxbuklbd0.py", line 14
else
^
SyntaxError: expected ':'
| |
s661279927 | p02269 | u530663965 | 1513837777 | Python | Python3 | py | Runtime Error | 0 | 0 | 284 | import sys
def main():
_ = int(input())
imps = sys.stdin.readlines()
db = {}
for imp in imps:
c, k = imp.split(' ')
if c == 'insert':
c[k] = 0
elif db in k:
print('yes')
else:
print('no')
main() | Traceback (most recent call last):
File "/tmp/tmp2qiecw9b/tmp4tdscedl.py", line 20, in <module>
main()
File "/tmp/tmp2qiecw9b/tmp4tdscedl.py", line 5, in main
_ = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s371842814 | p02269 | u530663965 | 1513837840 | Python | Python3 | py | Runtime Error | 0 | 0 | 284 | import sys
def main():
_ = int(input())
imps = sys.stdin.readlines()
db = {}
for imp in imps:
c, k = imp.split(' ')
if c == 'insert':
c[k] = 0
elif db in k:
print('yes')
else:
print('no')
main() | Traceback (most recent call last):
File "/tmp/tmpxucflha1/tmpwvd41f1x.py", line 20, in <module>
main()
File "/tmp/tmpxucflha1/tmpwvd41f1x.py", line 5, in main
_ = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s036642238 | p02269 | u530663965 | 1513837878 | Python | Python3 | py | Runtime Error | 0 | 0 | 285 | import sys
def main():
_ = int(input())
imps = sys.stdin.readlines()
db = {}
for imp in imps:
c, k = imp.split(' ')
if c == 'insert':
db[k] = 0
elif db in k:
print('yes')
else:
print('no')
main() | Traceback (most recent call last):
File "/tmp/tmpb6pid_qt/tmpsy_r4s35.py", line 20, in <module>
main()
File "/tmp/tmpb6pid_qt/tmpsy_r4s35.py", line 5, in main
_ = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s917661619 | p02269 | u530663965 | 1513838116 | Python | Python3 | py | Runtime Error | 0 | 0 | 285 | import sys
def main():
_ = int(input())
imps = sys.stdin.readlines()
db = {}
for imp in imps:
c, k = imp.split(' ')
if c == 'insert':
db[k] = 0
elif db in k:
print('yes')
else:
print('no')
main() | Traceback (most recent call last):
File "/tmp/tmpb7jdx6_n/tmpnmqxupuq.py", line 20, in <module>
main()
File "/tmp/tmpb7jdx6_n/tmpnmqxupuq.py", line 5, in main
_ = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s266057883 | p02269 | u662418022 | 1516716930 | Python | Python3 | py | Runtime Error | 0 | 0 | 1369 | # -*- coding: utf-8 -*-
class HashTable(dict):
def __init__(self, length):
dict.__init__(self)
self.length = length
#self[:] = [None] * length
def h1(self, key):
return key % self.length
def h2(self, key):
return 1 + (key % (self.length - 1))
def h(self, key, i):
return (self.h1(key) + i*self.h2(key)) % self.length
def insert(self, key):
i = 0
while True:
j = self.h(key, i)
if self[j] is None:
self[j] = key
return j
else:
i += 1
def search(self, key):
i = 0
while True:
j = self.h(key, i)
if self[j] == key:
return j
elif self[j] is None or i >= self.length:
return None
else:
i += 1
def getNum(char):
char2num = str.maketrans("ACGT", "1234")
return int(char.translate(char2num))
if __name__ == '__main__':
n = int(input())
T = HashTable(n)
C = [input().split(" ") for i in range(n)]
C = map(lambda x:(x[0], getNum(x[1])), C)
for command, num in C:
if command == "insert":
T.insert(num)
else:
if T.search(num) is None:
print("no")
else:
print("yes")
| Traceback (most recent call last):
File "/tmp/tmps9k83lz5/tmpn_nx68yp.py", line 45, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s819277923 | p02269 | u150984829 | 1518600504 | Python | Python3 | py | Runtime Error | 0 | 0 | 124 | import sys
d={}
for e in sys.stdin.readlines()[1:]:
if'f'==e[0]:
print('yes'if e[5:]in d else'no')
else:
d[e[7:]]=0
| File "/tmp/tmp42eew8bp/tmpe3guzhha.py", line 5
print('yes'if e[5:]in d else'no')
^
SyntaxError: invalid non-printable character U+3000
| |
s166337795 | p02269 | u912143677 | 1522386124 | Python | Python3 | py | Runtime Error | 0 | 0 | 1046 | m = 1e13
NIL = -1
def h1(key):
return key % m
def h2(key):
return 1 + (key % (m - 1))
def h(key, i):
return (h1(key) + i * h2(key)) % m
def insert(t, key):
i = 0
while True:
j = h(key, i)
if t[j] == NIL:
t[j] = key
return j
else:
i += 1
def find(t, key):
i = 0
while True:
j = h(key, i)
if t[j] == key:
return j
elif t[j] == NIL or i >= m:
return NIL
else:
i += 1
def convert(word):
result = ""
for i in word:
if i == "A":
result += "1"
elif i == "T":
result += "2"
elif i == "G":
result += "3"
else:
result += "4"
return int(result)
t = [NIL]*m
n = int(input())
for i in range(n):
com = input().split()
key = convert(com[1])
if com[0] == "insert":
insert(t, key)
else:
if find(t, key) != NIL:
print("yes")
else:
print("no")
| Traceback (most recent call last):
File "/tmp/tmpj_jis0e8/tmp5yy4ffcu.py", line 48, in <module>
t = [NIL]*m
~~~~~^~
TypeError: can't multiply sequence by non-int of type 'float'
| |
s669262813 | p02269 | u912143677 | 1522386146 | Python | Python3 | py | Runtime Error | 0 | 0 | 1045 | m = 1e8
NIL = -1
def h1(key):
return key % m
def h2(key):
return 1 + (key % (m - 1))
def h(key, i):
return (h1(key) + i * h2(key)) % m
def insert(t, key):
i = 0
while True:
j = h(key, i)
if t[j] == NIL:
t[j] = key
return j
else:
i += 1
def find(t, key):
i = 0
while True:
j = h(key, i)
if t[j] == key:
return j
elif t[j] == NIL or i >= m:
return NIL
else:
i += 1
def convert(word):
result = ""
for i in word:
if i == "A":
result += "1"
elif i == "T":
result += "2"
elif i == "G":
result += "3"
else:
result += "4"
return int(result)
t = [NIL]*m
n = int(input())
for i in range(n):
com = input().split()
key = convert(com[1])
if com[0] == "insert":
insert(t, key)
else:
if find(t, key) != NIL:
print("yes")
else:
print("no")
| Traceback (most recent call last):
File "/tmp/tmpee1m50_j/tmpzjzxvmpy.py", line 48, in <module>
t = [NIL]*m
~~~~~^~
TypeError: can't multiply sequence by non-int of type 'float'
| |
s475118702 | p02269 | u836133197 | 1524671305 | Python | Python3 | py | Runtime Error | 0 | 0 | 276 | n = int(input())
o = {""}
for i in range(n):
a = len(o)
op, ob = map(str, input().split())
if op = "find"
o.add(ob)
if len(o) > a:
print("no")
o.discard(ob)
else:
print("yes")
else:
o.add(ob)
| File "/tmp/tmpt3w6pfr2/tmpa755yg_k.py", line 6
if op = "find"
^^^^^^^^^^^
SyntaxError: invalid syntax. Maybe you meant '==' or ':=' instead of '='?
| |
s234964837 | p02269 | u836133197 | 1524671344 | Python | Python3 | py | Runtime Error | 0 | 0 | 277 | n = int(input())
o = {""}
for i in range(n):
a = len(o)
op, ob = map(str, input().split())
if op == "find"
o.add(ob)
if len(o) > a:
print("no")
o.discard(ob)
else:
print("yes")
else:
o.add(ob)
| File "/tmp/tmpsg8oapel/tmpa572m0zi.py", line 6
if op == "find"
^
SyntaxError: expected ':'
| |
s875037183 | p02269 | u150984829 | 1524898186 | Python | Python3 | py | Runtime Error | 0 | 0 | 290 | import sys
def m():
d={};input()
for e in sys.stdin:
if'f'==e[0]:print(['no','yes'][e[5:]in d])
else:d[e[7:]]=0
if'__main__'==__name__:m()import sys
def m():
d={0};input()
for e in sys.stdin:
if'f'==e[0]:print(['no','yes'][e[5:]in d])
else:d|={e[7:]}
if'__main__'==__name__:m()
| File "/tmp/tmpstxuv77o/tmpz6pic438.py", line 7
if'__main__'==__name__:m()import sys
^^^^^^
SyntaxError: invalid syntax
| |
s891307062 | p02269 | u126478680 | 1525234349 | Python | Python3 | py | Runtime Error | 0 | 0 | 1074 | import sys
M = 1046527
def h1(key):
return key % M
def h2(key):
return 1 + (key %(M-1))
def h3(key, i):
return (h1(key) + i*h2(key)) % M
word_dic = {'A': 1, 'T': 2, 'G': 3, 'C': 4}
def getkey(text):
sum = 0
p = 1
for c in text:
sum += p*word_dic[c]
p *= 5
return sum
dict = {}
def find(text):
global dict
key = getkey(text)
i = 0
while i < M:
h = h3(key, i)
if dict.get(h) == None:
break
elif dict[h] == text:
return True
i += 1
return False
def insert(text):
global dict
key = getkey(text)
i = 0
while i < M:
j = h3(key, i)
if dict.get(j) == None:
dict[j] = text
break
else:
i += 1
n = int(input())
operations = sys.stdin.readlines()
for operation in operations:
op, text = operation.split(' ')
if op == 'insert':
insert(text)
elif op == 'find':
rst = find(text)
if rst:
print('yes')
else:
print('no')
| Traceback (most recent call last):
File "/tmp/tmpckqgorhc/tmpkvgei99z.py", line 48, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s830207641 | p02269 | u126478680 | 1525234998 | Python | Python3 | py | Runtime Error | 0 | 0 | 1061 | import sys
M = 1046527
def h1(key):
return key % M
def h2(key):
return 1 + (key %(M-1))
def h3(key, i):
return (h1(key) + i*h2(key)) % M
word_dic = {'A': 1, 'T': 2, 'G': 3, 'C': 4}
def getkey(text):
sum = 0
p = 1
for c in text:
sum += p*word_dic[c]
p *= 5
return sum
dict = {}
def find(text):
global dict
key = getkey(text)
i = 0
while i < M:
h = h3(key, i)
if dict.get(h) == None:
break
elif dict[h] == text:
return True
i += 1
return False
def insert(text):
global dict
key = getkey(text)
i = 0
while i < M:
j = h3(key, i)
if dict.get(j) == None:
dict[j] = text
break
else:
i += 1
n = int(input())
ope = sys.stdin.readlines()
for ope in operations:
op, text = operation.split(' ')
if op == 'insert':
insert(text)
elif op == 'find':
rst = find(text)
if rst:
print('yes')
else:
print('no')
| Traceback (most recent call last):
File "/tmp/tmpdia3crwa/tmpcnuds_ut.py", line 48, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s391195770 | p02269 | u063056051 | 1526116792 | Python | Python3 | py | Runtime Error | 0 | 0 | 232 | n = int(input())
s = set()//集合
for _ in range(n):
inst = input().split()
if inst[0] == "insert":
s.add(inst[1])
else:
if inst[1] in s:
print("yes")
else:
print("no")
| Traceback (most recent call last):
File "/tmp/tmpw62c_7sf/tmpqfkzyl0i.py", line 1, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s065334139 | p02269 | u909075105 | 1526383060 | Python | Python3 | py | Runtime Error | 0 | 0 | 193 | n=input()
A={}
for i in range(n):
x,y=input().split()
if x=='insert':
d.add(y)
else:
if b in d:
print('yes')
else:
print('no')
| Traceback (most recent call last):
File "/tmp/tmpu4t0wban/tmp6k6djmt2.py", line 1, in <module>
n=input()
^^^^^^^
EOFError: EOF when reading a line
| |
s107216728 | p02269 | u909075105 | 1526383089 | Python | Python3 | py | Runtime Error | 0 | 0 | 193 | n=input()
A={}
for i in range(n):
x,y=input().split()
if x=='insert':
A.add(y)
else:
if A in y:
print('yes')
else:
print('no')
| Traceback (most recent call last):
File "/tmp/tmp1_1xyl72/tmpvrp1bwdb.py", line 1, in <module>
n=input()
^^^^^^^
EOFError: EOF when reading a line
| |
s830808565 | p02269 | u909075105 | 1526383133 | Python | Python3 | py | Runtime Error | 0 | 0 | 196 | n=input()
A=set()
for i in range(n):
x,y=input().split()
if x=='insert':
A.add(y)
else:
if A in y:
print('yes')
else:
print('no')
| Traceback (most recent call last):
File "/tmp/tmpd_39gxh_/tmpa12hg18d.py", line 1, in <module>
n=input()
^^^^^^^
EOFError: EOF when reading a line
| |
s965216837 | p02269 | u909075105 | 1526383187 | Python | Python3 | py | Runtime Error | 0 | 0 | 201 | n=int(input())
A=set()
for i in range(n):
x,y=input().split()
if x=='insert':
A.add(y)
else:
if A in y:
print('yes')
else:
print('no')
| Traceback (most recent call last):
File "/tmp/tmptg45lozi/tmpzcq80nau.py", line 1, in <module>
n=int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s678895430 | p02269 | u728137020 | 1526424061 | Python | Python3 | py | Runtime Error | 0 | 0 | 273 | n=int(input())
list=[]
list1=[]
for i in range(n):
a,b=map(str,input().split())
if a=="insert":
list.append(b)
if a=="find":
if b in list:
list1.append("yes")
else:
list1.append("no")
for i in list1:
print(i
| File "/tmp/tmpawasj54m/tmpt2insafy.py", line 15
print(i
^
SyntaxError: '(' was never closed
| |
s427660886 | p02269 | u055885332 | 1526436318 | Python | Python3 | py | Runtime Error | 0 | 0 | 293 | #16D8101014F Kurume Ryunosuke 久留米竜之介 2018/5/16 Python3
n = int(input())
box = set()
for _ in range(n):
tmp,mozi= input().split()
if tmp == "find":
if word in box:
print("yes")
else:
print("no")
else:
dic.add(mozi)
| Traceback (most recent call last):
File "/tmp/tmpiredv9hc/tmpe8hqxfae.py", line 2, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s461951259 | p02269 | u055885332 | 1526436335 | Python | Python3 | py | Runtime Error | 0 | 0 | 293 | #16D8101014F Kurume Ryunosuke 久留米竜之介 2018/5/16 Python3
n = int(input())
box = set()
for i in range(n):
tmp,mozi= input().split()
if tmp == "find":
if word in box:
print("yes")
else:
print("no")
else:
dic.add(mozi)
| Traceback (most recent call last):
File "/tmp/tmp1uqz9mlo/tmpggrmp7ip.py", line 2, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s881360129 | p02269 | u055885332 | 1526436424 | Python | Python3 | py | Runtime Error | 0 | 0 | 292 | #16D8101014F Kurume Ryunosuke 久留米竜之介 2018/5/16 Python3
n = int(input())
box = set()
for _ in range(n):
tmp,mozi= input().split()
if tmp == "find":
if word in box:
print("yes")
else:
print("no")
else:
box.add(mozi)
| Traceback (most recent call last):
File "/tmp/tmp4cxs_bb_/tmpbcx6xq5l.py", line 2, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s938898819 | p02269 | u055885332 | 1526436436 | Python | Python3 | py | Runtime Error | 0 | 0 | 292 | #16D8101014F Kurume Ryunosuke 久留米竜之介 2018/5/16 Python3
n = int(input())
box = set()
for i in range(n):
tmp,mozi= input().split()
if tmp == "find":
if word in box:
print("yes")
else:
print("no")
else:
box.add(mozi)
| Traceback (most recent call last):
File "/tmp/tmp6746tcnb/tmpxer8q90j.py", line 2, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s717390537 | p02269 | u896240461 | 1526440904 | Python | Python3 | py | Runtime Error | 0 | 0 | 182 | n = int(input())
d = set()
for i in range(n):
x = input()
if x[0] == "i":
d.append(x[7:])
else :
if(x[5:] in d) : print("yes")
else : print("no")
| Traceback (most recent call last):
File "/tmp/tmplj72s7h_/tmp8_jn4zzm.py", line 1, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s394976369 | p02269 | u196653484 | 1526442734 | Python | Python3 | py | Runtime Error | 0 | 0 | 337 |
def Dictionary(b):
a=list(map(int,input().split()))
if(a[0] == "insert"):
b.append(a[1])
elif(a[0] == "find"):
if(a[1] in b):
print("yes")
else:
print("no")
if __name__ == "__main__":
n=int(input())
b=[]
for i in range(n):
Dictionary(b)
| Traceback (most recent call last):
File "/tmp/tmperq05rxb/tmp44h36yqq.py", line 13, in <module>
n=int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s122423645 | p02269 | u007270338 | 1527925471 | Python | Python3 | py | Runtime Error | 0 | 0 | 1290 | #coding:utf-8
n = int(input())
def converter(string):
ch_list = ["A", "C", "G", "T"]
new_string = ""
for ch in string:
for i in range(4):
if ch == ch_list[i]:
new_string += str(i+1)
return int(new_string)
def sosu(num):
while True:
i = 2
while i <= num ** (1/2) :
if num % i != 0:
i += 1
else:
num += 1
i = 2
break
return num
def h1(key):
return key % m
def h2(key):
return 1 + key % (m-1)
def hf(key, i):
return (h1(key)+i*h2(key)) % m
def insert(T, key):
i = 0
while True:
j = hf(key, i)
if T[j] == None:
T[j] = key
break
else:
i += 1
def search(T, key):
i = 0
while True:
j = hf(key, i)
if T[j] == key:
return "yes"
elif T[j] == None or i >= m:
return "no"
else:
i += 1
m = int(n*1.2)
m = sosu(m)
T = [None for num in range(n)]
cnt = 0
for i in range(n):
order, string = input().split()
if order == "insert":
key = converter(string)
insert(T,key)
if order == "find":
key = converter(string)
print(search(T, key))
| Traceback (most recent call last):
File "/tmp/tmp1t3e709j/tmpbtyxr13v.py", line 2, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s765689951 | p02269 | u007270338 | 1527925529 | Python | Python3 | py | Runtime Error | 0 | 0 | 1289 | #coding:utf-8
n = int(input())
def converter(string):
ch_list = ["A", "C", "G", "T"]
new_string = ""
for ch in string:
for i in range(4):
if ch == ch_list[i]:
new_string += str(i+1)
return int(new_string)
def sosu(num):
while True:
i = 2
while i <= num ** (1/2) :
if num % i != 0:
i += 1
else:
num += 1
i = 2
break
return num
def h1(key):
return key % m
def h2(key):
return 1 + key % (m-1)
def hf(key, i):
return (h1(key)+i*h2(key)) % m
def insert(T, key):
i = 0
while True:
j = hf(key, i)
if T[j] == None:
T[j] = key
break
else:
i += 1
def search(T, key):
i = 0
while True:
j = hf(key, i)
if T[j] == key:
return "yes"
elif T[j] == None or i >= m:
return "no"
else:
i += 1
#m = int(n*1.2)
m = sosu(m)
T = [None for num in range(m)]
cnt = 0
for i in range(n):
order, string = input().split()
if order == "insert":
key = converter(string)
insert(T,key)
if order == "find":
key = converter(string)
print(search(T, key))
| Traceback (most recent call last):
File "/tmp/tmpz6ga20hu/tmpwv9ntt40.py", line 2, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s979098772 | p02269 | u318430977 | 1528301717 | Python | Python3 | py | Runtime Error | 20 | 5604 | 1270 | class BTree:
def __init__(self):
self.value = None
self.left = None
self.right = None
def insert(self, s):
if self.value is None:
self.value = s
else:
if self.value < s:
if self.right is None:
self.right = BTree().insert(s)
else:
self.right = self.right.insert(s)
elif s < self.value:
if self.left is None:
self.left = BTree().insert(s)
else:
self.left = self.left.insert(s)
return self
def find(self, s):
if self.value == s:
return True
elif self.value < s:
if self.right is None:
return False
else:
return self.right.find(s)
else:
if self.left is None:
return False
else:
return self.left.find(s)
n = int(input())
tree = BTree()
for _ in range(n):
command = input().split()
if command[0] == "insert":
tree = tree.insert(command[1])
elif command[0] == "find":
if tree.find(command[1]):
print("yes")
else:
print("no")
| Traceback (most recent call last):
File "/tmp/tmpm6vp4z8q/tmpcxdtdyv5.py", line 38, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s899850062 | p02269 | u318430977 | 1528301900 | Python | Python3 | py | Runtime Error | 0 | 0 | 1271 | class BTree:
def __init__(self):
self.value = "ZZZ"
self.left = None
self.right = None
def insert(self, s):
if self.value is None:
self.value = s
else:
if self.value < s:
if self.right is None:
self.right = BTree().insert(s)
else:
self.right = self.right.insert(s)
elif s < self.value:
if self.left is None:
self.left = BTree().insert(s)
else:
self.left = self.left.insert(s)
return self
def find(self, s):
if self.value == s:
return True
elif self.value < s:
if self.right is None:
return False
else:
return self.right.find(s)
else:
if self.left is None:
return False
else:
return self.left.find(s)
n = int(input())
tree = BTree()
for _ in range(n):
command = input().split()
if command[0] == "insert":
tree = tree.insert(command[1])
elif command[0] == "find":
if tree.find(command[1]):
print("yes")
else:
print("no")
| Traceback (most recent call last):
File "/tmp/tmp7awp_8v2/tmpisakwlof.py", line 38, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s496634337 | p02269 | u318430977 | 1528301952 | Python | Python3 | py | Runtime Error | 0 | 0 | 1271 | class BTree:
def __init__(self):
self.value = "ZZZ"
self.left = None
self.right = None
def insert(self, s):
if self.value is None:
self.value = s
else:
if self.value < s:
if self.right is None:
self.right = BTree().insert(s)
else:
self.right = self.right.insert(s)
elif s < self.value:
if self.left is None:
self.left = BTree().insert(s)
else:
self.left = self.left.insert(s)
return self
def find(self, s):
if self.value == s:
return True
elif self.value < s:
if self.right is None:
return False
else:
return self.right.find(s)
else:
if self.left is None:
return False
else:
return self.left.find(s)
n = int(input())
tree = BTree()
for _ in range(n):
command = input().split()
if command[0] == "insert":
tree = tree.insert(command[1])
elif command[0] == "find":
if tree.find(command[1]):
print("yes")
else:
print("no")
| Traceback (most recent call last):
File "/tmp/tmpjfgxol7i/tmpgf8lgdra.py", line 38, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s690508440 | p02269 | u445032255 | 1529906178 | Python | Python3 | py | Runtime Error | 20 | 5604 | 890 | D = []
def append(value):
global D
hashvalue = ""
for letter in value:
hashvalue += str(ord(letter))
D.append(int(hashvalue))
def find(value):
hashvalue = ""
for letter in value:
hashvalue += str(ord(letter))
hashvalue = int(hashvalue)
left = 0
right = len(D) - 1
while True:
mid = (left + right) // 2
if D[mid] == hashvalue:
print("yes")
return
elif D[mid] < hashvalue:
left = mid + 1
else:
right = mid - 1
if left > right:
print("no")
return
def main():
global D
N = int(input())
finds = []
for _ in range(N):
command, value = [i for i in input().split()]
if command == "insert":
append(value)
D.sort()
else:
find(value)
main()
| Traceback (most recent call last):
File "/tmp/tmpkv6n4avi/tmplpznpwtp.py", line 53, in <module>
main()
File "/tmp/tmpkv6n4avi/tmplpznpwtp.py", line 41, in main
N = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s707412433 | p02269 | u633068244 | 1395993313 | Python | Python | py | Runtime Error | 100 | 43888 | 336 | dict = {"A":1,"C":2,"G":3,"T":4}
def a2n(a):
ans = 0
for i in range(len(a)):
ans += dict[a[i]]*4**i
return ans
n = int(raw_input())
ls = [0 for i in range(1000000)]
for i in range(n):
inp = raw_input()
if inp[0] == "i":
ls[a2n(inp[7:])] = 1
else:
print "yes" if ls[a2n(inp[5:])] else "no"
| File "/tmp/tmpemruzif5/tmp5ir8z_n1.py", line 15
print "yes" if ls[a2n(inp[5:])] else "no"
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s751040241 | p02269 | u436634575 | 1400890860 | Python | Python3 | py | Runtime Error | 0 | 0 | 155 | n = int(input())
d = {}
for i in n:
cmd = input()
if cmd[0] == 'i':
d[cmd[7:]] = 0
else:
print('yes' if cmd[5:] in d else 'no') | Traceback (most recent call last):
File "/tmp/tmp5ch2eyum/tmplil3xy_3.py", line 1, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s277269280 | p02270 | u394181453 | 1551251769 | Python | Python3 | py | Runtime Error | 20 | 5604 | 603 | n, tracks = list(map(int, input().split()))
loads = []
for _ in range(n):
loads.append(int(input()))
# print(loads)
slices = []
def slicing(rest, s):
if not rest:
slices.append(s+[(s[-1][1], len(loads))])
return
first = len(s) and s[-1][1]
for s1 in range(first+1, len(loads)-rest+1):
slicing(rest-1, s+[(first, s1)])
slicing(tracks-1, [])
# print(slices)
def load_count_max(load):
# print(load, max(sum(loads[l[0]: l[1]]) for l in load))
return max(sum(loads[l[0]: l[1]]) for l in load)
result = min(map(load_count_max, slices))
print(result)
| Traceback (most recent call last):
File "/tmp/tmp6i7sne75/tmpp0b7_toi.py", line 1, in <module>
n, tracks = list(map(int, input().split()))
^^^^^^^
EOFError: EOF when reading a line
| |
s978655452 | p02270 | u394181453 | 1551253049 | Python | Python3 | py | Runtime Error | 0 | 0 | 648 | n, tracks = list(map(int, input().split()))
loads = []
for _ in range(n):
loads.append(int(input()))
# print(loads)
slices = []
min_load = [99999999999999]
def slicing(rest, s):
if not rest:
# slices.append(s+[(len(s) and s[-1][1], len(loads))])
s += [(len(s) and s[-1][1], len(loads))]
min_load[0] = min(min_load[0], max(sum(loads[l[0]: l[1]]) for l in s))
return
first = len(s) and s[-1][1]
for s1 in range(first+1, len(loads)-rest+1):
total = sum(loads[first: s1])
if total < min_load:
slicing(rest-1, s+[(first, s1)])
slicing(tracks-1, [])
print(min_load.pop())
| Traceback (most recent call last):
File "/tmp/tmpkkuhkr5w/tmp7rtvjgiu.py", line 1, in <module>
n, tracks = list(map(int, input().split()))
^^^^^^^
EOFError: EOF when reading a line
| |
s493648324 | p02270 | u394181453 | 1551254999 | Python | Python3 | py | Runtime Error | 0 | 0 | 736 | n, tracks = list(map(int, inpput().split()))
loads = []
for _ in range(n):
loads.append(int(input()))
# print(loads)
slices = []
min_load = [99999999999999]
@lru_cache()
def slicing(rest, s=0):
if not rest:
# slices.append(s+[(len(s) and s[-1][1], len(loads))])
return sum(loads[s:])
result = 99999999999999
for s1 in range(s+1, len(loads)-rest+1):
result = min(result, max(sum(loads[s: s1]), slicing(rest-1, s1)))
return result
rs = slicing(tracks-1)
print(rs)
# print(slices)
# def load_count_max(load):
# print(load, max(sum(loads[l[0]: l[1]]) for l in load))
# return max(sum(loads[l[0]: l[1]]) for l in load)
# result = min(map(load_count_max, slices))
# print(result)
| Traceback (most recent call last):
File "/tmp/tmpk43ybtuj/tmpcia9auru.py", line 1, in <module>
n, tracks = list(map(int, inpput().split()))
^^^^^^
NameError: name 'inpput' is not defined. Did you mean: 'input'?
| |
s137332753 | p02270 | u394181453 | 1551255018 | Python | Python3 | py | Runtime Error | 0 | 0 | 735 | n, tracks = list(map(int, input().split()))
loads = []
for _ in range(n):
loads.append(int(input()))
# print(loads)
slices = []
min_load = [99999999999999]
@lru_cache()
def slicing(rest, s=0):
if not rest:
# slices.append(s+[(len(s) and s[-1][1], len(loads))])
return sum(loads[s:])
result = 99999999999999
for s1 in range(s+1, len(loads)-rest+1):
result = min(result, max(sum(loads[s: s1]), slicing(rest-1, s1)))
return result
rs = slicing(tracks-1)
print(rs)
# print(slices)
# def load_count_max(load):
# print(load, max(sum(loads[l[0]: l[1]]) for l in load))
# return max(sum(loads[l[0]: l[1]]) for l in load)
# result = min(map(load_count_max, slices))
# print(result)
| Traceback (most recent call last):
File "/tmp/tmpxn0qwu0n/tmpd2azsv_b.py", line 1, in <module>
n, tracks = list(map(int, input().split()))
^^^^^^^
EOFError: EOF when reading a line
| |
s244174500 | p02270 | u604774382 | 1433848205 | Python | Python3 | py | Runtime Error | 0 | 0 | 594 | n, k = [ int( val ) for val in raw_input( ).split( " " ) ]
w = [ int( raw_input( ) ) for val in range( n ) ]
sumW = sum( w )
maxW = max( w )
minP = 0
if 1 == k:
minP = sumW
elif n == k:
minP = maxW
else:
left = maxW
right = 100000*10000
while left <= right:
middle = ( left+right )//2
truckCnt = i = loadings = 0
while i < n:
loadings += w[i]
if middle < loadings:
truckCnt += 1
if k < truckCnt+1:
break
loadings = w[i]
i += 1
if truckCnt+1 <= k:
minP = middle
if k < truckCnt+1:
left = middle + 1
else:
right = middle - 1
print( minP ) | Traceback (most recent call last):
File "/tmp/tmp1z_yetly/tmp9amzkfpu.py", line 1, in <module>
n, k = [ int( val ) for val in raw_input( ).split( " " ) ]
^^^^^^^^^
NameError: name 'raw_input' is not defined
| |
s121237379 | p02270 | u253463900 | 1452598972 | Python | Python3 | py | Runtime Error | 0 | 0 | 487 | def check(T, p, n, k):
i = 0
for j in range(k):
s = 0
while(s+T[i] <= p):
s += T[i]
i += 1
if i == n:
return n
return i
n, k = [int(x) for x in input().split()]
T = []
for i in range(n):
T.append(int(input()))
left, right = 0, 100000 * 10000
while(right - left > 1):
mid = (left + right) / 2
if (check(mid) >= n):
right = mid
else:
left = mid
print right | File "/tmp/tmpc3yf5ipg/tmpv80yjn37.py", line 7
while(s+T[i] <= p):
^
IndentationError: unindent does not match any outer indentation level
| |
s699372486 | p02270 | u253463900 | 1452599086 | Python | Python3 | py | Runtime Error | 0 | 0 | 496 | def check(T, p, n, k):
i = 0
for j in range(k):
s = 0
while(s+T[i] <= p):
s += T[i]
i += 1
if i == n:
return n
return i
n, k = [int(x) for x in input().split()]
T = []
for i in range(n):
T.append(int(input()))
left, right = 0, 100000 * 10000
while(right - left > 1):
mid = (left + right) / 2
if (check(T, mid, n, k) >= n):
right = mid
else:
left = mid
print right | File "/tmp/tmpktttkzrc/tmp5s8r_37x.py", line 7
while(s+T[i] <= p):
^
IndentationError: unindent does not match any outer indentation level
| |
s195358258 | p02270 | u619765879 | 1452609638 | Python | Python | py | Runtime Error | 0 | 0 | 335 | n, k = map(int, raw_input().split())
for i in range(n):
T.append(input())
left = 0
right = 100000*10000
while left<right:
mid = (right + left)/2
j = 0
s = 0
while s + T[j] <= mid:
s += T[j]
j++
if j == n:
break
if v>=n:
right = mid
else:
left = mid
print right | File "/tmp/tmpkkyeu3ux/tmpmvibz5i8.py", line 15
j++
^
SyntaxError: invalid syntax
| |
s271227307 | p02270 | u619765879 | 1452609660 | Python | Python | py | Runtime Error | 0 | 0 | 345 | n, k = map(int, raw_input().split())
T = set()
for i in range(n):
T.append(input())
left = 0
right = 100000*10000
while left<right:
mid = (right + left)/2
j = 0
s = 0
while s + T[j] <= mid:
s += T[j]
j++
if j == n:
break
if v>=n:
right = mid
else:
left = mid
print right | File "/tmp/tmphvali_t4/tmpbiaku718.py", line 16
j++
^
SyntaxError: invalid syntax
| |
s600044879 | p02270 | u619765879 | 1452609679 | Python | Python | py | Runtime Error | 0 | 0 | 342 | n, k = map(int, raw_input().split())
T = []
for i in range(n):
T.append(input())
left = 0
right = 100000*10000
while left<right:
mid = (right + left)/2
j = 0
s = 0
while s + T[j] <= mid:
s += T[j]
j++
if j == n:
break
if v>=n:
right = mid
else:
left = mid
print right | File "/tmp/tmp_j7dpg3g/tmpn_fiehww.py", line 16
j++
^
SyntaxError: invalid syntax
| |
s522424045 | p02270 | u619765879 | 1452609710 | Python | Python | py | Runtime Error | 0 | 0 | 344 | n, k = map(int, raw_input().split())
T = []
for i in range(n):
T.append(input())
left = 0
right = 100000*10000
while right-left>1:
mid = (right + left)/2
j = 0
s = 0
while s + T[j] <= mid:
s += T[j]
j++
if j == n:
break
if v>=n:
right = mid
else:
left = mid
print right | File "/tmp/tmps5vbeoms/tmpdfw08yhq.py", line 16
j++
^
SyntaxError: invalid syntax
| |
s543783322 | p02270 | u619765879 | 1452609785 | Python | Python | py | Runtime Error | 0 | 0 | 344 | n, k = map(int, raw_input().split())
T = []
for i in range(n):
T.append(input())
left = 0
right = 100000*10000
while right-left>1:
mid = (right + left)/2
j = 0
s = 0
while s + T[j] <= mid:
s += T[j]
j++
if j == n:
break
if j>=n:
right = mid
else:
left = mid
print right | File "/tmp/tmpkfafv63m/tmp4jmqtmpl.py", line 16
j++
^
SyntaxError: invalid syntax
| |
s051256483 | p02270 | u619765879 | 1452609843 | Python | Python | py | Runtime Error | 0 | 0 | 347 | n, k = map(int, raw_input().split())
T = []
for i in range(n):
T.append(input())
left = 0
right = 100000*10000
while right-left>1:
mid = (right + left)/2
j = 0
s = 0
while s + T[j] <= mid:
s += T[j]
j += 1
if j == n:
break
if j>=n:
right = mid
else:
left = mid
print right | File "/tmp/tmpotvuhxw2/tmp914_xb5j.py", line 25
print right
^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s018512567 | p02270 | u619765879 | 1452610352 | Python | Python | py | Runtime Error | 0 | 0 | 349 | n, k = map(int, raw_input().split())
T = []
for i in range(n):
T.append(input())
left = 0
right = 100000*10000
while right-left>1:
mid = (right + left)/2
j = 0
for k in range(k)
s = 0
while s + T[j] <= mid:
s += T[j]
j += 1
if j == n:
break
if j>=n:
right = mid
else:
left = mid
print right | File "/tmp/tmpi8zpv7of/tmpbve48txg.py", line 13
for k in range(k)
^
SyntaxError: expected ':'
| |
s657231208 | p02270 | u619765879 | 1452610362 | Python | Python | py | Runtime Error | 0 | 0 | 350 | n, k = map(int, raw_input().split())
T = []
for i in range(n):
T.append(input())
left = 0
right = 100000*10000
while right-left>1:
mid = (right + left)/2
j = 0
for k in range(k):
s = 0
while s + T[j] <= mid:
s += T[j]
j += 1
if j == n:
break
if j>=n:
right = mid
else:
left = mid
print right | File "/tmp/tmpxr_tah31/tmpt58b746j.py", line 26
print right
^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s803161444 | p02270 | u619765879 | 1452610405 | Python | Python | py | Runtime Error | 0 | 0 | 350 | n, k = map(int, raw_input().split())
T = []
for i in range(n):
T.append(input())
left = 0
right = 100000*10000
while right-left>1:
mid = (right + left)/2
j = 0
for x in range(k):
s = 0
while s + T[j] <= mid:
s += T[j]
j += 1
if j == n:
break
if j>=n:
right = mid
else:
left = mid
print right | File "/tmp/tmpi4v2d7iu/tmpjfcqqzor.py", line 26
print right
^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s414095405 | p02270 | u619765879 | 1452610483 | Python | Python | py | Runtime Error | 0 | 0 | 350 | n, k = map(int, raw_input().split())
T = []
for i in range(n):
T.append(input())
left = 0
right = 100000*10000
while right-left>1:
mid = (right + left)/2
j = 0
for x in range(k):
s = 0
while s + T[j] <= mid:
s += T[j]
j += 1
if j == n:
break
if j>=n:
right = mid
else:
left = mid
print right | File "/tmp/tmp08er3jc7/tmpsp2n7mm4.py", line 26
print right
^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s413620228 | p02270 | u619765879 | 1452610608 | Python | Python | py | Runtime Error | 0 | 0 | 392 | n, k = map(int, raw_input().split())
T = []
for i in range(n):
T.append(input())
left = 0
right = 100000*10000
while right-left>1:
mid = (right + left)/2
j = 0
for x in range(k):
s = 0
while s + T[j] <= mid:
s += T[j]
j += 1
if j == n:
x = -1
break
if x = -1:
break
if j>=n:
right = mid
else:
left = mid
print right | File "/tmp/tmp4aw8887d/tmpw3hcs40y.py", line 21
if x = -1:
^^^^^^
SyntaxError: invalid syntax. Maybe you meant '==' or ':=' instead of '='?
| |
s966701022 | p02270 | u619765879 | 1452610628 | Python | Python | py | Runtime Error | 0 | 0 | 392 | n, k = map(int, raw_input().split())
T = []
for i in range(n):
T.append(input())
left = 0
right = 100000*10000
while right-left>1:
mid = (right + left)/2
j = 0
for x in range(k):
s = 0
while s + T[j] <= mid:
s += T[j]
j += 1
if j == n:
d = -1
break
if d = -1:
break
if j>=n:
right = mid
else:
left = mid
print right | File "/tmp/tmp9xgmbc4q/tmpuj0dairj.py", line 21
if d = -1:
^^^^^^
SyntaxError: invalid syntax. Maybe you meant '==' or ':=' instead of '='?
| |
s923901974 | p02270 | u619765879 | 1452610706 | Python | Python | py | Runtime Error | 0 | 0 | 350 | n, k = map(int, raw_input().split())
T = []
for i in range(n):
T.append(input())
left = 0
right = 100000*10000
while right-left>1:
mid = (right + left)/2
j = 0
for x in range(k):
s = 0
while s + T[j] <= mid:
s += T[j]
j += 1
if j == n:
break
if j>=n:
right = mid
else:
left = mid
print right | File "/tmp/tmp3zwzs50j/tmp6922k9oi.py", line 26
print right
^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s162252051 | p02270 | u619765879 | 1452610716 | Python | Python | py | Runtime Error | 0 | 0 | 320 | n, k = map(int, raw_input().split())
T = []
for i in range(n):
T.append(input())
left = 0
right = 100000*10000
while right-left>1:
mid = (right + left)/2
j = 0
for x in range(k):
s = 0
while s + T[j] <= mid:
s += T[j]
j += 1
if j>=n:
right = mid
else:
left = mid
print right | File "/tmp/tmpil3fsmsl/tmppl0__4s_.py", line 25
print right
^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s137939219 | p02270 | u619765879 | 1452610776 | Python | Python | py | Runtime Error | 0 | 0 | 350 | n, k = map(int, raw_input().split())
T = []
for i in range(n):
T.append(input())
left = 0
right = 100000*10000
while right-left>1:
mid = (right + left)/2
j = 0
for x in range(k):
s = 0
while s + T[j] <= mid:
s += T[j]
j += 1
if j == n:
break
if j>=n:
right = mid
else:
left = mid
print right | File "/tmp/tmp0w5ztj3u/tmp4t04uzbs.py", line 26
print right
^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s651230861 | p02270 | u619765879 | 1452610849 | Python | Python | py | Runtime Error | 0 | 0 | 356 | n, k = map(int, raw_input().split())
T = []
for i in range(n):
T.append(input())
left = 0
right = 100000*10000
while right-left>1:
mid = (right + left)/2
j = 0
for x in range(k):
s = 0
while s + T[j] <= mid:
s = s + T[j]
j = j + 1
if j == n:
break
if j>=n:
right = mid
else:
left = mid
print right | File "/tmp/tmp_xpxe_np/tmp10v5zrwt.py", line 26
print right
^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s834111060 | p02270 | u619765879 | 1452610927 | Python | Python | py | Runtime Error | 0 | 0 | 348 | n, k = map(int, raw_input().split())
T = []
for i in range(n):
T.append(input())
left = 0
right = 100000*10000
while right-left>1:
mid = (right + left)/2
j = 0
for x in range(k):
s = 0
while s+T[j] <= mid:
s += T[j]
j += 1
if j == n:
break
if j>=n:
right = mid
else:
left = mid
print right | File "/tmp/tmpcu2pe1p8/tmpoudjbqqs.py", line 26
print right
^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s153631180 | p02270 | u619765879 | 1452611187 | Python | Python | py | Runtime Error | 0 | 0 | 348 | n, k = map(int, raw_input().split())
T = []
for i in range(n):
T.append(input())
left = 0
right = 100000*10000
while right-left>1:
mid = (right + left)/2
j = 0
for x in range(k):
s = 0
while s+T[j] <= mid:
s += T[j]
j += 1
if j == n:
break
if j>=n:
right = mid
else:
left = mid
print right | File "/tmp/tmpwzh837ek/tmp1pmx_m43.py", line 26
print right
^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s181976905 | p02270 | u619765879 | 1452611242 | Python | Python | py | Runtime Error | 0 | 0 | 346 | n, k = map(int, raw_input().split())
T = []
for i in range(n):
T.append(input())
left = 0
right = 100000*10000
while right-left>1:
mid = (right + left)/2
j = 0
for x in range(k):
s = 0
while s+T[j] <= mid or j == n:
s += T[j]
j += 1
# if j == n:
if j>=n:
right = mid
else:
left = mid
print right | File "/tmp/tmp5if8e2y1/tmpqs6dug4k.py", line 26
print right
^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s551107574 | p02270 | u619765879 | 1452611404 | Python | Python | py | Runtime Error | 0 | 0 | 327 | n, k = map(int, raw_input().split())
T = []
for i in range(n):
T.append(input())
left = 0
right = 100000*10000
while right-left>1:
mid = (right + left)/2
j = 0
for x in range(k):
s = 0
while s+T[j] <= mid or j == n:
s += T[j]
j += 1
if j>=n:
right = mid
else:
left = mid
print right | File "/tmp/tmplro1o_lo/tmpitt9rmns.py", line 24
print right
^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s848046002 | p02270 | u619765879 | 1452611467 | Python | Python | py | Runtime Error | 0 | 0 | 329 | n, k = map(int, raw_input().split())
T = []
for i in range(n):
T.append(input())
left = 0
right = 100000*10000
while right-left>1:
mid = (right + left)/2
j = 0
for x in range(k):
s = 0
while s+T[j] <= mid or j == n-1:
s += T[j]
j += 1
if j>=n:
right = mid
else:
left = mid
print right | File "/tmp/tmp42tredfs/tmpk1o9ruo4.py", line 24
print right
^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s146660079 | p02270 | u619765879 | 1452611494 | Python | Python | py | Runtime Error | 0 | 0 | 329 | n, k = map(int, raw_input().split())
T = []
for i in range(n):
T.append(input())
left = 0
right = 100000*10000
while right-left>1:
mid = (right + left)/2
j = 0
for x in range(k):
s = 0
while s+T[j] <= mid or j != n-1:
s += T[j]
j += 1
if j>=n:
right = mid
else:
left = mid
print right | File "/tmp/tmpaxocg6qa/tmp4gc1963p.py", line 24
print right
^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s106559786 | p02270 | u619765879 | 1452611591 | Python | Python | py | Runtime Error | 0 | 0 | 330 | n, k = map(int, raw_input().split())
T = []
for i in range(n):
T.append(input())
left = 0
right = 100000*10000
while right-left>1:
mid = (right + left)/2
j = 0
for x in range(k):
s = 0
while s+T[j] <= mid or j not n-1:
s += T[j]
j += 1
if j>=n:
right = mid
else:
left = mid
print right | File "/tmp/tmp2jqdh8x7/tmpm2y5w4f6.py", line 15
while s+T[j] <= mid or j not n-1:
^
SyntaxError: invalid syntax
| |
s988939582 | p02270 | u619765879 | 1452611606 | Python | Python | py | Runtime Error | 0 | 0 | 332 | n, k = map(int, raw_input().split())
T = []
for i in range(n):
T.append(input())
left = 0
right = 100000*10000
while right-left>1:
mid = (right + left)/2
j = 0
for x in range(k):
s = 0
while s+T[j] <= mid or j not n-1:
# s += T[j]
# j += 1
if j>=n:
right = mid
else:
left = mid
print right | File "/tmp/tmpmkirjoeu/tmpsfzf58sh.py", line 15
while s+T[j] <= mid or j not n-1:
^
SyntaxError: invalid syntax
| |
s695020109 | p02270 | u619765879 | 1452611759 | Python | Python | py | Runtime Error | 0 | 0 | 331 | n, k = map(int, raw_input().split())
T = []
for i in range(n):
T.append(input())
left = 0
right = 100000*10000
while right-left>1:
mid = (right + left)/2
j = 0
for x in range(k):
s = 0
while s+T[j] <= mid or j := n-1:
# s += T[j]
# j += 1
if j>=n:
right = mid
else:
left = mid
print right | File "/tmp/tmp02am1b7k/tmp61pdwhge.py", line 15
while s+T[j] <= mid or j := n-1:
^^^^^^^^^^^^^^^^^^
SyntaxError: cannot use assignment expressions with expression
| |
s391270376 | p02270 | u619765879 | 1452611766 | Python | Python | py | Runtime Error | 0 | 0 | 332 | n, k = map(int, raw_input().split())
T = []
for i in range(n):
T.append(input())
left = 0
right = 100000*10000
while right-left>1:
mid = (right + left)/2
j = 0
for x in range(k):
s = 0
while s+T[j] <= mid or j ::= n-1:
# s += T[j]
# j += 1
if j>=n:
right = mid
else:
left = mid
print right | File "/tmp/tmpztpd2mzi/tmpjwj_pmyq.py", line 15
while s+T[j] <= mid or j ::= n-1:
^^
SyntaxError: invalid syntax
| |
s117630866 | p02270 | u619765879 | 1452612004 | Python | Python | py | Runtime Error | 0 | 0 | 335 | n, k = map(int, raw_input().split())
T = []
for i in range(n):
T.append(input())
left = 0
right = 100000*10000
while right-left>1:
mid = (right + left)/2
j = 0
for x in range(k):
s = 0
while s+T[j] <= mid or j is not n-1:
# s += T[j]
# j += 1
if j>=n:
right = mid
else:
left = mid
print right | File "/tmp/tmpc26ejaul/tmpowky3bji.py", line 19
if j>=n:
IndentationError: expected an indented block after 'while' statement on line 15
| |
s105217259 | p02270 | u619765879 | 1452612565 | Python | Python | py | Runtime Error | 0 | 0 | 333 | n, k = map(int, raw_input().split())
T = []
for i in range(n):
T.append(input())
left = 0
right = 100000*10000
while right-left>1:
mid = (right + left)/2
j = 0
for x in range(k):
s = 0
while s+T[j] <= mid or j is not n-1:
s += T[j]
j += 1
if j>=n:
right = mid
else:
left = mid
print right | File "/tmp/tmpid6vq9c8/tmpo4nf2m5d.py", line 24
print right
^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.