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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
s888036852 | p03986 | u539517139 | 1562072891 | Python | Python (3.4.3) | py | Runtime Error | 59 | 3500 | 133 | x=input()
t=0
for i in range(len(x)-1,-1,-1):
if x[i]=='T':
t+=1
else:
if t>0:
t-=1
else:
s+=1
print(s+t) | Traceback (most recent call last):
File "/tmp/tmpgtwmchjs/tmpjbaifyoo.py", line 1, in <module>
x=input()
^^^^^^^
EOFError: EOF when reading a line
| |
s599169645 | p03986 | u405256066 | 1560061653 | Python | Python (3.4.3) | py | Runtime Error | 54 | 4328 | 229 | from sys import stdin
X = (stdin.readline().rstrip())
stack = []
for i in X:
if i == "S":
stack.append(i)
elif i == "T" and stack[-1] == "S":
stack.pop()
else:
stack.append(i)
print(len(stack)) | 0
| |
s904325486 | p03986 | u405256066 | 1560041967 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3500 | 150 | from sys import stdin
X = (stdin.readline().rstrip())
X_l = X[:(len(X)/2)]
X_r = X[(len(X)/2):]
print(len(X) - min(X_l.count("S"),X_r.count("T")) * 2) | Traceback (most recent call last):
File "/tmp/tmpuzia7alc/tmpqa6xb4ri.py", line 3, in <module>
X_l = X[:(len(X)/2)]
~^^^^^^^^^^^^^
TypeError: slice indices must be integers or None or have an __index__ method
| |
s251452838 | p03986 | u623819879 | 1558585358 | Python | PyPy3 (2.4.0) | py | Runtime Error | 180 | 47856 | 188 | import bisect
n=int(input())
p=[0]*(n+2)
c=1
for i in input().split():
p[int(i)]=c
c+=1
q=[0,n+1]
for i in range(1,n+1):
l=bisect.bisect(q,a)
r=l+1
print()
print(p)
| Traceback (most recent call last):
File "/tmp/tmpx__3m8jc/tmp70ago401.py", line 2, in <module>
n=int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s286579994 | p03986 | u230549821 | 1557017478 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 90 | n = 0
for x in X:
if x == "S":
n += 1
else:
if n > 0:
n -= 1
print(2*n) | Traceback (most recent call last):
File "/tmp/tmpkusqo7n1/tmp1z6rf29a.py", line 2, in <module>
for x in X:
^
NameError: name 'X' is not defined
| |
s774635019 | p03986 | u163320134 | 1556906512 | Python | Python (3.4.3) | py | Runtime Error | 126 | 4256 | 620 | import collections
s=input()
n=len(s)
slen=collections.deque()
tlen=collections.deque()
cnt=0
ans=0
for i in range(n):
if s[i]=='S':
tpos=i
break
else:
tpos=n
for i in range(n-1,-1,-1):
if s[i]=='T':
spos=i
break
else:
spos=-1
s=s[tpos:spos+1]+'x'
for i in range(len(s)-1):
cnt+=1
if s[i]!=s... | Traceback (most recent call last):
File "/tmp/tmpxspk_4ab/tmprc1genf5.py", line 3, in <module>
s=input()
^^^^^^^
EOFError: EOF when reading a line
| |
s772682084 | p03986 | u163320134 | 1556906354 | Python | Python (3.4.3) | py | Runtime Error | 96 | 4260 | 620 | import collections
s=input()
n=len(s)
slen=collections.deque()
tlen=collections.deque()
cnt=0
ans=0
for i in range(n):
if s[i]=='S':
tpos=i
break
else:
tpos=n
for i in range(n-1,-1,-1):
if s[i]=='T':
spos=i
break
else:
spos=-1
s=s[tpos:spos+1]+'x'
for i in range(len(s)-1):
cnt+=1
if s[i]!=s... | Traceback (most recent call last):
File "/tmp/tmp31j6xko7/tmp9i26mdj4.py", line 3, in <module>
s=input()
^^^^^^^
EOFError: EOF when reading a line
| |
s530990909 | p03986 | u063052907 | 1555861087 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3500 | 195 | X = input()
cnt_S, cnt_T = 0, 0
for c in range(X):
if c == "S":
cnt_S += 1
else:
if cnt_S:
cnt_S -= 1
else:
cnt_T += 1
print(cnt_S, cnt_T) | Traceback (most recent call last):
File "/tmp/tmpcwfyjwgg/tmpcfjlwaxu.py", line 1, in <module>
X = input()
^^^^^^^
EOFError: EOF when reading a line
| |
s730389770 | p03986 | u227082700 | 1555467478 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3500 | 92 | x=input();a=0
for i in range(len(x)):
if x[l-i-1]=="T":a+=1
else:a=max(0,a-1)
print(a*2) | Traceback (most recent call last):
File "/tmp/tmp0_3puv12/tmplywurtqa.py", line 1, in <module>
x=input();a=0
^^^^^^^
EOFError: EOF when reading a line
| |
s909052226 | p03986 | u802772880 | 1554700256 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3500 | 130 | s=input()
ls=len(s)
c=0
for i in range(ls):
if s[i]=='S':
c+=1
elif c>0:
ans+=2
c-=1
print(ls-ans) | Traceback (most recent call last):
File "/tmp/tmpl0ovi9v0/tmpkqpiq0ds.py", line 1, in <module>
s=input()
^^^^^^^
EOFError: EOF when reading a line
| |
s706574910 | p03986 | u089230684 | 1553561704 | Python | Python (2.7.6) | py | Runtime Error | 11 | 2948 | 207 | s = raw_input()
n = int(raw_input())
head = []
sub = 0
for i, v in enumerate(s):
if v == 'S':
head.append(i)
if v == 'T' and head:
head.pop(0)
sub += 2
print(len(s) - sub) | Traceback (most recent call last):
File "/tmp/tmp52hhirwi/tmpq2819lek.py", line 1, in <module>
s = raw_input()
^^^^^^^^^
NameError: name 'raw_input' is not defined
| |
s370890677 | p03986 | u089230684 | 1553560598 | Python | Python (2.7.6) | py | Runtime Error | 1026 | 199808 | 211 | s = raw_input()
def cal(s):
a= 0
for idx in range(len(s)/2):
if s[2*idx]==s[2*idx +1]:
continue
else:
a = 1
s = s[2*(idx+1):]
break
if a:
return cal(s)
else:
return s
print(len(cal(s))) | Traceback (most recent call last):
File "/tmp/tmpa4xsow93/tmpv_p43mdj.py", line 1, in <module>
s = raw_input()
^^^^^^^^^
NameError: name 'raw_input' is not defined
| |
s244545618 | p03986 | u816631826 | 1553541373 | Python | Python (2.7.6) | py | Runtime Error | 12 | 2692 | 621 | @parallel
@roles('allgame')
def _last_redis_save():
with cd(get_deploy_path()):
redisSet = set()
ret = run('supervisorctl status')
for line in ret.split('\n'):
line = line.strip()
if line.find('RUNNING') >= 0 and line.find('redis') >= 0:
name = line.split()[0].strip()
redisSet.add(name)
ret = []... | File "/tmp/tmplfren5w0/tmprryu314k.py", line 23
print '-'*20
^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s873655214 | p03986 | u175034939 | 1553231619 | Python | Python (3.4.3) | py | Runtime Error | 161 | 4840 | 337 | s = list(input())
cnt = 0
while True:
if s[0] == 'T':
s.pop(0)
cnt += 1
else:
break
while True:
if s[-1] == 'S':
s.pop(-1)
cnt += 1
else:
break
cs = 0
ct = 0
for i in range(len(s)):
if s[i] == 'S':
cs += 1
else:
ct += 1
print(... | Traceback (most recent call last):
File "/tmp/tmpecfs0v47/tmp4396srr_.py", line 1, in <module>
s = list(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s471542316 | p03986 | u175034939 | 1553231379 | Python | Python (3.4.3) | py | Runtime Error | 178 | 4840 | 555 | s = list(input())
cnt = 0
while True:
if s[0] == 'T':
s.pop(0)
cnt += 1
else:
break
while True:
if s[-1] == 'S':
s.pop(-1)
cnt += 1
else:
break
i = 0
now = 'on'
ans = 0
cs = 0
while i < len(s):
if s[i] == 'S':
cs += 1
now ... | Traceback (most recent call last):
File "/tmp/tmpn86c6e5l/tmpxghs7x3b.py", line 1, in <module>
s = list(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s034283809 | p03986 | u033524082 | 1552181334 | Python | Python (3.4.3) | py | Runtime Error | 20 | 3500 | 170 | x=input()
ans=len(x)
r=len(x)
if "ST" in x:
x.remove("ST")
ans-=2
while r!=len(x):
r=len(x)
if "ST" in x:
x.remove("ST")
ans-=2
print(ans) | Traceback (most recent call last):
File "/tmp/tmpbn2fr9h4/tmp_hv_kvmv.py", line 1, in <module>
x=input()
^^^^^^^
EOFError: EOF when reading a line
| |
s504974516 | p03986 | u595893956 | 1550816564 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 104 | s=input()
sc=0
tc=0
for i in s:
if i=="S":
sc+=1
elif sc!=0:
sc-=1
else tc+=1
print(tc+sc) | File "/tmp/tmp7ar3mkv5/tmpw51r1qaq.py", line 9
else tc+=1
^^
SyntaxError: expected ':'
| |
s957749775 | p03986 | u052347048 | 1550258859 | Python | Python (3.4.3) | py | Runtime Error | 1055 | 3560 | 136 | a = input()
b = a.replace("ST","")
if a[0] =="S" and b[-1] =="T":
print(0)
while "ST" in b:
b = b.replace("ST","")
print(len(b)) | Traceback (most recent call last):
File "/tmp/tmpg8e_tm1p/tmp2iha0mq6.py", line 1, in <module>
a = input()
^^^^^^^
EOFError: EOF when reading a line
| |
s770967839 | p03986 | u284854859 | 1549941807 | Python | Python (3.4.3) | py | Runtime Error | 19 | 3884 | 7341 | #root.search(x): ◯.data == x のものが存在するある場合それを出力、ない場合Noneを出力
#root.insert(x): ◯.data == xが存在する場合Falseを出力、ない場合◯.data == x なる頂点を作る
#y.to_s(): 頂点yのdataを出力
#y.left_s(): 頂点yのleftを出力(ない場合はNone)
#root.search_lower(x,None): ○.dataがxより小さいものの中で最も大きいものを出力、ない場合Noneを出力
#root.search_higher(x,None): xより大きいものの中で最も小さいものを出力、ない場合Noneを出力
... | Traceback (most recent call last):
File "/tmp/tmpenzdlxp6/tmptvgbaers.py", line 191, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s898839899 | p03986 | u426964396 | 1549051990 | Python | Python (3.4.3) | py | Runtime Error | 19 | 3500 | 241 | s=input();pd=0;n='';p=1
while(1):
if s[pd]!='S' and s[pd+1]!='T':
n=n+s[pd]
pd+=1
if pd==len(s)-2:
pd=0
s=n
n=''
p+=1
if len(s)==2:
break
if p>=1000:
break
print(len(s)) | Traceback (most recent call last):
File "/tmp/tmpanv2e4i6/tmp51es9481.py", line 1, in <module>
s=input();pd=0;n='';p=1
^^^^^^^
EOFError: EOF when reading a line
| |
s492575072 | p03986 | u426964396 | 1549051777 | Python | Python (3.4.3) | py | Runtime Error | 25 | 3500 | 242 | s=input();pd=0;n='';p=1
while(1):
if s[pd]!='S' and s[pd+1]!='T':
n=n+s[pd]
pd+=1
if pd==len(s)-2:
pd=0
s=n
n=''
p+=1
if len(s)==2:
break
if p>=10000:
break
print(len(s)) | Traceback (most recent call last):
File "/tmp/tmp6m5farhk/tmp3dz63vkb.py", line 1, in <module>
s=input();pd=0;n='';p=1
^^^^^^^
EOFError: EOF when reading a line
| |
s760266833 | p03986 | u943004959 | 1546399390 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 633 | #include <bits/stdc++.h>
using namespace std;
#define uint unsigned int
#define llong long long int
#define ullong unsigned long long int
const static long long int MOD = 1000000000 + 7;
int main (int argc, char *argv[]) {
cin.tie(0);
ios::sync_with_stdio(false);
string S;
cin >> S;
stack<char> ST... | File "/tmp/tmp96pav4nq/tmpt__a51zi.py", line 2
using namespace std;
^^^^^^^^^
SyntaxError: invalid syntax
| |
s464426929 | p03986 | u371467115 | 1545877823 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 172 | S = input()
s = t = 0
for c in S:
if c == 'S':
s += 1
else:
if s > 0:
s -= 1
else:
t += 1
print(s+t)
#コピペです
| File "/tmp/tmpomrfk9ka/tmpjkoqu4u8.py", line 12
#コピペです
^
SyntaxError: invalid character '#' (U+FF03)
| |
s736880248 | p03986 | u063052907 | 1544918404 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 181 | # coding: utf-8
n_S, n_T = 0, 0
if c in input():
if c == "S":
n_S += 1
else:
if n_S:
n_S -= 1
else:
T += 1
print(n_S + n_T)
| Traceback (most recent call last):
File "/tmp/tmpybel3n51/tmp6wzr15vv.py", line 4, in <module>
if c in input():
^
NameError: name 'c' is not defined
| |
s882913126 | p03986 | u368780724 | 1543784328 | Python | Python (3.4.3) | py | Runtime Error | 330 | 21992 | 389 | import numpy as np
def inpl(): return [int(i) for i in input().split()]
def minisum(x):
mini = np.argmin(x)
d = len(x)
if d == 1:
return x[0]
result = 0
if mini != 0:
result += minisum(x[0:mini])
if mini != d-1:
result += minisum(x[mini+1:d])
return result + (d-mini)*... | Traceback (most recent call last):
File "/tmp/tmp5lzijxho/tmpxnzyjns6.py", line 15, in <module>
N = input()
^^^^^^^
EOFError: EOF when reading a line
| |
s716779219 | p03986 | u397531548 | 1542867275 | Python | Python (3.4.3) | py | Runtime Error | 1056 | 4840 | 239 | S=list(input())
i=0
while 0<=i<=len(S)-2:
if S[i]=="S":
if S[i+1]=="T":
S.remove(S[i])
S.remove(S[i])
i=0
if S[i+1]=="S":
i+=1
if S[i]=="T":
i+=1
print(len(S)) | Traceback (most recent call last):
File "/tmp/tmptwxiyoc7/tmpdws_6jpb.py", line 1, in <module>
S=list(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s639829448 | p03986 | u397531548 | 1542867194 | Python | Python (3.4.3) | py | Runtime Error | 1056 | 4968 | 429 | S=list(input())
i=0
while 0<=i<=len(S)-2:
if S[i]=="S":
if S[i+1]=="T":
S.remove(S[i])
S.remove(S[i])
if S[i+1]=="S":
i+=1
if S[i]=="T":
i+=1
while 0<=i<=len(S)-2:
if S[i]=="S":
if S[i+1]=="T":
S.remove(S[i])
S.remov... | Traceback (most recent call last):
File "/tmp/tmphd2nhqng/tmps1gcjocc.py", line 1, in <module>
S=list(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s051358370 | p03986 | u397531548 | 1542866683 | Python | Python (3.4.3) | py | Runtime Error | 1056 | 4840 | 222 | S=list(input())
i=0
while 0<=i<=len(S)-1:
if S[i]=="S":
if S[i+1]=="T":
S.remove(S[i])
S.remove(S[i])
i-=1
else:
i+=1
else:
i+=1
print(len(S)) | Traceback (most recent call last):
File "/tmp/tmp848s076s/tmp4kr5wuhc.py", line 1, in <module>
S=list(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s302055052 | p03986 | u397531548 | 1542866573 | Python | Python (3.4.3) | py | Runtime Error | 1056 | 4840 | 234 | S=list(input())
i=0
while 0<=i<=len(S)-1:
if S[i]=="S":
if S[i+1]=="T":
S.remove(S[i])
S.remove(S[i])
i=0
else:
i+=1
else:
i+=1
print(len(S))
| Traceback (most recent call last):
File "/tmp/tmprtsqljlx/tmp8fu0x11q.py", line 1, in <module>
S=list(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s608766512 | p03986 | u603234915 | 1538777514 | Python | Python (3.4.3) | py | Runtime Error | 61 | 5668 | 186 | s = list(input())
l = []
for i in range(len(s)):
if s[i] == 'S':
l.append('S')
elif l[-1] == 'T' or not l:
l.append('T')
else:
l.pop()
print(len(l))
| Traceback (most recent call last):
File "/tmp/tmpedi51fbw/tmp_uyt9t3y.py", line 1, in <module>
s = list(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s855923808 | p03986 | u136395536 | 1537101462 | Python | Python (3.4.3) | py | Runtime Error | 1055 | 3824 | 338 | #できなかった― えーんえーん
X = input()
for i in range(10**10000):
times = len(X) - 1
if times > 0:
for j in range(times):
if X[j] == "S" and X[j+1] == "T":
newX = X[0:j]+X[j+2:len(X)]
X = newX
else:
break
print(len(X))
| Traceback (most recent call last):
File "/tmp/tmpwpcme9ck/tmpux44pbae.py", line 3, in <module>
X = input()
^^^^^^^
EOFError: EOF when reading a line
| |
s464958076 | p03986 | u536113865 | 1536440568 | Python | Python (3.4.3) | py | Runtime Error | 90 | 4864 | 204 | s = input()
stack = [s[0]]
for i in range(1,len(s)):
cur_str = stack[-1]
new_str = s[i]
if cur_str+new_str=="ST":
stack.pop()
else:
stack.append(new_str)
print(len(stack))
| Traceback (most recent call last):
File "/tmp/tmpd1rpumqr/tmpinrx5xko.py", line 1, in <module>
s = input()
^^^^^^^
EOFError: EOF when reading a line
| |
s221409042 | p03986 | u030726788 | 1522873566 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3500 | 58 | s=input()
while("ST" in s):
s.remove("ST")
print(len(s)) | Traceback (most recent call last):
File "/tmp/tmpx1mcbprg/tmp2hvjbmyk.py", line 1, in <module>
s=input()
^^^^^^^
EOFError: EOF when reading a line
| |
s437605598 | p03986 | u817328209 | 1522451809 | Python | Python (3.4.3) | py | Runtime Error | 1056 | 4840 | 269 | x = list(input())
Lm = len(x)
L = len(x)
now = len(x) - 1
while now >= 0 and L >= 2 :
if now == Lm - 1 :
now -= 1
continue
if x[now] == 'S' and x[now+1] == 'T' :
x.pop(now+1)
x.pop(now)
L -= 2
now -= 1
print(len(x)) | Traceback (most recent call last):
File "/tmp/tmpft9vf_jv/tmp96t62s6r.py", line 1, in <module>
x = list(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s646042760 | p03986 | u835482198 | 1500883357 | Python | Python (3.4.3) | py | Runtime Error | 86 | 10728 | 611 | X = input()
# X = 'SSTTST'
# X = 'TSSTTTSS'
# naive case
# len_prev = -1
# while len_prev != len(X):
# len_prev = len(X)
# X = X.replace('ST', '')
# print(len(X))
i = 0
cnt = []
X += " "
cur = 1
for i in range(len(X) - 1):
if X[i] == X[i + 1]:
cur += 1
else:
cnt.append((X[i], cur))
... | Traceback (most recent call last):
File "/tmp/tmp73lwy9ix/tmprvsyth7i.py", line 1, in <module>
X = input()
^^^^^^^
EOFError: EOF when reading a line
| |
s436904736 | p03986 | u835482198 | 1500883227 | Python | Python (3.4.3) | py | Runtime Error | 86 | 10596 | 608 |
X = input()
# X = 'SSTTST'
# X = 'TSSTTTSS'
# naive case
# len_prev = -1
# while len_prev != len(X):
# len_prev = len(X)
# X = X.replace('ST', '')
# print(len(X))
i = 0
cnt = []
X += " "
cur = 1
for i in range(len(X) - 1):
if X[i] == X[i + 1]:
cur += 1
else:
cnt.append((X[i], cur))
... | Traceback (most recent call last):
File "/tmp/tmp_935d803/tmp0qrfkuxv.py", line 2, in <module>
X = input()
^^^^^^^
EOFError: EOF when reading a line
| |
s549822530 | p03986 | u619631862 | 1476014398 | Python | Python (3.4.3) | py | Runtime Error | 25 | 3756 | 317 | n = int(input())
a=[int(i) for i in input().split()]
s=[]
sa=n*(n+1)/2
s.append(a)
for i in range(1,n):
s.append([])
for j in range(len(s[i-1])-1):
if s[i-1][j]<s[i-1][j+1]:
s[i].append(s[i-1][j])
sa+=s[i-1][j]
else:
s[i].append(s[i-1][j+1])
sa+=s[i-1][j+1]
print(int(sa)) | Traceback (most recent call last):
File "/tmp/tmpsyvahy1q/tmpo2je03w1.py", line 1, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s507806115 | p03986 | u236080859 | 1475573200 | Python | Python (2.7.6) | py | Runtime Error | 19 | 3304 | 145 | s = input()
def AString(stringX):
while "ST" in stringX:
stringX = stringX.replace("ST", "", 1)
print len(stringX)
AString(s)
| File "/tmp/tmpfypvawg0/tmpbt8b12l8.py", line 6
print len(stringX)
^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s501792177 | p03986 | u172200367 | 1475378739 | Python | Python (2.7.6) | py | Runtime Error | 16 | 2948 | 451 | N = int(raw_input())
n = map(int, raw_input().split())
n_min = min(n)
total = 0
for ind, num in enumerate(n):
if num == n_min:
total += num * (ind+1) * (N - ind)
continue
l, k = ind, ind
while l >= 0:
if num <= n[l]:
l -= 1
else:
break
while k... | File "/tmp/tmpwe_sb9yx/tmp_wi0b4az.py", line 28
print total
^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s063336923 | p03986 | u429978706 | 1475378597 | Python | Python (2.7.6) | py | Runtime Error | 16 | 2568 | 180 | X = raw_input()
cnt = 0
cnt_max = cnt
for i in range(len(X)):
if X[i] = 'T':
cnt += 1
else:
cnt -= 1
if cnt > cnt_max:
cnt_max = cnt
print cnt_max * 2 | File "/tmp/tmphaxc_uxn/tmpxcqmq8g0.py", line 5
if X[i] = 'T':
^^^^
SyntaxError: cannot assign to subscript here. Maybe you meant '==' instead of '='?
| |
s043657819 | p03986 | u429978706 | 1475378083 | Python | PyPy2 (5.6.0) | py | Runtime Error | 37 | 8816 | 183 | X = raw_input()
cnt = 0
cnt_max = cnt
for i in range(len(X)):
if X[i] = 'T':
cnt += 1
else:
cnt -= 1
if cnt > cnt_max:
cnt_max = cnt
return cnt_max * 2 | File "/tmp/tmp0xj7vwi6/tmpxxvcp21l.py", line 5
if X[i] = 'T':
^^^^
SyntaxError: cannot assign to subscript here. Maybe you meant '==' instead of '='?
| |
s551890076 | p03986 | u854554545 | 1475377691 | Python | Python (3.4.3) | py | Runtime Error | 575 | 22412 | 216 | import sys
import numpy as np
N = int(sys.stdin.readline())
P = np.array([int(x) for x in sys.stdin.readline().split()])
SUM = np.sum([np.sum([min(P[l:r+1]) for r in range(l, N)]) for l in range(N)])
print(SUM) | Traceback (most recent call last):
File "/tmp/tmpkj4wtfhl/tmps0vet1bd.py", line 4, in <module>
N = int(sys.stdin.readline())
^^^^^^^^^^^^^^^^^^^^^^^^^
ValueError: invalid literal for int() with base 10: ''
| |
s294960024 | p03986 | u820351940 | 1475376615 | Python | Python (3.4.3) | py | Runtime Error | 26 | 3500 | 241 | N = int(input())
a = list(map(int, input().split()))
def resolve(a):
target = N
result = 0
for i in a:
if target > i: target = i
result += target
return result
print(sum([resolve(a[x:]) for x in range(N)]))
| Traceback (most recent call last):
File "/tmp/tmp_53ue65o/tmpeiwzqocu.py", line 1, in <module>
N = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s863914684 | p03986 | u854554545 | 1475376193 | Python | Python (3.4.3) | py | Runtime Error | 663 | 19520 | 217 | import sys
import numpy as np
N = int(sys.stdin.readline())
P = np.array([int(x) for x in sys.stdin.readline().split()])
SUM = np.sum([np.sum([np.min(P[l:r+1]) for r in range(l, N)]) for l in range(N)])
print(SUM) | Traceback (most recent call last):
File "/tmp/tmps_m7q6j2/tmpnb_d14w3.py", line 4, in <module>
N = int(sys.stdin.readline())
^^^^^^^^^^^^^^^^^^^^^^^^^
ValueError: invalid literal for int() with base 10: ''
| |
s950623710 | p03986 | u854554545 | 1475376001 | Python | Python (3.4.3) | py | Runtime Error | 819 | 16300 | 214 | import sys
import numpy as np
N = int(sys.stdin.readline())
P = np.array([int(x) for x in sys.stdin.readline().split()])
SUM = np.sum([np.sum([min(P[l:r+1]) for r in range(l, N)]) for l in range(N)])
print(SUM) | Traceback (most recent call last):
File "/tmp/tmpjj4hjypz/tmpyrfc1_ip.py", line 4, in <module>
N = int(sys.stdin.readline())
^^^^^^^^^^^^^^^^^^^^^^^^^
ValueError: invalid literal for int() with base 10: ''
| |
s035060945 | p03986 | u250209149 | 1475374574 | Python | Python (2.7.6) | py | Runtime Error | 17 | 2820 | 912 | N = int(raw_input())
a = [int(x) for x in raw_input().split(' ')]
sorteda = sorted(a)
maxlen = sorteda[-1]
numpathsoflen = {}
if(sorteda[0] < (maxlen+1)/2):
print 'Impossible'
elif(maxlen % 2 == 0
and sorteda[0] == maxlen/2
and sorteda[0] == sorteda[1]):
print 'Impossible'
else:
numnodes = max... | File "/tmp/tmprp179fxj/tmpj2asju0w.py", line 9
print 'Impossible'
^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s308798948 | p03986 | u620944332 | 1475373993 | Python | Python (3.4.3) | py | Runtime Error | 25 | 3064 | 86 | s = input()
while 'ST' in s:
s = s.replace('ST', '', 1)
print(len(s))
| File "/tmp/tmp5alu38lj/tmp0jwfb293.py", line 2
while 'ST' in s:
IndentationError: unexpected indent
| |
s658120872 | p03986 | u433025875 | 1475373317 | Python | Python (2.7.6) | py | Runtime Error | 17 | 2948 | 104 | s = raw_input()
t = raw_input()
while s.find(t)>-1:
i = s.find(t)
s = s[:i]+s[i+4:]
print len(s) | File "/tmp/tmpz34d_xcn/tmpvxbe_ad1.py", line 6
print len(s)
^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s830613389 | p03986 | u433025875 | 1475372995 | Python | Python (2.7.6) | py | Runtime Error | 17 | 2948 | 120 | s = raw_input()
t = raw_input()
print s.find(t)
while s.find(t)>-1:
i = s.find(t)
s = s[:i]+s[i+4:]
print len(s) | File "/tmp/tmpq_r0s0o9/tmprnyumy2i.py", line 3
print s.find(t)
^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s335567729 | p03986 | u112002050 | 1475372950 | Python | PyPy3 (2.4.0) | py | Runtime Error | 221 | 47984 | 123 | N = int(input())
a = [int(i) for i in input().split()]
print(sum([min(a[l:r + 1]) for l in range(N) for r in range(l, N)])) | Traceback (most recent call last):
File "/tmp/tmpc_ki_g6e/tmpdi8u0fh4.py", line 1, in <module>
N = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s310735416 | p03986 | u125205981 | 1475372484 | Python | Python (3.4.3) | py | Runtime Error | 22 | 3064 | 115 | ef st(x):
while 'ST' in x:
x = x.replace('ST', '', 1)
return x
X = str(input())
print(len(st(X)))
| File "/tmp/tmpg4m87h8v/tmpz2p2rw4n.py", line 1
ef st(x):
^^
SyntaxError: invalid syntax
| |
s776508301 | p03986 | u112002050 | 1475371390 | Python | Python (3.4.3) | py | Runtime Error | 739 | 202908 | 197 | X = input()
n = 10 ** 10000
def STring(X, n):
index = X.find("ST")
if index == -1 or n == 0:
return X
else:
return STring(X[0:index] + X[index + 2:], n - 1)
print(len(STring(X , n))) | Traceback (most recent call last):
File "/tmp/tmp9u4lk7w7/tmpyej6wh58.py", line 1, in <module>
X = input()
^^^^^^^
EOFError: EOF when reading a line
| |
s133030192 | p03986 | u112002050 | 1475371126 | Python | Python (3.4.3) | py | Runtime Error | 731 | 198552 | 159 | X = input()
def STring(X):
index = X.find("ST")
if index == -1:
return X
else:
return STring(X[0:index] + X[index + 2:])
print(len(STring(X)))
| Traceback (most recent call last):
File "/tmp/tmpi49mukbn/tmpxfkc_rv1.py", line 1, in <module>
X = input()
^^^^^^^
EOFError: EOF when reading a line
| |
s617707581 | p03986 | u010733367 | 1475370599 | Python | Python (3.4.3) | py | Runtime Error | 21 | 3068 | 8 | TSSTTTSS | Traceback (most recent call last):
File "/tmp/tmp9e6ds50x/tmppz03gaan.py", line 1, in <module>
TSSTTTSS
NameError: name 'TSSTTTSS' is not defined
| |
s376555006 | p03986 | u820351940 | 1475370490 | Python | Python (2.7.6) | py | Runtime Error | 19 | 3304 | 141 | s = input()
while 1:
result = s.replace("ST", "")
if result != s:
s = result
break
else: s = result
print len(s)
| File "/tmp/tmpa_bxeu0e/tmp09wwxu1o.py", line 8
print len(s)
^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s276952553 | p03987 | u860546679 | 1600358242 | Python | Python (3.8.2) | py | Runtime Error | 25 | 8956 | 959 | #include<iostream>
#include<iomanip>
#include<cmath>
#include<string>
#include<cstring>
#include<vector>
#include<list>
#include<algorithm>
#include<map>
#include<set>
#include<queue>
#include<stack>
using namespace std;
typedef long long ll;
#define fi first
#define se second
#define mp make_pair
#define mt make_tuple... | File "/tmp/tmp9w20o9u3/tmp46aecppc.py", line 13
using namespace std;
^^^^^^^^^
SyntaxError: invalid syntax
| |
s956965116 | p03987 | u729133443 | 1599928758 | Python | Python (3.8.2) | py | Runtime Error | 297 | 24212 | 633 | import sys
if sys.argv[-1] == 'ONLINE_JUDGE':
import os, zlib, base64
open('solve.pyx', 'wb').write(zlib.decompress(base64.b85decode("c${rg?P`QD5d7~`ER=Fu@8pF3DAIcpIZBMHw=|bXvi9iPcTKFlmIf4eW_H|<JU~x@XC@OGFv^az8u6sdG8??Rf}u`NQx%Xw({*y5LB4-+AE?>+jZWc@q6*xT+vpKlUzFd&<jL}obo!Go&Q@+hukO8i^f<_4HG&E$Tr#mo?eU716Rb1c;{a... | Traceback (most recent call last):
File "/tmp/tmpd3eekrcz/tmp7mj24dyi.py", line 6, in <module>
import solve
ModuleNotFoundError: No module named 'solve'
| |
s881823439 | p03987 | u648212584 | 1591679943 | Python | PyPy3 (2.4.0) | py | Runtime Error | 923 | 74304 | 1409 | import sys
input = sys.stdin.buffer.readline
def main():
# SegmentTree Class
class SegmentTree:
# 初期化
def __init__(self, size, default):
self.size = 2**(size-1).bit_length()
self.default = default
self.seg = [default]*(2*self.size)
# function(max, min, plus, minus, etc...)
def segfunc(self,x,y... | Traceback (most recent call last):
File "/tmp/tmpxff8g4rg/tmpoals6bax.py", line 63, in <module>
main()
File "/tmp/tmpxff8g4rg/tmpoals6bax.py", line 48, in main
N = int(input())
^^^^^^^^^^^^
ValueError: invalid literal for int() with base 10: b''
| |
s067810977 | p03987 | u423585790 | 1590439738 | Python | PyPy3 (2.4.0) | py | Runtime Error | 299 | 82800 | 700 | from collections import deque
n=int(input())
a=list(map(int,input().split()))
A=[a[0]+a[0]<a[1]-a[0]>a[1]]+a+[a[-1]+a[-1]<a[-2]-a[-1]>a[-2]]
valley=0
peak=1
dp=deque()
for i in range(1,n+1):
if A[i-1]<A[i]>A[i+1]:
dp.append((i-1,peak))
elif A[i-1]>A[i]<A[i+1]:
dp.append((i-1,valley))
l,lf=dp.popleft()
r,rf=... | Traceback (most recent call last):
File "/tmp/tmp_ttrizzt/tmpr85s7f2i.py", line 2, in <module>
n=int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s740091738 | p03987 | u423585790 | 1590439684 | Python | PyPy3 (2.4.0) | py | Runtime Error | 303 | 82800 | 711 | from collections import deque
n=int(input())
a=list(map(int,input().split()))
A=[a[0]+a[0]<a[1]-a[0]>a[1]]+a+[a[-1]+a[-1]<a[-2]-a[-1]>a[-2]]
valley=0
peak=1
dp=deque()
for i in range(1,n+1):
if A[i-1]<A[i]>A[i+1]:
dp.append((i-1,peak))
elif A[i-1]>A[i]<A[i+1]:
dp.append((i-1,valley))
l,lf=dp.popleft()
r,rf=... | Traceback (most recent call last):
File "/tmp/tmpkbb8tvs4/tmpstszsvcb.py", line 2, in <module>
n=int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s801630189 | p03987 | u423585790 | 1590439414 | Python | PyPy3 (2.4.0) | py | Runtime Error | 181 | 38256 | 643 | from collections import deque
n=int(input())
a=list(map(int,input().split()))
A=[a[0]+a[0]<a[1]-a[0]>a[1]]+a+[a[-1]+a[-1]<a[-2]-a[-1]>a[-2]]
valley=0
peak=1
dp=deque()
for i in range(1,n+1):
if A[i-1]<A[i]>A[i+1]:
dp.append((i-1,peak))
elif A[i-1]>A[i]<A[i+1]:
dp.append((i-1,valley))
l,lf=dp.popleft()
r,rf=... | File "/tmp/tmpmiz87dhg/tmp9x3e7ac2.py", line 27
l,lf=t,tf
TabError: inconsistent use of tabs and spaces in indentation
| |
s882080515 | p03987 | u571867512 | 1589927932 | Python | Python (3.4.3) | py | Runtime Error | 2118 | 231972 | 1024 | from sys import setrecursionlimit
def cal(A):
if len(A) == 0:
return 0
else:
B = sorted(A)
C = [B[len(B)-1-i] for i in range(len(B))]
if A == B or A == C:
if A == B:
output = 0
for i in range(len(A)):
output += (A[i... | Traceback (most recent call last):
File "/tmp/tmpilevmour/tmpfkhllxbx.py", line 39, in <module>
main()
File "/tmp/tmpilevmour/tmpfkhllxbx.py", line 31, in main
N = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s108607389 | p03987 | u144913062 | 1589654903 | Python | PyPy3 (2.4.0) | py | Runtime Error | 163 | 38384 | 1591 | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define REP(i, n) for (int i = 0; i < (int)(n); i++)
#define ALL(x) (x).begin(), (x).end()
vector<vector<int>> lookup;
int L;
void build_sparse_table(int N, vector<ll>& a) {
int n = 1;
L = 0;
while (n <= N) {
n <<= 1;
L++;... | File "/tmp/tmprbb3xoi3/tmpdqiherzz.py", line 2
using namespace std;
^^^^^^^^^
SyntaxError: invalid syntax
| |
s455520529 | p03987 | u223904637 | 1583896948 | Python | PyPy3 (2.4.0) | py | Runtime Error | 180 | 38256 | 1555 | import sys
input=sys.stdin.readline
def segfunc(x,y):
return x+y
def init(init_val):
#set_val
for i in range(n):
seg[i+num-1]=init_val[i]
#built
for i in... | File "/tmp/tmpqewedxzf/tmp0mgh3ebv.py", line 66
else:
^^^^
SyntaxError: invalid syntax
| |
s904522630 | p03987 | u476604182 | 1583093078 | Python | PyPy3 (2.4.0) | py | Runtime Error | 183 | 38512 | 841 | class BIT:
def __init__(self,n):
self.N = n
self.data = [0]*(N+1)
def bit_add(self,i,a):
j = i+1
while j<=N:
self.data[j] += a
j += j&-j
def bit_sum(self,i):
m = 0
j = i+1
while j>0:
m += self.data[j]
j -= j&-j
return m
def bit_search(self,x):
i = 0
... | Traceback (most recent call last):
File "/tmp/tmps_fu8s4x/tmpa90hnvup.py", line 27, in <module>
N, *A = map(int, open('0').read().split())
^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: '0'
| |
s655407338 | p03987 | u476604182 | 1583093015 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 841 | class BIT:
def __init__(self,n):
self.N = n
self.data = [0]*(N+1)
def bit_add(self,i,a):
j = i+1
while j<=N:
self.data[j] += a
j += j&-j
def bit_sum(self,i):
m = 0
j = i+1
while j>0:
m += self.data[j]
j -= j&-j
return m
def bit_search(self,x):
i = 0
... | Traceback (most recent call last):
File "/tmp/tmpijc93cfp/tmpztc0j3dd.py", line 27, in <module>
N, *A = map(int, open('0').read().split())
^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: '0'
| |
s082190944 | p03987 | u532966492 | 1577165662 | Python | Python (3.4.3) | py | Runtime Error | 1808 | 182072 | 622 | def main():
n = int(input())
a = list(map(int, input().split()))
a = sorted(list(enumerate(a)), key=lambda x: -x[1])
L = [i for i in range(n+2)] # 連結成分のうち一番左のindex
R = [i for i in range(n+2)] # 連結成分のうち一番右のindex
ans = 0
for i, j in a: # 1-indexなので1ずれる
print(L, R)
M = R[i+1]... | Traceback (most recent call last):
File "/tmp/tmp2hm520hz/tmpxyreytgz.py", line 18, in <module>
main()
File "/tmp/tmp2hm520hz/tmpxyreytgz.py", line 2, in main
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s750276203 | p03987 | u399721252 | 1575654630 | Python | PyPy3 (2.4.0) | py | Runtime Error | 165 | 38256 | 1077 | sys.setrecursionlimit(100000)
maxcost = 10**10
n = int(input())
num = [ int(v) for v in input().split() ]
pos = sorted([ (v, i) for i, v in enumerate(num,1) ])
pos = [ i[1] for i in pos ]
ln = len(bin(n-1))-1
ln2 = 2**(ln-1)
segtree = [ maxcost for i in range(2**ln-1) ]
#最小値用
def update_tomin(tree, p, q=1):
p += 2... | Traceback (most recent call last):
File "/tmp/tmpgtrg6tat/tmp4atitk34.py", line 1, in <module>
sys.setrecursionlimit(100000)
^^^
NameError: name 'sys' is not defined
| |
s916022685 | p03987 | u399721252 | 1575654411 | Python | Python (3.4.3) | py | Runtime Error | 2106 | 40076 | 1047 | maxcost = 10**10
n = int(input())
num = [ int(v) for v in input().split() ]
pos = sorted([ (v, i) for i, v in enumerate(num,1) ])
pos = [ i[1] for i in pos ]
ln = len(bin(n-1))-1
ln2 = 2**(ln-1)
segtree = [ maxcost for i in range(2**ln-1) ]
#最小値用
def update_tomin(tree, p, q=1):
p += 2**(ln-1)-2
while p >= 0:
... | Traceback (most recent call last):
File "/tmp/tmpaxdjdh9y/tmpdtyatc23.py", line 2, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s365642603 | p03987 | u017810624 | 1573889567 | Python | PyPy3 (2.4.0) | py | Runtime Error | 171 | 38256 | 6783 | def main():
class Avltree:
def __init__(self,key=None):
self.key = key
self.left = None
self.right = None
self.balance = "Even"
def search(self,key):
if self.key == None:
return None
if self.key > key:
if self.left == None:
... | File "/tmp/tmpa7aoaqny/tmp8ek6z1ow.py", line 204
n=int(input())
^
IndentationError: unindent does not match any outer indentation level
| |
s808313117 | p03987 | u347640436 | 1568590264 | Python | Python (3.4.3) | py | Runtime Error | 1857 | 25736 | 655 | INF = float('inf')
def query(a, b, k, l, r, st):
if r <= a or b <= l:
return INF
if a <= l and r <= b:
return st[k]
else:
k *= 2
t = (l + r) // 2
vl = query(a, b, k + 1, l, t)
vr = query(a, b, k + 2, t, r)
return min(vl, vr)
def main():
N = int(input())
a = list(map(int, input().... | Traceback (most recent call last):
File "/tmp/tmpq1i97vsg/tmpuhitgy8n.py", line 35, in <module>
main()
File "/tmp/tmpq1i97vsg/tmpuhitgy8n.py", line 16, in main
N = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s809534025 | p03987 | u347640436 | 1568588926 | Python | Python (3.4.3) | py | Runtime Error | 776 | 25460 | 591 | INF = float('inf')
N = int(input())
a = list(map(int, input().split()))
st = [INF] * ((1 << N.bit_length()) - 1)
for i in range(N):
k = i + N - 1
st[k] = a[i]
while k > 0:
k = (k - 1) // 2
st[k] = min(st[k * 2 + 1], st[k * 2 + 2])
def query(a, b, k, l, r):
if r <= a or b <= l:
return INF
if a ... | Traceback (most recent call last):
File "/tmp/tmpbbo5o2xy/tmpd1wt861v.py", line 3, in <module>
N = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s326643000 | p03987 | u729133443 | 1568337681 | Python | Python (3.4.3) | py | Runtime Error | 94 | 25884 | 2683 | import bisect
class BTreeNode:
def __init__(self):
self.key = []
self.child = []
class BTree:
def __init__(self):
self.root = BTreeNode()
def search_higher(self, key):
ptr = self.root
ret = None
while ptr.child:
i = bisect.bisect_right(ptr.key... | Traceback (most recent call last):
File "/tmp/tmpa7wp9abd/tmpwsboamnn.py", line 94, in <module>
main()
File "/tmp/tmpa7wp9abd/tmpwsboamnn.py", line 83, in main
n,*a=map(int,open(0).read().split())
^^^^
ValueError: not enough values to unpack (expected at least 1, got 0)
| |
s263436003 | p03987 | u729133443 | 1568332110 | Python | Python (3.4.3) | py | Runtime Error | 97 | 25884 | 1617 | from bisect import*
def main():
root=[],[]
def search_higher(key):
ptr=root
ret=None
while ptr[1]:
i=bisect(ptr[0],key)
if i!=len(ptr[0]):ret=ptr[0][i]
ptr=ptr[1][i]
i=bisect(ptr[0],key)
if i!=len(ptr[0]):ret=ptr[0][i]
return re... | Traceback (most recent call last):
File "/tmp/tmph1my5pil/tmpml1o8eex.py", line 56, in <module>
main()
File "/tmp/tmph1my5pil/tmpml1o8eex.py", line 46, in main
n,*a=map(int,open(0).read().split())
^^^^
ValueError: not enough values to unpack (expected at least 1, got 0)
| |
s403943162 | p03987 | u729133443 | 1568330875 | Python | Python (3.4.3) | py | Runtime Error | 2105 | 25884 | 1865 | from bisect import*
def main():
class BTreeNode:
def __init__(self):self.key,self.child=[],[]
root=BTreeNode()
def search_higher(key):
ptr=root
ret=None
while ptr.child:
i=bisect(ptr.key,key)
if i!=len(ptr.key):ret=ptr.key[i]
ptr=ptr.child[... | Traceback (most recent call last):
File "/tmp/tmpjb2jnrr5/tmp15jebpe6.py", line 61, in <module>
main()
File "/tmp/tmpjb2jnrr5/tmp15jebpe6.py", line 51, in main
n,*a=map(int,open(0).read().split())
^^^^
ValueError: not enough values to unpack (expected at least 1, got 0)
| |
s647919817 | p03987 | u922901775 | 1563879632 | Python | PyPy3 (2.4.0) | py | Runtime Error | 176 | 38288 | 22180 | #!/usr/bin/env python3
import sys
from collections import deque
from bisect import bisect
# The possible Node colors
BLACK = 'BLACK'
RED = 'RED'
NIL = 'NIL'
class Node:
def __init__(self, value, color, parent, left=None, right=None):
self.value = value
self.color = color
self.parent = par... | Traceback (most recent call last):
File "/tmp/tmp09s83dec/tmpzf5ysqe5.py", line 557, in <module>
main()
File "/tmp/tmp09s83dec/tmpzf5ysqe5.py", line 552, in main
N = int(next(tokens)) # type: int
^^^^^^^^^^^^
StopIteration
| |
s441079148 | p03987 | u627417051 | 1563736394 | Python | Python (3.4.3) | py | Runtime Error | 2106 | 45232 | 2032 | def getlist():
return list(map(int, input().split()))
class Node:
def __init__(self, key, parent=None, left=None, right=None):
self.key = key
self.p = parent
self.left = left
self.right = right
def __repr__(self):
return 'Node(%s)' % repr(self.key)
def search(self... | Traceback (most recent call last):
File "/tmp/tmps4_81pzs/tmpwykx_8ur.py", line 79, in <module>
N = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s094702251 | p03987 | u052499405 | 1560037557 | Python | Python (3.4.3) | py | Runtime Error | 2110 | 193428 | 1507 | import sys
sys.setrecursionlimit(10**6)
INF = 10**9
class RMQ:
def __init__(self, a):
self.n = len(aindex)
self.size = 2**(self.n - 1).bit_length()
self.data = [[INF, INF] for _ in range(2*self.size-1)]
self.initialize()
# Initialize data
def initialize(self):
for i... | Traceback (most recent call last):
File "/tmp/tmpfndnm229/tmpaprln7kn.py", line 36, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s694118831 | p03987 | u077337864 | 1556337715 | Python | Python (3.4.3) | py | Runtime Error | 1500 | 166968 | 595 | import heapq
n = int(input())
alist = list(map(int, input().split()))
ad = {}
for i, a in enumerate(alist):
ad[a] = i
h = []
right = [n-1] * n
for i in range(n):
while h and -h[0] > alist[i]:
v = -heapq.heappop(h)
right[ad[v]] = i - 1
heapq.heappush(h, -alist[i])
print(right, h)
h = []
left = [0] *... | Traceback (most recent call last):
File "/tmp/tmp8d5g8mq8/tmplbhh_em1.py", line 3, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s833189331 | p03987 | u316386814 | 1553383811 | Python | Python (3.4.3) | py | Runtime Error | 2141 | 615860 | 779 | import sys
sys.setrecursionlimit(10**7)
INF = 10 ** 18
MOD = 10 ** 9 + 7
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x) - 1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
de... | Traceback (most recent call last):
File "/tmp/tmp6oz2jehw/tmp2t1myx22.py", line 30, in <module>
print(main())
^^^^^^
File "/tmp/tmp6oz2jehw/tmp2t1myx22.py", line 15, in main
N = II()
^^^^
File "/tmp/tmp6oz2jehw/tmp2t1myx22.py", line 9, in II
def II(): return int(sys.stdin.readline())... | |
s231781893 | p03987 | u316386814 | 1553383768 | Python | Python (3.4.3) | py | Runtime Error | 95 | 23956 | 773 | import sys
sys.setrecursionlimit(10**7)
INF = 10 ** 18
MOD = 10 ** 9 + 7
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x) - 1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
de... | Traceback (most recent call last):
File "/tmp/tmpz4o90dxx/tmpsa_jsm3i.py", line 30, in <module>
print(main())
^^^^^^
File "/tmp/tmpz4o90dxx/tmpsa_jsm3i.py", line 15, in main
N = II()
^^^^
File "/tmp/tmpz4o90dxx/tmpsa_jsm3i.py", line 9, in II
def II(): return int(sys.stdin.readline())... | |
s608695954 | p03987 | u316386814 | 1553383747 | Python | Python (3.4.3) | py | Runtime Error | 96 | 24084 | 772 | import sys
sys.setrecursionlimit(10**7)
INF = 10 ** 18
MOD = 10 ** 9 + 7
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x) - 1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
de... | Traceback (most recent call last):
File "/tmp/tmpw21kcu1x/tmpt_yqbb3_.py", line 30, in <module>
print(main())
^^^^^^
File "/tmp/tmpw21kcu1x/tmpt_yqbb3_.py", line 15, in main
N = II()
^^^^
File "/tmp/tmpw21kcu1x/tmpt_yqbb3_.py", line 9, in II
def II(): return int(sys.stdin.readline())... | |
s126298807 | p03987 | u316386814 | 1553383594 | Python | Python (3.4.3) | py | Runtime Error | 2139 | 591604 | 782 | import sys
sys.setrecursionlimit(10**7)
INF = 10 ** 18
MOD = 10 ** 9 + 7
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x) - 1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
de... | Traceback (most recent call last):
File "/tmp/tmpnme_d3x_/tmp5x9upx4y.py", line 30, in <module>
print(main())
^^^^^^
File "/tmp/tmpnme_d3x_/tmp5x9upx4y.py", line 15, in main
N = II()
^^^^
File "/tmp/tmpnme_d3x_/tmp5x9upx4y.py", line 9, in II
def II(): return int(sys.stdin.readline())... | |
s186209616 | p03987 | u316386814 | 1553382679 | Python | PyPy3 (2.4.0) | py | Runtime Error | 243 | 70992 | 829 | import sys
sys.setrecursionlimit(10**7)
INF = 10 ** 18
MOD = 10 ** 9 + 7
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x) - 1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
de... | Traceback (most recent call last):
File "/tmp/tmp4_3kqxoi/tmpodoxelhd.py", line 31, in <module>
print(main())
^^^^^^
File "/tmp/tmp4_3kqxoi/tmpodoxelhd.py", line 16, in main
N = II()
^^^^
File "/tmp/tmp4_3kqxoi/tmpodoxelhd.py", line 9, in II
def II(): return int(sys.stdin.readline())... | |
s605938502 | p03987 | u543954314 | 1553362291 | Python | Python (3.4.3) | py | Runtime Error | 2104 | 24744 | 213 | n = int(input())
a = list(map(int, input().split()))
ans = 0
for i in range(n):
l,r = 1,1
while a[i-l] > a[i] and i-l > -1:
l += 1
while a[i+r] > a[i] and i+r < n:
r += 1
ans += l*r*a[i]
print(ans) | Traceback (most recent call last):
File "/tmp/tmp6xyxjl4b/tmp29l0fhpf.py", line 1, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s538541132 | p03987 | u729133443 | 1552377794 | Python | Python (3.4.3) | py | Runtime Error | 2021 | 27564 | 6207 | #AVL
##search(0,x):O(logN)
# xがある場合indexを、ない場合Noneを返す
def search(root,key):
if avl_key[root] > key:
if avl_left[root] == None:
return None
else:
return search(avl_left[root],key)
if avl_key[root] < key:
if avl_right[root] == None:
return None
... | Traceback (most recent call last):
File "/tmp/tmpsl4twokk/tmpepdnzfmm.py", line 217, in <module>
n,*a=map(int,open(0).read().split())
^^^^
ValueError: not enough values to unpack (expected at least 1, got 0)
| |
s265551118 | p03987 | u334712262 | 1552021305 | Python | Python (3.4.3) | py | Runtime Error | 2106 | 33524 | 8642 | # -*- coding: utf-8 -*-
import bisect
import heapq
import math
import random
import sys
from collections import Counter, defaultdict, deque
from decimal import ROUND_CEILING, ROUND_HALF_UP, Decimal
from functools import lru_cache, reduce
from itertools import combinations, combinations_with_replacement, product, permut... | Traceback (most recent call last):
File "/tmp/tmp7kaiyfzr/tmpg662ihw5.py", line 314, in <module>
main()
File "/tmp/tmp7kaiyfzr/tmpg662ihw5.py", line 302, in main
N = read_int()
^^^^^^^^^^
File "/tmp/tmp7kaiyfzr/tmpg662ihw5.py", line 17, in read_int
return int(input())
^^^^^^^
EO... | |
s698287812 | p03987 | u025235255 | 1549941766 | Python | PyPy3 (2.4.0) | py | Runtime Error | 264 | 76408 | 8215 | #root.search(x): ◯.data == x のものが存在するある場合それを出力、ない場合Noneを出力
#root.insert(x): ◯.data == xが存在する場合Falseを出力、ない場合◯.data == x なる頂点を作る
#y.to_s(): 頂点yのdataを出力
#y.left_s(): 頂点yのleftを出力(ない場合はNone)
#root.search_lower(x,None): ○.dataがxより小さいものの中で最も大きいものを出力、ない場合Noneを出力
#root.search_higher(x,None): xより大きいものの中で最も小さいものを出力、ない場合Noneを出力
... | Traceback (most recent call last):
File "/tmp/tmpydmnybm2/tmpoeuq7204.py", line 224, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s275880173 | p03987 | u368780724 | 1543784345 | Python | Python (3.4.3) | py | Runtime Error | 1552 | 34004 | 389 | import numpy as np
def inpl(): return [int(i) for i in input().split()]
def minisum(x):
mini = np.argmin(x)
d = len(x)
if d == 1:
return x[0]
result = 0
if mini != 0:
result += minisum(x[0:mini])
if mini != d-1:
result += minisum(x[mini+1:d])
return result + (d-mini)*... | Traceback (most recent call last):
File "/tmp/tmpjpn82998/tmppeo30qc5.py", line 15, in <module>
N = input()
^^^^^^^
EOFError: EOF when reading a line
| |
s632270747 | p03987 | u864197622 | 1543717727 | Python | Python (3.4.3) | py | Runtime Error | 74 | 25768 | 339 | N = int(input())
A = [int(a) for a in input().split()]
s = 0
for i in range(N):
l = i
while l>0:
if A[l-1] > a[i]:
l -= 1
else:
break
r = i
while r<N-1:
if A[r+1] > a[i]:
r += 1
else:
break
s += A[i] * (i-l+1) * (r... | Traceback (most recent call last):
File "/tmp/tmpj8dlv1_o/tmpwy8ne67w.py", line 1, in <module>
N = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s322866024 | p03987 | u368780724 | 1542109544 | Python | Python (3.4.3) | py | Runtime Error | 1576 | 34056 | 418 | import numpy as np
def inpl(): return [int(i) for i in input().split()]
def minisum(x):
mini = np.argmin(x)
d = len(x)
if d == 0:
return 0
if d == 1:
return x[0]
result = 0
if mini != 0:
result += minisum(x[:mini])
if mini != d-1:
result += minisum(x[mini+1:])... | Traceback (most recent call last):
File "/tmp/tmp3rafd2o1/tmpg5z6lpwd.py", line 17, in <module>
N = input()
^^^^^^^
EOFError: EOF when reading a line
| |
s908624424 | p03987 | u368780724 | 1542109378 | Python | Python (3.4.3) | py | Runtime Error | 1873 | 34008 | 353 | import numpy as np
def inpl(): return [int(i) for i in input().split()]
def minisum(x):
mini = np.argmin(x)
d = len(x)
result = 0
if mini != 0:
result += minisum(x[0:mini])
if mini != d-1:
result += minisum(x[mini+1:d])
return result + (d-mini)*(mini+1)*x[mini]
N = input()
a = n... | Traceback (most recent call last):
File "/tmp/tmp0m7zcogd/tmp27d_by4r.py", line 13, in <module>
N = input()
^^^^^^^
EOFError: EOF when reading a line
| |
s265501514 | p03987 | u368780724 | 1542108795 | Python | Python (3.4.3) | py | Runtime Error | 1605 | 34008 | 388 | import numpy as np
def inpl(): return [int(i) for i in input().split()]
def minisum(x):
mini = np.argmin(x)
d = len(x)
if d == 1:
return x[0]
result = 0
if mini != 0:
result += minisum(x[0:mini])
if mini != d-1:
result += minisum(x[mini+1:d])
return result + (d-mini)*... | Traceback (most recent call last):
File "/tmp/tmp6jkmbkzn/tmpjw3qmhdv.py", line 15, in <module>
N = input()
^^^^^^^
EOFError: EOF when reading a line
| |
s502693013 | p03987 | u996952235 | 1540245257 | Python | Python (3.4.3) | py | Runtime Error | 33 | 17780 | 226 | def min(li):
min = -1
for i in li:
if min > i:
min = i;
return min
n = int(input())
l = input().split(' ')
sum = 0;
for l in range(n):
for r in range(l,n):
sum += min(l[:r])
print(sum)
| Traceback (most recent call last):
File "/tmp/tmpipy29ea6/tmpei3xcin5.py", line 9, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s011314353 | p03987 | u996952235 | 1540245079 | Python | Python (3.4.3) | py | Runtime Error | 32 | 17780 | 226 | def min(li):
min = -1
for i in li:
if min > i:
min = i;
return min
n = int(input())
l = input().split(' ')
sum = 0;
for l in range(n):
for r in range(r,n):
sum += min(l[:r])
print(sum)
| Traceback (most recent call last):
File "/tmp/tmpyizr_xi0/tmpd8f5u58_.py", line 9, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s538998816 | p03987 | u334712262 | 1539670754 | Python | Python (3.4.3) | py | Runtime Error | 1723 | 36476 | 1385 | # -*- coding: utf-8 -*-
import bisect
import heapq
import math
import random
import sys
from collections import Counter, defaultdict, deque
from decimal import ROUND_CEILING, ROUND_HALF_UP, Decimal
from functools import lru_cache, reduce
from itertools import combinations, combinations_with_replacement, product, permut... | Traceback (most recent call last):
File "/tmp/tmpo39usly0/tmpweysf50o.py", line 83, in <module>
main()
File "/tmp/tmpo39usly0/tmpweysf50o.py", line 77, in main
N = read_int()
^^^^^^^^^^
File "/tmp/tmpo39usly0/tmpweysf50o.py", line 17, in read_int
return int(input())
^^^^^^^
EOFE... | |
s044811849 | p03987 | u098968285 | 1477235115 | Python | Python (3.4.3) | py | Runtime Error | 187 | 34344 | 748 | # def makelist(n, m):
# return [[0 for i in range(m)] for j in range(n)]
# a = int(input())
# b, c = map(int, input().split())
# s = input()
par = [0]*202020
size = [0]*202020
def find(x):
if par[x] == x:
return x
else:
par[x] = find(par[x])
return par[x]
def unite(x, y):
x = find(x)
y = find(y)
res = ... | Traceback (most recent call last):
File "/tmp/tmpfavv5w4c/tmpdt98cp5r.py", line 28, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s720642797 | p03987 | u108617242 | 1475527388 | Python | Python (3.4.3) | py | Runtime Error | 55 | 16916 | 132 | n = int(input())
a = input().split()
score = 0
for k in range(0,n):
for l in range(k,n):
score += min(int(a[k:l+1]))
print(score) | Traceback (most recent call last):
File "/tmp/tmp7_7dd9hq/tmpgo7_je2x.py", line 1, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s969449052 | p03987 | u108617242 | 1475527336 | Python | Python (3.4.3) | py | Runtime Error | 54 | 16916 | 137 | n = int(input())
a = input().split()
score = 0
for k in range(0,n):
for l in range(k,n):
score += int(min(int(a[k:l+1])))
print(score) | Traceback (most recent call last):
File "/tmp/tmpk0ds_4yp/tmpl77tgmrs.py", line 1, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s564658471 | p03987 | u108617242 | 1475527216 | Python | Python (3.4.3) | py | Runtime Error | 24 | 3064 | 136 | n = int(input())
a = input().split()
score = 0
for k in range(0,n):
for l in range(k,n):
score += int(min(int(a[k:l+1]))
print(score) | File "/tmp/tmpt3_eupqe/tmp2bo3ausa.py", line 6
score += int(min(int(a[k:l+1]))
^
SyntaxError: '(' was never closed
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.