s_id stringlengths 10 10 | p_id stringlengths 6 6 | u_id stringlengths 10 10 | date stringlengths 10 10 | language stringclasses 1
value | original_language stringclasses 11
values | filename_ext stringclasses 1
value | status stringclasses 1
value | cpu_time stringlengths 1 5 | memory stringlengths 1 7 | code_size stringlengths 1 6 | code stringlengths 1 539k |
|---|---|---|---|---|---|---|---|---|---|---|---|
s042869279 | p03488 | u466331465 | 1570674012 | Python | PyPy3 (2.4.0) | py | Runtime Error | 391 | 166236 | 1890 | import sys
import itertools
from itertools import accumulate
def main():
import itertools
def eratosthenes_sieve(n):
table = [0] * (n + 1)
prime_list = []
for i in range(2, n + 1):
if table[i] == 0:
prime_list.append(i)
for j in range(i + i, n ... |
s444882261 | p03488 | u466331465 | 1570673327 | Python | PyPy3 (2.4.0) | py | Runtime Error | 468 | 166236 | 1926 | import sys
import itertools
from itertools import accumulate
def main():
import itertools
def eratosthenes_sieve(n):
table = [0] * (n + 1)
prime_list = []
for i in range(2, n + 1):
if table[i] == 0:
prime_list.append(i)
for j in range(i + i, n ... |
s790011328 | p03488 | u466331465 | 1570672963 | Python | PyPy3 (2.4.0) | py | Runtime Error | 491 | 166236 | 1921 | import sys
import itertools
from itertools import accumulate
def main():
import itertools
def eratosthenes_sieve(n):
table = [0] * (n + 1)
prime_list = []
for i in range(2, n + 1):
if table[i] == 0:
prime_list.append(i)
for j in range(i + i, n ... |
s767994073 | p03488 | u644907318 | 1570632916 | Python | Python (3.4.3) | py | Runtime Error | 2112 | 135796 | 1431 | s = input().strip()
x,y = map(int,input().split())
A = [0]
B = [0]
cur = 0
cnt = 0
for i in range(len(s)):
if s[i]!="T":
cnt += 1
else:
if cur==0 and cnt>0:
A.append(cnt)
elif cur==1 and cnt>0:
B.append(cnt)
cnt = 0
cur = 1-cur
if s[-1]!="T":
i... |
s203210695 | p03488 | u466331465 | 1570597798 | Python | PyPy3 (2.4.0) | py | Runtime Error | 1081 | 539016 | 1915 | import sys
import itertools
from itertools import accumulate
def main():
import itertools
def eratosthenes_sieve(n):
table = [0] * (n + 1)
prime_list = []
for i in range(2, n + 1):
if table[i] == 0:
prime_list.append(i)
for j in range(i + i, n ... |
s235849271 | p03488 | u466331465 | 1570597358 | Python | PyPy3 (2.4.0) | py | Runtime Error | 1048 | 536840 | 1901 | import sys
import itertools
from itertools import accumulate
def main():
import itertools
def eratosthenes_sieve(n):
table = [0] * (n + 1)
prime_list = []
for i in range(2, n + 1):
if table[i] == 0:
prime_list.append(i)
for j in range(i + i, n ... |
s623635022 | p03488 | u466331465 | 1570596991 | Python | Python (3.4.3) | py | Runtime Error | 2120 | 253812 | 1858 | import sys
import itertools
from itertools import accumulate
def main():
import itertools
def eratosthenes_sieve(n):
table = [0] * (n + 1)
prime_list = []
for i in range(2, n + 1):
if table[i] == 0:
prime_list.append(i)
for j in range(i + i, n ... |
s011624085 | p03488 | u634461820 | 1570112061 | Python | Python (3.4.3) | py | Runtime Error | 1239 | 23540 | 1465 | #import numpy as np
import math
import sys
import itertools
MAX_INT = int(10e12)
MIN_INT = -MAX_INT
mod = 1000000007
sys.setrecursionlimit(1000000000)
def IL(): return list(map(int,input().split()))
def SL(): return input().split()
def I(): return int(sys.stdin.readline())
def S(): return input()
s = S()
x,y = IL()
N ... |
s034246224 | p03488 | u634461820 | 1570053318 | Python | PyPy3 (2.4.0) | py | Runtime Error | 359 | 105436 | 1548 | import math
import sys
import itertools
MAX_INT = int(10e12)
MIN_INT = -MAX_INT
mod = 1000000007
sys.setrecursionlimit(1000000000)
def IL(): return list(map(int,input().split()))
def SL(): return input().split()
def I(): return int(sys.stdin.readline())
def S(): return input()
s = S()
x,y = IL()
N = len(s)
xlist = []... |
s677858939 | p03488 | u634461820 | 1570003306 | Python | PyPy3 (2.4.0) | py | Runtime Error | 336 | 105308 | 1425 | import math
import sys
import itertools
MAX_INT = int(10e12)
MIN_INT = -MAX_INT
mod = 1000000007
sys.setrecursionlimit(1000000000)
def IL(): return list(map(int,input().split()))
def SL(): return input().split()
def I(): return int(sys.stdin.readline())
def S(): return input()
s = S()
x,y = IL()
N = len(s)
xlist = []... |
s710527732 | p03488 | u634461820 | 1570002769 | Python | PyPy3 (2.4.0) | py | Runtime Error | 339 | 105308 | 1433 | import math
import sys
import itertools
MAX_INT = int(10e12)
MIN_INT = -MAX_INT
mod = 1000000007
sys.setrecursionlimit(1000000000)
def IL(): return list(map(int,input().split()))
def SL(): return input().split()
def I(): return int(sys.stdin.readline())
def S(): return input()
s = S()
x,y = IL()
N = len(s)
xlist = []... |
s719418380 | p03488 | u634461820 | 1569990554 | Python | PyPy3 (2.4.0) | py | Runtime Error | 341 | 105308 | 1421 | import math
import sys
import itertools
MAX_INT = int(10e12)
MIN_INT = -MAX_INT
mod = 1000000007
sys.setrecursionlimit(1000000000)
def IL(): return list(map(int,input().split()))
def SL(): return input().split()
def I(): return int(sys.stdin.readline())
def S(): return input()
s = S()
x,y = IL()
N = len(s)
xlist = []... |
s732570692 | p03488 | u634461820 | 1569990505 | Python | PyPy3 (2.4.0) | py | Runtime Error | 169 | 38384 | 1450 | import math
import sys
import itertools
import numpy as np
MAX_INT = int(10e12)
MIN_INT = -MAX_INT
mod = 1000000007
sys.setrecursionlimit(1000000000)
def IL(): return list(map(int,input().split()))
def SL(): return input().split()
def I(): return int(sys.stdin.readline())
def S(): return input()
s = S()
x,y = IL()
N =... |
s572345307 | p03488 | u599547273 | 1569869576 | Python | Python (3.4.3) | py | Runtime Error | 34 | 3188 | 470 | S = input()
X, Y = map(int, input().split())
# S = "FT"*4000
# X, Y = 0, 0
m = [len(s) for s in S.split("T")]
X -= m[0]
ud = m[1::2]
lr = m[2::2]
ud_move = 1<<8001
for ud_i in ud:
ud_move |= ud_move<<ud_i
ud_move |= ud_move>>ud_i
lr_move = 1<<8001
for lr_i in lr:
lr_move |= lr_move<<lr_i
lr_move |= lr... |
s240830050 | p03488 | u325227960 | 1568609279 | Python | PyPy3 (2.4.0) | py | Runtime Error | 618 | 168668 | 812 | s = input()
x, y = map(int, input().split())
n = len(s)
D = [[], []]
st_x = 0
st_y = 0
st = 0
while st <= len(s)-1 and s[st] == "F":
st_x += 1
st += 1
di = 0
for i in range(st, n):
if s[i] == "T":
di = (di+1) % 2
D[di].append(0)
else:
D[di][-1] += 1
# print(D)
ANS = [0, 0]
s... |
s733174393 | p03488 | u325227960 | 1568608558 | Python | Python (3.4.3) | py | Runtime Error | 167 | 4980 | 796 | s = input()
x, y = map(int, input().split())
n = len(s)
D = [[], []]
st_x = 0
st_y = 0
st = 0
while st <= len(s)-1 and s[st] == "F":
st_x += 1
st += 1
di = 0
for i in range(st, n):
if s[i] == "T":
di = (di+1) % 2
D[di].append(0)
else:
D[di][-1] += 1
# print(D)
mid = 10
ANS = ... |
s212120087 | p03488 | u325227960 | 1568608490 | Python | PyPy3 (2.4.0) | py | Runtime Error | 215 | 43632 | 796 | s = input()
x, y = map(int, input().split())
n = len(s)
D = [[], []]
st_x = 0
st_y = 0
st = 0
while st <= len(s)-1 and s[st] == "F":
st_x += 1
st += 1
di = 0
for i in range(st, n):
if s[i] == "T":
di = (di+1) % 2
D[di].append(0)
else:
D[di][-1] += 1
# print(D)
mid = 10
ANS = ... |
s624431712 | p03488 | u980322611 | 1568413482 | Python | PyPy3 (2.4.0) | py | Runtime Error | 464 | 99932 | 1575 | s = input()
x,y = map(int,input().split())
X = []
Y = []
flag = 0
tmp = 0
for i in s:
if i == "T":
if flag == 0:
if tmp != 0:
X.append(tmp)
flag = 1
tmp = 0
else:
if tmp != 0:
Y.append(tmp)
flag = 0
... |
s813975235 | p03488 | u980322611 | 1568413023 | Python | PyPy3 (2.4.0) | py | Runtime Error | 442 | 99932 | 1528 | s = input()
x,y = map(int,input().split())
X = []
Y = []
flag = 0
tmp = 0
for i in s:
if i == "T":
if flag == 0:
if tmp != 0:
X.append(tmp)
flag = 1
tmp = 0
else:
if tmp != 0:
Y.append(tmp)
flag = 0
... |
s446430603 | p03488 | u543954314 | 1567614317 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3316 | 571 | s = list(map(len,input().split("T")))
x = s[::2]
y = s[1::2]
gx,gy = map(int,input().split())
if sum(x) < abs(gx) or sum(y) < abs(gy):
print("No")
exit(0)
dpx = [0]*(len(x)+1)
dpy = [0]*(len(y)+1)
dpx[1] = set(x[0])
dpy[0] = set([0])
for i in range(2,len(x)+1):
s1 = set([v + x[i-1] for v in dpx[i-1]])
s2 = set(... |
s970232843 | p03488 | u762557532 | 1567270337 | Python | PyPy3 (2.4.0) | py | Runtime Error | 753 | 171912 | 1279 | ## PyPy3 なら通りそう
def ABC082D(Step, Size, advance, Goal):
## 初期化
dp = [[False for j in range(2*Size+1)] for i in range(Step+1)]
dp[0][Size] = True
## DP
for i in range(Step):
for j in range(2*Size+1):
dp[i+1][j] = dp[i][max(j-advance[i],0)] or dp[i][min(j+advance[i],2*Size)]
return dp[Step][Goal+S... |
s921820118 | p03488 | u762557532 | 1567270012 | Python | PyPy3 (2.4.0) | py | Runtime Error | 734 | 171912 | 1143 | ## PyPy3 なら通りそう
def ABC082D(Step, Size, advance, Goal):
## 初期化
dp = [[False for j in range(2*Size+1)] for i in range(Step+1)]
dp[0][Size] = True
## DP
for i in range(Step):
for j in range(2*Size+1):
dp[i+1][j] = dp[i][max(j-advance[i],0)] or dp[i][min(j+advance[i],2*Size)]
return dp[Step][Goal+S... |
s976061543 | p03488 | u648212584 | 1567100355 | Python | Python (3.4.3) | py | Runtime Error | 33 | 3188 | 913 | def main():
s = list(input())
s.append("T")
x,y = map(int,input().split())
x_list = []
y_list = []
count = 0
n = 0
for i in range(len(s)+1):
if s[i] == "F":
count += 1
else:
if n == 0:
x_list.append(count)
n = 1
... |
s454494860 | p03488 | u480138356 | 1567025911 | Python | Python (3.4.3) | py | Runtime Error | 1723 | 153600 | 1573 | import numpy as np
def main():
s = input().split("T")
x, y = map(int, input().split())
xs = []
x -= len(s[0])
for i in range(2, len(s), 2):
xs.append(len(s[i]))
ys = []
for i in range(1, len(s), 2):
ys.append(len(s[i]))
sum_x = sum(xs)
sum_y = sum(ys)
x = ab... |
s550542794 | p03488 | u480138356 | 1567025709 | Python | Python (3.4.3) | py | Runtime Error | 1744 | 200324 | 1543 | import numpy as np
def main():
s = input().split("T")
x, y = map(int, input().split())
xs = []
x -= len(s[0])
for i in range(2, len(s), 2):
xs.append(len(s[i]))
ys = []
for i in range(1, len(s), 2):
ys.append(len(s[i]))
sum_x = sum(xs)
sum_y = sum(ys)
if sum... |
s332392154 | p03488 | u703890795 | 1566602907 | Python | Python (3.4.3) | py | Runtime Error | 2112 | 138436 | 1081 | s = input()
x, y = map(int, input().split())
sx = []
sy = []
#最初の移動は方向が決まってしまっていて邪魔なのでなかったことにします
L = len(s)
s = s.lstrip("F")
x = x-L+len(s)
#この時点で最初の文字は必ずTです
fx = True
c = 0
for i in range(len(s)):
if s[i] == "T":
if fx:
if c != 0:
sx.append(c)
c = 0
else:
if c != 0:
sy.ap... |
s619993689 | p03488 | u917101497 | 1565317956 | Python | PyPy3 (2.4.0) | py | Runtime Error | 723 | 166364 | 573 | def isReach( goal, move ):
msum = sum(move)
m = len(move)
dp = [[False]*(msum*2+2) for i in range(m+1)]
dp[0][0] = True
for i in range(m):
for j in range(-msum,msum+1):
if dp[i][j]:
dp[i+1][j-move[i]] = True
dp[i+1][j+move[i]] = True
retu... |
s350846805 | p03488 | u917101497 | 1565317834 | Python | PyPy3 (2.4.0) | py | Runtime Error | 658 | 166492 | 576 | def isReach( goal, move ):
msum = sum(move)
m = len(move)
dp = [[False]*(msum*2+2) for i in range(m+1)]
dp[0][0] = True
for i in range(m):
for j in range(-msum-1,msum+1):
if dp[i][j]:
dp[i+1][j-move[i]] = True
dp[i+1][j+move[i]] = True
re... |
s406447437 | p03488 | u163320134 | 1565210125 | Python | Python (3.4.3) | py | Runtime Error | 2104 | 3188 | 753 | s=input()+'T'
x,y=map(int,input().split())
if 'T' in s:
pos=s.index('T')
x-=pos
s=s[pos+1:]
arr=s.split('T')
xarr=[]
yarr=[]
for i in range(len(arr)):
l=len(arr[i])
if l==0:
continue
if i%2==0:
yarr.append(l)
else:
xarr.append(l)
x+=sum(xarr)
y+=sum(yarr)
if x%2==1 or y%2==1:
print('No')
els... |
s577556785 | p03488 | u163320134 | 1565209385 | Python | Python (3.4.3) | py | Runtime Error | 1128 | 3316 | 1111 | s=input()+'T'
x,y=map(int,input().split())
if 'T' in s:
pos=s.index('T')
x-=pos
s=s[pos+1:]
arr=s.split('T')
xarr=[]
yarr=[]
for i in range(len(arr)):
l=len(arr[i])
if l==0:
continue
if i%2==0:
yarr.append(l)
else:
xarr.append(l)
xarr=sorted(xarr)
yarr=sorted(yarr)
xsums=[0]
for val in xarr:
... |
s363941721 | p03488 | u163320134 | 1565209099 | Python | Python (3.4.3) | py | Runtime Error | 1116 | 3316 | 1021 | s=input()+'T'
x,y=map(int,input().split())
if 'T' in s:
pos=s.index('T')
x-=pos
s=s[pos+1:]
arr=s.split('T')
xarr=[]
yarr=[]
for i in range(len(arr)):
l=len(arr[i])
if l==0:
continue
if i%2==0:
yarr.append(l)
else:
xarr.append(l)
xarr=sorted(xarr)
yarr=sorted(yarr)
xsums=[0]
for val in xarr:
... |
s700006540 | p03488 | u163320134 | 1565200757 | Python | Python (3.4.3) | py | Runtime Error | 2104 | 3188 | 839 | s=input()+'T'
x,y=map(int,input().split())
if 'T' in s:
pos=s.index('T')
x-=pos
s=s[pos+1:]
arr=s.split('T')
xarr=[]
yarr=[]
for i in range(len(arr)):
l=len(arr[i])
if l==0:
continue
if i%2==0:
yarr.append(l)
else:
xarr.append(l)
if len(xarr)!=0:
xsum=sum(xarr)
else:
xsum=0
if len(yarr)!=0... |
s757142227 | p03488 | u163320134 | 1565200322 | Python | Python (3.4.3) | py | Runtime Error | 1927 | 3188 | 853 | s=input()+'T'
x,y=map(int,input().split())
if 'T' in s:
pos=s.index('T')
x-=pos
s=s[pos+1:]
arr=s.split('T')
xarr=[]
yarr=[]
for i in range(len(arr)):
l=len(arr[i])
if l==0:
continue
if i%2==0:
yarr.append(l)
else:
xarr.append(l)
if len(xarr)!=0:
xsum=sum(xarr)
else:
xsum=0
if len(yarr)!=0... |
s058276243 | p03488 | u163320134 | 1565200224 | Python | Python (3.4.3) | py | Runtime Error | 1905 | 3188 | 785 | s=input()+'T'
x,y=map(int,input().split())
if 'T' in s:
pos=s.index('T')
x-=pos
s=s[pos+1:]
arr=s.split('T')
xarr=[]
yarr=[]
for i in range(len(arr)):
l=len(arr[i])
if l==0:
continue
if i%2==0:
yarr.append(l)
else:
xarr.append(l)
xsum=sum(xarr)
ysum=sum(yarr)
x+=xsum
y+=ysum
if x%2==1 or y%2==... |
s206066928 | p03488 | u794173881 | 1563338785 | Python | Python (3.4.3) | py | Runtime Error | 1997 | 67828 | 1064 | s = input() + "T"
x, y = map(int, input().split())
n = len(s)
tmp = n
for i in range(n):
if s[i] == "T":
tmp = i
break
x -= 1
up_down = False
cnt = 0
ud =[]
lr = []
for i in range(tmp, n):
if s[i] == "T":
if up_down and cnt != 0:
ud.append(cnt)
if not up_do... |
s634223896 | p03488 | u969190727 | 1563073172 | Python | PyPy3 (2.4.0) | py | Runtime Error | 572 | 166108 | 850 | s=input()
x,y=map(int,input().split())
X,Y=[],[]
ct,dir,ss=0,1,1
for i in range(len(s)):
if s[i]=="F":
ct+=1
if i==len(s)-1:
if dir==1:
X.append(ct)
else:
Y.append(ct)
else:
if ss==1:
x-=ct
ct,dir,ss=0,0,0
elif dir==1:
X.append(ct)
ct,dir=0,0
e... |
s789064892 | p03488 | u969190727 | 1563072999 | Python | PyPy3 (2.4.0) | py | Runtime Error | 327 | 104028 | 902 | s=input()
x,y=map(int,input().split())
X,Y=[],[]
ct,dir,ss=0,1,1
for i in range(len(s)):
if s[i]=="F":
ct+=1
if i==len(s)-1:
if dir==1 and ct!=0:
X.append(ct)
elif dir==0 and ct!=0:
Y.append(ct)
else:
if ss==1:
x-=ct
ct,dir,ss=0,0,0
elif dir==1 and ct!=0:
... |
s517819843 | p03488 | u969190727 | 1563072386 | Python | PyPy3 (2.4.0) | py | Runtime Error | 580 | 166108 | 819 | s=input()
x,y=map(int,input().split())
X,Y=[],[]
ct,dir,ss=0,1,1
for i in range(len(s)):
if s[i]=="F":
ct+=1
if i==len(s)-1:
if dir==1:
X.append(ct)
else:
Y.append(ct)
else:
if ss==1:
x-=ct
ct,dir,ss=0,0,0
elif dir==1:
X.append(ct)
ct,dir=0,0
e... |
s352649935 | p03488 | u969190727 | 1563072241 | Python | Python (3.4.3) | py | Runtime Error | 2111 | 130420 | 816 | s=input()
x,y=map(int,input().split())
X,Y=[],[]
ct,dir,ss=0,1,1
for i in range(len(s)):
if s[i]=="F":
ct+=1
if i==len(s)-1:
if dir==1:
X.append(ct)
else:
Y.append(ct)
else:
if ss==1:
x-=ct
ct,dir,ss=0,0,0
elif dir==1:
X.append(ct)
ct,dir=0,0
e... |
s663270321 | p03488 | u969190727 | 1563071500 | Python | Python (3.4.3) | py | Runtime Error | 2111 | 130164 | 726 | s=input()
x,y=map(int,input().split())
X,Y=[],[]
ct=0
dir=1
for i in range(len(s)):
if s[i]=="F":
ct+=1
if i==len(s)-1:
if dir==1:
X.append(ct)
else:
Y.append(ct)
else:
if dir==1:
X.append(ct)
ct,dir=0,0
else:
Y.append(ct)
ct,dir=0,1
if s[0]=="F":
... |
s106660010 | p03488 | u532966492 | 1562453841 | Python | PyPy3 (2.4.0) | py | Runtime Error | 181 | 38256 | 1446 | from itertools import accumulate
S=list(map(len,input().split("T")))
x,y=map(int,input().split())
x=abs(x-S[0])
y=abs(y)
L=S[2::2]
R=S[1::2]
La=list(accumulate(L))
Ra=list(accumulate(R))
sumL=sum(L)
sumR=sum(R)
flag=0
if sumL>=x and sumR>=y and (sumL-x)%2==0 and (sumR-y)%2==0 and flag==0:
setL1={0}
setR1={0}
... |
s860537276 | p03488 | u532966492 | 1562451004 | Python | PyPy3 (2.4.0) | py | Runtime Error | 241 | 42332 | 1447 | from itertools import accumulate
S=list(map(len,input().split("T")))
x,y=map(int,input().split())
x=abs(x-S[0])
y=abs(y)
L=S[2::2]
R=S[1::2]
La=list(accumulate(L))
Ra=list(accumulate(R))
sumL=sum(L)
sumR=sum(R)
flag=0
if sumL>=x and sumR>=y and (sumL-x)%2==0 and (sumR-y)%2==0 and flag==0:
setL1={0}
setR1={0... |
s432575266 | p03488 | u532966492 | 1562446216 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3188 | 974 | S=list(map(len,input().split("T")))
x,y=map(lambda x:abs(int(x)),input().split())
L=S[::2]
R=S[1::2]
sumL=sum(L)
sumR=sum(R)
flag=0
if sumL>=x and sumR>=y and (sumL-x)%2==0 and (sumR-y)%2==0 and flag==0:
setL={0}
setR={0}
gL=(sumL-x)//2
gR=(sumR-y)//2
if gL==0:
flag=1
else:
f... |
s293575509 | p03488 | u877470159 | 1562207674 | Python | PyPy3 (2.4.0) | py | Runtime Error | 837 | 166620 | 1379 | s=input()
x,y=map(int,input().split())
h=[]
v=[]
num=0
m=1
for i in s:
if i=='F':
num+=1
else:
if num!=0:
if m==1:
h.append(num)
else:
v.append(num)
m=-m
num=0
if num!=0:
if m==1:
h.append(num)
else:
... |
s073904746 | p03488 | u189575640 | 1562073521 | Python | PyPy3 (2.4.0) | py | Runtime Error | 519 | 269448 | 822 | from sys import exit
S = str(input())#["F","F","T","F"]
Gx, Gy = [int(n) for n in input().split()]#[4,4]
Xds = []
Yds = []
X = True
L = len(S)
for s in S.split("T"):
if X:
Xds.append(len(s))
else:
Yds.append(len(s))
X = not X
# print(Xds)
# print(Yds)
if(len(Xds) != 0):
memox = [set([X... |
s651862293 | p03488 | u476674388 | 1560831161 | Python | Python (3.4.3) | py | Runtime Error | 2132 | 457324 | 1723 | #!/usr/bin/env python3
import sys
import collections
YES = "Yes" # type: str
NO = "No" # type: str
def solve(S: str, X: int, Y: int):
is_x_ok = False
is_y_ok = False
S2 = S.split("T")
dp = [[0 for _ in range(17000)] for _ in range(len(S2[0::2]))]
dp[0][len(S2[0])+8000] = True
maxx = len(S... |
s017284003 | p03488 | u197300773 | 1559942861 | Python | Python (3.4.3) | py | Runtime Error | 1380 | 3924 | 460 | def cul(x,X):
dic={0:1}
for i in range(len(x)):
tmp={}
for j in dic:
tmp[j+x[i]]=1
tmp[j-x[i]]=1
dic=tmp
if X in dic: return True
else: return False
s=list(input().split("T"))
X,Y=map(int,input().split())
x,y=[len(i) for i in s[::2]],[len(i) for i in s[1:... |
s280391912 | p03488 | u367130284 | 1559585348 | Python | Python (3.4.3) | py | Runtime Error | 39 | 5248 | 1228 | #from numpy import*
#from scipy import*
from collections import* #defaultdict Counter deque appendleft
from fractions import gcd
from functools import* #reduce
from itertools import* #permutations("AB",repeat=2) combinations("AB",2) product("AB",2) groupby
from operator import mul
from bisect import* #bisect_left bisec... |
s628101830 | p03488 | u166306121 | 1559552414 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 2239 | import sys
# gcd
# from fractions import gcd
# 切り上げ,切り捨て
# from math import ceil, floor
# リストの真のコピー(変更が伝播しない)
# from copy import deepcopy
# 累積和。list(accumulate(A))としてAの累積和
# from itertools import accumulate
# l = ['a', 'b', 'b', 'c', 'b', 'a', 'c', 'c', 'b', 'c', 'b', 'a']
# S = Counter(l) # カウンタークラスが作られる。S=Counter({'... |
s863282168 | p03488 | u365364616 | 1559376768 | Python | Python (3.4.3) | py | Runtime Error | 26 | 3444 | 822 | from collections import defaultdict
s = input()
x, y = map(int, input().split())
a = 0
t = [[0], [0]]
n = 0
for i in range(len(s)):
if s[i] == 'F':
t[n][-1] += 1
else:
n = 1 - n
t[n].append(0)
flag = [False, False]
z = [x, y]
for k in range(2):
tt = t[k]
zk = z[k]
p = sum(tt... |
s027938929 | p03488 | u365364616 | 1559376003 | Python | Python (3.4.3) | py | Runtime Error | 26 | 3444 | 822 | from collections import defaultdict
s = input()
x, y = map(int, input().split())
a = 0
t = [[0], [0]]
n = 0
for i in range(len(s)):
if s[i] == 'F':
t[n][-1] += 1
else:
n = 1 - n
t[n].append(0)
flag = [False, False]
z = [x, y]
for k in range(2):
tt = t[k]
zk = z[k]
p = sum(tt... |
s454233070 | p03488 | u365364616 | 1559374598 | Python | Python (3.4.3) | py | Runtime Error | 2104 | 3316 | 940 | s = input()
x, y = map(int, input().split())
a = 0
t = [[0], [0]]
n = 0
for i in range(len(s)):
if s[i] == 'F':
t[n][-1] += 1
else:
n = 1 - n
t[n].append(0)
flag = [False, False]
z = [x, y]
for k in range(2):
tt = t[k]
zk = z[k]
p = sum(tt)
dp = [[False for _ in range(2 *... |
s566141713 | p03488 | u947883560 | 1559123639 | Python | Python (3.4.3) | py | Runtime Error | 2104 | 3444 | 1446 | #!/usr/bin/env python3
import sys
INF = float("inf")
def yes():
print("Yes") # type: str
def no():
print("No") # type: str
def solve(s: str, x: int, y: int):
s = [len(FF) for FF in s.split("T")]
sX = s[0::2] # 空となるケースに注意
sY = s[1::2] # 空となるケースに注意
# print(sX,... |
s350122695 | p03488 | u698176039 | 1558742691 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 547 | s= input()
x,y = map(int,input().split())
lr = []
tb = []
cnt = 0
even = 0
for c in s:
if c == 'F':
cnt += 1
if c == 'T':
even += 1
if even == 1:
x -= cnt
continue
if even %2 == 0:
tb += [cnt]
cnt = 0
else:
lr ... |
s715534093 | p03488 | u470542271 | 1558485429 | Python | Python (3.4.3) | py | Runtime Error | 2108 | 20988 | 1896 | s = input()
x, y = map(int, input().split())
x_forwards = [0]
y_forwards = []
flag = 'x'
for i in range(len(s)):
if s[i] == 'F':
if flag == 'x':
x_forwards[-1] += 1
else:
y_forwards[-1] += 1
else:
if flag == 'x':
flag = 'y'
y_forwards.appe... |
s456610063 | p03488 | u497046426 | 1558403665 | Python | Python (3.4.3) | py | Runtime Error | 2127 | 345044 | 904 | from collections import defaultdict
s = input()
x, y = map(int, input().split())
N = len(s)
# 0: x-direction, 1: y-direction
dist = {0: [], 1: []}
current = 0
temp = 0
for move in s:
if move == 'F':
temp += 1
else:
dist[current].append(temp)
temp = 0
current ^= 1
if temp > 0:
... |
s817119025 | p03488 | u497046426 | 1558403544 | Python | Python (3.4.3) | py | Runtime Error | 22 | 3436 | 966 | from collections import defaultdict
s = input()
x, y = map(int, input().split())
N = len(s)
# 0: x-direction, 1: y-direction
dist = {0: [], 1: []}
current = 0
temp = 0
for move in s:
if move == 'F':
temp += 1
else:
dist[current].append(temp)
n_move[current] += 1
temp = 0
... |
s297464635 | p03488 | u620480037 | 1557804813 | Python | PyPy3 (2.4.0) | py | Runtime Error | 2111 | 119456 | 1008 | import copy
s=list(input())
s.append("T")
A,B=map(int,input().split())
H=[]
W=[]
cnt=0
flag="w"
for i in range(len(s)):
if s[i]=="F":
cnt+=1
else:
if flag=="w":
W.append(cnt)
cnt=0
flag="h"
else:
H.append(cnt)
cnt=0
... |
s124338046 | p03488 | u360116509 | 1557458830 | Python | Python (3.4.3) | py | Runtime Error | 79 | 4244 | 573 | s = input()
gx, gy = map(int, input().split())
def dfs(x, y, si, f):
if len(s) == si:
if (x, y) == (gx, gy):
return True
return False
ans = False
if s[si] == 'T':
return dfs(x, y, si + 1, not f)
if f:
for xx, yy in [(x + 1, y), (x - 1, y)]:
ans =... |
s153484601 | p03488 | u360116509 | 1557457564 | Python | Python (3.4.3) | py | Runtime Error | 83 | 11580 | 738 | def dfs(x, y, gx, gy, s, f):
if len(s) == 0:
if (x, y) == (gx, gy):
return True
return False
ans = False
if s[0] == 'T':
if f:
ans = ans or dfs(x, y, gx, gy, s[1:], not f)
else:
ans = ans or dfs(x, y, gx, gy, s[1:], not f)
else:
... |
s616786018 | p03488 | u360116509 | 1557457073 | Python | Python (3.4.3) | py | Runtime Error | 83 | 11680 | 846 | def dfs(x, y, gx, gy, s, f):
if len(s) == 0:
if (x, y) == (gx, gy):
return True
return False
ans = False
if s[0] == 'T':
if f:
for xx, yy in [(x, y + 1), (x, y - 1)]:
ans = ans or dfs(xx, yy, gx, gy, s[1:], f)
else:
for xx, ... |
s305377586 | p03488 | u187205913 | 1557283359 | Python | PyPy3 (2.4.0) | py | Runtime Error | 352 | 284552 | 970 | s = input()
x,y = map(int,input().split())
k = 0
data = [[],[]]
f = 0
p = 1
for s_ in s:
if p==1 and s_=='F':
x -= 1
continue
p = 0
if s_ == 'T':
if f:
data[k].append(f)
k = (k+1)%2
f = 0
else:
f += 1
if f:
data[k].append(f)
nx = sum(data[... |
s649323806 | p03488 | u187205913 | 1557283208 | Python | PyPy3 (2.4.0) | py | Runtime Error | 668 | 286088 | 972 | s = input()
x,y = map(int,input().split())
k = 0
data = [[],[]]
f = 0
p = 1
for s_ in s:
if p==1 and s_=='F':
x -= 1
continue
p = 0
if s_ == 'T':
if f:
data[k].append(f)
k = (k+1)%2
f = 0
else:
f += 1
if f:
data[k].append(f)
nx = sum(data[... |
s180277439 | p03488 | u187205913 | 1557283113 | Python | Python (3.4.3) | py | Runtime Error | 544 | 253428 | 966 | s = input()
x,y = map(int,input().split())
k = 0
data = [[],[]]
f = 0
p = 1
for s_ in s:
if p==1 and s_=='F':
x -= 1
continue
p = 0
if s_ == 'T':
if f:
data[k].append(f)
k = (k+1)%2
f = 0
else:
f += 1
if f:
data[k].append(f)
nx = sum(data[... |
s815650939 | p03488 | u187205913 | 1557281967 | Python | PyPy3 (2.4.0) | py | Runtime Error | 268 | 166620 | 980 | s = input()
x,y = map(int,input().split())
k = 0
data = [[],[]]
f = 0
p = 1
for s_ in s:
if p==1 and s_=='F':
x -= 1
continue
p = 0
if s_ == 'T':
if f:
data[k].append(f)
k = (k+1)%2
f = 0
else:
f += 1
if f:
data[k].append(f)
nx = sum(data[... |
s273027141 | p03488 | u187205913 | 1557281431 | Python | PyPy3 (2.4.0) | py | Runtime Error | 445 | 166492 | 986 | s = input()
x,y = map(int,input().split())
k = 0
data = [[],[]]
f = 0
p = 1
for s_ in s:
if p==1 and s_=='F':
x -= 1
continue
p = 0
if s_ == 'T':
if f:
data[k].append(f)
k = (k+1)%2
f = 0
else:
f += 1
if f:
data[k].append(f)
nx = sum(data[... |
s946880288 | p03488 | u187205913 | 1557281346 | Python | PyPy3 (2.4.0) | py | Runtime Error | 219 | 69724 | 988 | s = input()
x,y = map(int,input().split())
k = 0
data = [[],[]]
f = 0
p = 1
for s_ in s:
if p==1 and s_=='F':
x -= 1
continue
p = 0
if s_ == 'T':
if f:
data[k].append(f)
k = (k+1)%2
f = 0
else:
f += 1
if f:
data[k].append(f)
nx = sum(data[... |
s445955098 | p03488 | u187205913 | 1557281041 | Python | PyPy3 (2.4.0) | py | Runtime Error | 441 | 165084 | 980 | s = input()
x,y = map(int,input().split())
k = 0
data = [[],[]]
f = 0
p = 1
for s_ in s:
if p==1 and s_=='F':
x -= 1
continue
p = 0
if s_ == 'T':
if f:
data[k].append(f)
k = (k+1)%2
f = 0
else:
f += 1
if f:
data[k].append(f)
nx = sum(data[... |
s353572334 | p03488 | u187205913 | 1557280837 | Python | Python (3.4.3) | py | Runtime Error | 2111 | 130292 | 980 | s = input()
x,y = map(int,input().split())
k = 0
data = [[],[]]
f = 0
p = 1
for s_ in s:
if p==1 and s_=='F':
x -= 1
continue
p = 0
if s_ == 'T':
if f:
data[k].append(f)
k = (k+1)%2
f = 0
else:
f += 1
if f:
data[k].append(f)
nx = sum(data[... |
s441200814 | p03488 | u187205913 | 1557280413 | Python | Python (3.4.3) | py | Runtime Error | 2112 | 145012 | 979 | s = input()
x,y = map(int,input().split())
k = 0
data = [[],[]]
f = 0
p = 1
for s_ in s:
if p==1 and s_=='F':
x -= 1
continue
p = 0
if s_ == 'T':
if f:
data[k].append(f)
k = (k+1)%2
f = 0
else:
f += 1
if f:
data[k].append(f)
nx = sum(data[... |
s852672618 | p03488 | u187205913 | 1557280211 | Python | Python (3.4.3) | py | Runtime Error | 1540 | 145012 | 945 | s = input()
x,y = map(int,input().split())
k = 0
data = [[],[]]
f = 0
p = 1
for s_ in s:
if p==1 and s_=='F':
x -= 1
continue
p = 0
if s_ == 'T':
if f:
data[k].append(f)
k = (k+1)%2
f = 0
else:
f += 1
if f:
data[k].append(f)
nx = sum(data[... |
s088471451 | p03488 | u187205913 | 1557279960 | Python | Python (3.4.3) | py | Runtime Error | 978 | 128500 | 915 | s = input()
x,y = map(int,input().split())
k = 0
data = [[],[]]
f = 0
p = 1
for s_ in s:
if p==1 and s_=='F':
x -= 1
continue
p = 0
if s_ == 'T':
if f:
data[k].append(f)
k = (k+1)%2
f = 0
else:
f += 1
if f:
data[k].append(f)
nx = sum(data[... |
s412203712 | p03488 | u187205913 | 1557279900 | Python | Python (3.4.3) | py | Runtime Error | 1028 | 66036 | 915 | s = input()
x,y = map(int,input().split())
k = 0
data = [[],[]]
f = 0
p = 1
for s_ in s:
if p==1 and s_=='F':
x -= 1
continue
p = 0
if s_ == 'T':
if f:
data[k].append(f)
k = (k+1)%2
f = 0
else:
f += 1
if f:
data[k].append(f)
nx = sum(data[... |
s498836183 | p03488 | u187205913 | 1557278845 | Python | Python (3.4.3) | py | Runtime Error | 2104 | 4036 | 653 | s = input()
x,y = map(int,input().split())
k = 0
data = [[],[]]
f = 0
p = 1
for s_ in s:
if p==1 and s_=='F':
x -= 1
continue
p = 0
if s_ == 'T':
if f:
data[k].append(f)
k = (k+1)%2
f = 0
else:
f += 1
if f:
data[k].append(f)
def dfs(d,l, po... |
s726082774 | p03488 | u041075929 | 1557015070 | Python | Python (3.4.3) | py | Runtime Error | 2104 | 3188 | 950 | import sys, os
f = lambda:list(map(int,input().split()))
if 'local' in os.environ :
sys.stdin = open('./input.txt', 'r')
def solve():
s = input()
x,y = f()
flag = 1
cnt = 0
xa = []
ya = []
s += 'T'
for i in s:
if i == 'T':
if flag == 1:
if cnt:
... |
s630611414 | p03488 | u210827208 | 1555515644 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 473 | s=input()+'A'
x,y=map(int,input().split())
X=[]
Y=[]
M=[]
for i in range(len(s)-1):
if s[i]!=s[i+1]:
M.append(i)
print(M)
M+=[0]
if s[0]=='F':
ans_x=M[0]+1
ans_y=0
for i in range(1,len(M)-1,2):
if M[i]%2==0:
ans_x+=M[i+1]-M[i]
else:
ans_y+=M[i+1]-M[i]
e... |
s446841536 | p03488 | u505830998 | 1554938959 | Python | Python (3.4.3) | py | Runtime Error | 42 | 5696 | 490 | import unittest
import abc082d as tester
def ioByFile(fn='inputFile.txt'):
with open(fn) as f:
for line in f:
yield line
def getCorrect(fn='correct.txt'):
with open(fn) as f:
return f.read()
class InputTests(unittest.TestCase):
def _calFUT(self, io):
return str(tester.main(io))+'\n'
def test_it(self)... |
s826348560 | p03488 | u052499405 | 1554592664 | Python | Python (3.4.3) | py | Runtime Error | 1522 | 3572 | 1390 | s = input()
x, y = [int(item) for item in input().split()]
if abs(x) > 8000 or abs(y) > 8000:
print("No")
exit()
rl = []
ud = []
state_is_rl = True
length = 0
for c in s:
if c == "T":
if state_is_rl:
if length > 0:
rl.append(length)
state_is_rl = False
... |
s567980828 | p03488 | u052499405 | 1554592258 | Python | Python (3.4.3) | py | Runtime Error | 1486 | 3444 | 1390 | s = input()
x, y = [int(item) for item in input().split()]
if abs(x) > 8000 or abs(y) > 8000:
print("No")
exit()
rl = []
ud = []
state_is_rl = True
length = 0
for c in s:
if c == "T":
if state_is_rl:
if length > 0:
rl.append(length)
state_is_rl = False
... |
s811569192 | p03488 | u052499405 | 1554591565 | Python | Python (3.4.3) | py | Runtime Error | 1472 | 3444 | 1365 | s = input()
x, y = [int(item) for item in input().split()]
rl = []
ud = []
state_is_rl = True
length = 0
for c in s:
if c == "T":
if state_is_rl:
if length > 0:
rl.append(length)
state_is_rl = False
else:
if length > 0:
ud.append... |
s037779420 | p03488 | u052499405 | 1554590869 | Python | Python (3.4.3) | py | Runtime Error | 1521 | 3444 | 1331 | s = input()
x, y = [int(item) for item in input().split()]
rl = []
ud = []
state_is_rl = True
length = 0
for c in s:
if c == "T":
if state_is_rl and length > 0:
rl.append(length)
state_is_rl = False
elif length > 0:
ud.append(length)
state_is_rl = T... |
s237300207 | p03488 | u052499405 | 1554590520 | Python | Python (3.4.3) | py | Runtime Error | 1716 | 3700 | 1265 | s = input()
x, y = [int(item) for item in input().split()]
rl = []
ud = []
state_is_rl = True
length = 0
for c in s:
if c == "T":
if state_is_rl:
rl.append(length)
state_is_rl = False
else:
ud.append(length)
state_is_rl = True
length = 0
... |
s856939281 | p03488 | u426683236 | 1554352564 | Python | PyPy3 (2.4.0) | py | Runtime Error | 2107 | 53212 | 1215 | def findsum(array, size, i, s, target):
if s == target:
return True
if i == size:
return False
if findsum(array, size, i + 1, s + array[i], target):
return True
if findsum(array, size, i + 1, s - array[i], target):
return True
return False
def solve():
s = input(... |
s469478825 | p03488 | u018679195 | 1553566092 | Python | Python (2.7.6) | py | Runtime Error | 25 | 3720 | 944 | def dfs(s, p, l, x, y, ans1, ans2, flag1, flag2):
if p == l:
if ans1 == x and ans2 == y:
print 'Yes'
else:
print 'No'
return
if s[p] == 'F':
if flag1 == 1:
if flag2 == 1:
ans1 += 1
else:
ans1 -= 1... |
s889711034 | p03488 | u089230684 | 1553565888 | Python | Python (2.7.6) | py | Runtime Error | 26 | 3624 | 944 | def dfs(s, p, l, x, y, ans1, ans2, flag1, flag2):
if p == l:
if ans1 == x and ans2 == y:
print 'YES'
else:
print 'NO'
return
if s[p] == 'F':
if flag1 == 1:
if flag2 == 1:
ans1 += 1
else:
ans1 -= 1... |
s021364173 | p03488 | u353919145 | 1553561953 | Python | Python (2.7.6) | py | Runtime Error | 10 | 2568 | 305 | local deferMeta = {__call = function(t, view, ...)
local ret = t.__f(view)
if ret == nil then
printWarn(tostring(t) .. " is nil")
end
return ret
end, __tostring = bindHelperToString}
function bindHelper.defer(f)
return setmetatable({__bindHelper = true, __method = "defer", __f = f}, deferMeta)
end |
s425148776 | p03488 | u189575640 | 1553258568 | Python | Python (3.4.3) | py | Runtime Error | 2059 | 359944 | 821 | from sys import exit
S = str(input())#["F","F","T","F"]
Gx, Gy = [int(n) for n in input().split()]#[4,4]
Xds = []
Yds = []
X = True
L = len(S)
for s in S.split("T"):
if X:
Xds.append(len(s))
else:
Yds.append(len(s))
X = not X
# print(Xds)
# print(Yds)
if(len(Xds) != 0):
memox = [set([Xd... |
s868118518 | p03488 | u189575640 | 1553256531 | Python | Python (3.4.3) | py | Runtime Error | 2133 | 443252 | 1021 | from sys import exit
S = str(input())#["F","F","T","F"]
Gx, Gy = [int(n) for n in input().split()]#[4,4]
Xds = []
Yds = []
X = True
L = len(S)
for s in S.split("T"):
if X:
Xds.append(len(s))
else:
Yds.append(len(s))
X = not X
# print(Xds)
# print(Yds)
memox = [[False for _ in range(2*L)] fo... |
s979908842 | p03488 | u189575640 | 1553256405 | Python | Python (3.4.3) | py | Runtime Error | 2133 | 444372 | 964 | from sys import exit
S = str(input())#["F","F","T","F"]
Gx, Gy = [int(n) for n in input().split()]#[4,4]
Xds = []
Yds = []
X = True
L = len(S)
for s in S.split("T"):
if X:
Xds.append(len(s))
else:
Yds.append(len(s))
X = not X
# print(Xds)
# print(Yds)
memox = [[False for _ in range(2*L)] fo... |
s196066804 | p03488 | u189575640 | 1553179134 | Python | Python (3.4.3) | py | Runtime Error | 230 | 62848 | 1294 | from sys import exit
from enum import Enum
class Direction(Enum):
xp = 0
xn = 1
yp = 2
yn = 3
def move(S, current, D, G):
# print(D == Direction.xn)
# print(S,D,current)
if(S == []):return current == G
elif(S[0] == "F"):
if(D == Direction.xp):
if move(S[1:],[current[0... |
s977622468 | p03488 | u623819879 | 1553125338 | Python | PyPy3 (2.4.0) | py | Runtime Error | 185 | 39280 | 880 | s=input()
s+='T'
x,y=map(int,input().split())
n=len(s)
f=0
d=0
xx=[]
yy=[]
for i in range(n):
if s[i]=='F':
f+=1
else: #=='T'
if f==0:
0
else:
if d==0:
xx.append(f)
f=0
else:
yy.append(f)
... |
s560693416 | p03488 | u099566485 | 1552949251 | Python | Python (3.4.3) | py | Runtime Error | 21 | 3316 | 1604 | #082-D 個々のFがx方向y方向どちらに進むかは確定しているので、それぞれまとめて、+か-かでbit全探索
def IL(): return list(map(int,input().split()))
def SL(): return input().split()
def I(): return int(input())
def S(): return list(input())
S=S()
x,y=IL()
Dx=[]
Dy=[]
v="x"
ct=0
cf=0
for s in S:
if s=="T":
ct+=1
if cf!=0:
if v=="x":... |
s252322891 | p03488 | u099566485 | 1552948829 | Python | Python (3.4.3) | py | Runtime Error | 22 | 3316 | 1537 | #082-D 個々のFがx方向y方向どちらに進むかは確定しているので、それぞれまとめて、+か-かでbit全探索
def IL(): return list(map(int,input().split()))
def SL(): return input().split()
def I(): return int(input())
def S(): return list(input())
S=S()
x,y=IL()
Dx=[]
Dy=[]
v="x"
ct=0
cf=0
for s in S:
if s=="T":
ct+=1
if cf!=0:
if v=="x":... |
s520148331 | p03488 | u393512980 | 1552713848 | Python | PyPy3 (2.4.0) | py | Runtime Error | 195 | 40048 | 749 | s = input()
gx, gy = map(int, input().split())
n = len(s)
X, Y = [], []
x, y, flag = 0, 0, 0
for i in range(n):
if s[i] == 'F' and flag == 0:
x += 1
elif s[i] == 'F' and flag == 1:
y += 1
else:
if flag and y > 0:
Y.append(y)
y = 0
elif not flag and x >... |
s476977461 | p03488 | u393512980 | 1552713616 | Python | PyPy3 (2.4.0) | py | Runtime Error | 197 | 40048 | 734 | s = input()
gx, gy = map(int, input().split())
n = len(s)
X, Y = [], []
x, y, flag = 0, 0, 0
for i in range(n):
if s[i] == 'F' and flag == 0:
x += 1
elif s[i] == 'F' and flag == 1:
y += 1
else:
if flag and y > 0:
Y.append(y)
y = 0
elif not flag and x >... |
s967345287 | p03488 | u393512980 | 1552710893 | Python | PyPy3 (2.4.0) | py | Runtime Error | 923 | 171912 | 1371 | s = input()
gx, gy = map(int, input().split())
n = len(s)
X, Y = [], []
x, y, flag = 0, 0, 0
for i in range(n):
if s[i] == 'F' and flag == 0:
x += 1
elif s[i] == 'F' and flag == 1:
y += 1
else:
if flag and y > 0:
Y.append(y)
y = 0
elif not flag and x >... |
s473567199 | p03488 | u393512980 | 1552710803 | Python | PyPy3 (2.4.0) | py | Runtime Error | 918 | 171912 | 1361 | s = input()
gx, gy = map(int, input().split())
n = len(s)
X, Y = [], []
x, y, flag = 0, 0, 0
for i in range(n):
if s[i] == 'F' and flag == 0:
x += 1
elif s[i] == 'F' and flag == 1:
y += 1
else:
if flag and y > 0:
Y.append(y)
y = 0
elif not flag and x >... |
s963537420 | p03488 | u619458041 | 1552704100 | Python | Python (3.4.3) | py | Runtime Error | 2118 | 232980 | 1373 | import sys
def f(pos, S, goal):
F = 0
while len(S) > 0 and S[0] == 'F':
F += 1
_ = S.pop(0)
num_F = sum([c == 'F' for c in S])
next_pos = set()
for p in pos:
x = p[0]
y = p[1]
if p[2] == 0: # Forward to +x
x += F
elif p[2] == 1: # Forw... |
s359900390 | p03488 | u955251526 | 1551933536 | Python | PyPy3 (2.4.0) | py | Runtime Error | 178 | 39408 | 927 | s = input()
x, y = map(int, input().split())
edge = [[], []]
# delete first edge
firstedge = 0
for c in s:
if c == 'T': break
else: firstedge += 1
x -= firstedge
dir = 0
cur = 0
for c in s[firstedge:]:
if c == 'T':
if cur > 0:
edge[dir].append(cur)
cur = 0
dir = (dir ... |
s986000434 | p03488 | u325227960 | 1551425827 | Python | Python (3.4.3) | py | Runtime Error | 2131 | 443124 | 1404 | s = input()
x, y = map(int, input().split())
XY = [[], []]
b = 0
renzoku = 0
for i in range(len(s)) :
if s[i] == "T" :
b = (b+1) % 2
renzoku = 0
else :
if renzoku == 0 :
XY[b].append(1)
renzoku = 1
else :
XY[b][-1] += 1
#print(XY)
g = 8010
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.