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
s199210221
p03488
u535803878
1592770928
Python
PyPy3 (7.3.0)
py
Runtime Error
208
75172
1136
import sys input = lambda : sys.stdin.readline().rstrip() sys.setrecursionlimit(max(1000, 10**9)) write = lambda x: sys.stdout.write(x+"\n") s = input() x,y = map(int, input().split()) xs = [] ys = [] isx = True i = 0 n = len(s) while i<n and s[i]=="F": x -= 1 i += 1 while i<n: c = 0 while i<n and s...
s585023015
p03488
u535803878
1592770831
Python
PyPy3 (7.3.0)
py
Runtime Error
222
76280
1060
import sys input = lambda : sys.stdin.readline().rstrip() sys.setrecursionlimit(max(1000, 10**9)) write = lambda x: sys.stdout.write(x+"\n") s = input() x,y = map(int, input().split()) xs = [] ys = [] isx = True i = 0 n = len(s) while i<n and s[i]=="F": x -= 1 i += 1 while i<n: c = 0 while i<n and s...
s665551830
p03488
u535803878
1592770734
Python
Python (3.8.2)
py
Runtime Error
2206
9352
1060
import sys input = lambda : sys.stdin.readline().rstrip() sys.setrecursionlimit(max(1000, 10**9)) write = lambda x: sys.stdout.write(x+"\n") s = input() x,y = map(int, input().split()) xs = [] ys = [] isx = True i = 0 n = len(s) while i<n and s[i]=="F": x -= 1 i += 1 while i<n: c = 0 while i<n and s...
s300428881
p03488
u677121387
1592598711
Python
Python (3.8.2)
py
Runtime Error
2209
134548
946
s = input() s += "T" x,y = map(int,input().split()) mvx = [] mvy = [] now = "x" cnt = 0 for c in s: if c == "F": cnt += 1 else: if now == "x": mvx.append(cnt) now = "y" else: mvy.append(cnt) now = "x" cnt = 0 lx = len(mvx) sx = sum(mvx) dp...
s340896377
p03488
u391589398
1592168643
Python
Python (3.4.3)
py
Runtime Error
45
3192
627
S = input() gx, gy = map(int, input().split()) SL = S.split('T') D = [len(sli) for sli in SL] DX = D[2::2] DY = D[1::2] def reachable(D, s, g): OFS = 5 dp = [0] * (2*OFS+1) dp[OFS+s] = 1 for i in range(len(D)): d = D[i] ndp = [0] * (2*OFS+1) for j in range(2*OFS+1): ...
s352010354
p03488
u046158516
1591772189
Python
PyPy3 (2.4.0)
py
Runtime Error
2112
148700
741
s=input() x,y=map(int,input().split()) xpossible=[0] ypossible=[0] j=0 while s[j]=='F': j+=1 xpossible[0]+=1 if j==len(s): break counter=0 for i in range(j,len(s)): current=0 while s[i]=='F': i+=1 current+=1 if i==len(s): break r=set() if counter==0: for j in xpossible: r.a...
s038532984
p03488
u046158516
1591772139
Python
PyPy3 (2.4.0)
py
Runtime Error
2111
148208
733
s=input() x,y=map(int,input().split()) xpossible=[0] ypossible=[0] j=0 while s[j]=='F': xpossible[0]+=1 if j==len(s): break counter=0 for i in range(j,len(s)): current=0 while s[i]=='F': i+=1 current+=1 if i==len(s): break r=set() if counter==0: for j in xpossible: r.add(j+cu...
s575812036
p03488
u227082700
1591739943
Python
PyPy3 (2.4.0)
py
Runtime Error
1423
451848
582
s=input() x,y=map(int,input().split()) ss=[len(i) for i in s.split("T")] x-=ss[0] a=[] b=[] for i in range(1,len(ss)): if ss[i]==0:continue if i%2==1:b.append(ss[i]) else:a.append(ss[i]) x=abs(x) y=abs(y) a.sort() b.sort() def check(n,a): dp=[[0]*20001 for _ in range(len(a)+1)] n+=10000 dp[0][10000]=1 for...
s072520826
p03488
u227082700
1591739843
Python
Python (3.4.3)
py
Runtime Error
2125
336756
580
s=input() x,y=map(int,input().split()) ss=[len(i) for i in s.split("T")] x-=ss[0] a=[] b=[] for i in range(1,len(ss)): if ss[i]==0:continue if i%2==1:b.append(ss[i]) else:a.append(ss[i]) x=abs(x) y=abs(y) a.sort() b.sort() def check(n,a): dp=[[0]*16001 for _ in range(len(a)+1)] n+=8000 dp[0][8000]=1 for i...
s693226546
p03488
u228223940
1591051930
Python
PyPy3 (2.4.0)
py
Runtime Error
197
39920
1613
import copy s = input() x,y = map(int,input().split()) ver = [] hor = [] ini = 0 flag = 'h1' tmp = 0 for i in range(len(s)): if s[i] == 'T': if flag == 'h': if tmp > 0: hor.append(tmp) tmp = 0 flag = 'v' elif flag == 'v': if tmp > 0: ...
s561203308
p03488
u228223940
1591049655
Python
Python (3.4.3)
py
Runtime Error
52
4084
1450
import copy s = input() x,y = map(int,input().split()) ver = [] hor = [] ini = 0 flag = 'h1' tmp = 0 for i in range(len(s)): if s[i] == 'T': if flag == 'h': if tmp > 0: hor.append(tmp) tmp = 0 flag = 'v' elif flag == 'v': if tmp > 0: ...
s183161114
p03488
u228223940
1591049383
Python
PyPy3 (2.4.0)
py
Runtime Error
205
41584
1450
import copy s = input() x,y = map(int,input().split()) ver = [] hor = [] ini = 0 flag = 'h1' tmp = 0 for i in range(len(s)): if s[i] == 'T': if flag == 'h': if tmp > 0: hor.append(tmp) tmp = 0 flag = 'v' elif flag == 'v': if tmp > 0: ...
s299429570
p03488
u228223940
1590973086
Python
PyPy3 (2.4.0)
py
Runtime Error
2111
119392
1338
import copy s = input() x,y = map(int,input().split()) ver = [] hor = [] ini = 0 flag = 'h1' tmp = 0 for i in range(len(s)): if s[i] == 'T': if flag == 'h': if tmp > 0: hor.append(tmp) tmp = 0 flag = 'v' elif flag == 'v': if tmp > 0: ...
s451691327
p03488
u054514819
1590958992
Python
PyPy3 (2.4.0)
py
Runtime Error
429
166364
906
order = list(input()) X, Y = map(int, input().split()) Xs = [] Ys = [] now_lis = Xs cnt = 0 for s in order: if s=='T': if not cnt==0: now_lis.append(cnt) now_lis = Ys if now_lis==Xs else Xs cnt = 0 else: cnt += 1 if not cnt==0: now_lis.append(cnt) if order[0]==...
s857599382
p03488
u054514819
1590957919
Python
PyPy3 (2.4.0)
py
Runtime Error
258
41324
881
order = list(input()) X, Y = map(int, input().split()) Xs = [] Ys = [] now_lis = Xs cnt = 0 for s in order: if s=='T': if not cnt==0: now_lis.append(cnt) now_lis = Ys if now_lis==Xs else Xs cnt = 0 else: cnt += 1 if not cnt==0: now_lis.append(cnt) def dp(length...
s150655382
p03488
u054514819
1590885734
Python
PyPy3 (2.4.0)
py
Runtime Error
418
166364
746
order = list(input()) X, Y = map(int, input().split()) Xs = [] Ys = [] now_lis = Xs cnt = 0 for s in order: if s=='T': now_lis.append(cnt) now_lis = Ys if now_lis==Xs else Xs cnt = 0 else: cnt += 1 now_lis.append(cnt) lx = len(Xs) ly = len(Ys) def dp(length, lis, goal): M =...
s742721253
p03488
u054514819
1590885637
Python
PyPy3 (2.4.0)
py
Runtime Error
425
166364
752
order = list(input()) X, Y = map(int, input().split()) Xs = [] Ys = [] now_lis = Xs cnt = 0 for s in order: if s=='T': now_lis.append(cnt) now_lis = Ys if now_lis==Xs else Xs cnt = 0 else: cnt += 1 now_lis.append(cnt) lx = len(Xs) ly = len(Ys) def dp(length, lis, goal): M =...
s693452636
p03488
u054514819
1590885411
Python
PyPy3 (2.4.0)
py
Runtime Error
1213
570632
745
order = list(input()) X, Y = map(int, input().split()) Xs = [] Ys = [] now_lis = Xs cnt = 0 for s in order: if s=='T': now_lis.append(cnt) now_lis = Ys if now_lis==Xs else Xs cnt = 0 else: cnt += 1 now_lis.append(cnt) lx = len(Xs) ly = len(Ys) def dp(length, lis, goal): dp ...
s099189219
p03488
u054514819
1590885375
Python
PyPy3 (2.4.0)
py
Runtime Error
343
40940
747
order = list(input()) X, Y = map(int, input().split()) Xs = [] Ys = [] now_lis = Xs cnt = 0 for s in order: if s=='T': now_lis.append(cnt) now_lis = Ys if now_lis==Xs else Xs cnt = 0 else: cnt += 1 now_lis.append(cnt) lx = len(Xs) ly = len(Ys) def dp(length, lis, goal): dp ...
s092595470
p03488
u054514819
1590885037
Python
Python (3.4.3)
py
Runtime Error
2167
996084
758
order = list(input()) X, Y = map(int, input().split()) Xs = [] Ys = [] now_lis = Xs cnt = 0 for s in order: if s=='T': now_lis.append(cnt) now_lis = Ys if now_lis==Xs else Xs cnt = 0 else: cnt += 1 now_lis.append(cnt) lx = len(Xs) ly = len(Ys) xdp = [[0]*16000 for _ in range(lx+...
s374163196
p03488
u054514819
1590884869
Python
PyPy3 (2.4.0)
py
Runtime Error
865
530952
754
order = list(input()) X, Y = map(int, input().split()) Xs = [] Ys = [] now_lis = Xs cnt = 0 for s in order: if s=='T': now_lis.append(cnt) now_lis = Ys if now_lis==Xs else Xs cnt = 0 else: cnt += 1 now_lis.append(cnt) lx = len(Xs) ly = len(Ys) xdp = [[0]*8000 for _ in range(lx+1...
s206344604
p03488
u562935282
1590863071
Python
Python (3.4.3)
py
Runtime Error
28
3188
574
def main(): *CMDs, = map(len, input().split('T')) CMDs += [0, 0, 0] # 番兵,sliceでREを出さないため X, Y = map(int, input().split()) X -= CMDs[0] # この操作だけは対称性がない def is_reachable(cmds, goal): SFT = 8000 # [-SFT,SFT] -> [0,SFT*2] dp = 1 << SFT for d in cmds: dp = (...
s560670433
p03488
u562935282
1590863037
Python
Python (3.4.3)
py
Runtime Error
28
3188
571
def main(): *CMDs, = map(len, input().split('T')) CMDs += [0, 0] # 番兵,sliceでREを出さないため X, Y = map(int, input().split()) X -= CMDs[0] # この操作だけは対称性がない def is_reachable(cmds, goal): SFT = 8000 # [-SFT,SFT] -> [0,SFT*2] dp = 1 << SFT for d in cmds: dp = (dp ...
s329347304
p03488
u562935282
1590862968
Python
Python (3.4.3)
py
Runtime Error
28
3316
510
def main(): *CMDs, = map(len, input().split('T')) X, Y = map(int, input().split()) X -= CMDs[0] # この操作だけは対称性がない def is_reachable(cmds, goal): SFT = 8000 # [-SFT,SFT] -> [0,SFT*2] dp = 1 << SFT for d in cmds: dp = (dp >> d) | (dp << d) return (dp >> (...
s312382660
p03488
u987164499
1590681607
Python
Python (3.4.3)
py
Runtime Error
2117
228084
781
from itertools import groupby s = list(input()) x,y = map(int,input().split()) li = [] for key, value in groupby(s): li.append((key,len(list(value)))) x_li = [] y_li = [] now = 0 for i in li: if i[0] == "F": if now%2 == 0: x_li.append(i[1]) else: y_li.append(i[1]) ...
s077552554
p03488
u994521204
1590639973
Python
PyPy3 (2.4.0)
py
Runtime Error
503
46684
2403
s = input() x, y = map(int, input().split()) if s[0] == "F": x_choku = True else: x_choku = False # susumu = s.count("F") # if susumu % 2 != (x + y) % 2: # print("No") # exit() # if susumu < (x + y): # print("No") # exit() x_houkou = True cnt = 0 X = [] Y = [] for w in s: if w == "F": ...
s678889386
p03488
u263830634
1590633407
Python
PyPy3 (2.4.0)
py
Runtime Error
1259
536072
1303
import sys # input = sys.stdin.readline sys.setrecursionlimit(10 ** 9) MOD = 10 ** 9 + 7 S = list(input()) x, y = map(int, input().split()) N = 8000 X = [0] Y = [0] flag = True for s in S: if s == 'F': if flag: X[-1] += 1 else: Y[-1] += 1 else: if flag: ...
s954447599
p03488
u263830634
1590633006
Python
Python (3.4.3)
py
Runtime Error
2125
338940
1303
import sys # input = sys.stdin.readline sys.setrecursionlimit(10 ** 9) MOD = 10 ** 9 + 7 S = list(input()) x, y = map(int, input().split()) N = 8000 X = [0] Y = [0] flag = True for s in S: if s == 'F': if flag: X[-1] += 1 else: Y[-1] += 1 else: if flag: ...
s832462856
p03488
u892487306
1590342507
Python
Python (3.4.3)
py
Runtime Error
2104
3188
1395
def parse(s): first_val = None verticals, horizontals = list(), list() seq = 0 is_horizontal = True is_first = True for c in s: if c == 'T': if is_first: first_val = seq is_first = False elif is_horizontal: horizonta...
s963460841
p03488
u891217808
1590274527
Python
PyPy3 (2.4.0)
py
Runtime Error
536
146952
903
s = input() n = len(s) x, y = map(int, input().split()) dx = [] dy = [] xy = 0 cnt =0 for i in s: if i == 'F': cnt += 1 else: xy += 1 xy %= 2 if xy: dx.append(cnt) else: dy.append(cnt) cnt = 0 if cnt != 0: if xy: dy.append(cnt) ...
s571001317
p03488
u891217808
1590274313
Python
PyPy3 (2.4.0)
py
Runtime Error
557
146952
875
s = input() n = len(s) x, y = map(int, input().split()) dx = [] dy = [] xy = 0 cnt =0 for i in s: if i == 'F': cnt += 1 else: xy += 1 xy %= 2 if xy: dx.append(cnt) else: dy.append(cnt) cnt = 0 if cnt != 0: if xy: dy.append(cnt) ...
s761200528
p03488
u179169725
1589860503
Python
PyPy3 (2.4.0)
py
Runtime Error
808
167388
3286
# https://atcoder.jp/contests/abc082/tasks/arc087_b def run_length_encoding(s): ''' 連長圧縮を行う s ... iterable object e.g. list, str return ---------- s_composed,s_num,s_idx それぞれ、圧縮後の文字列、その文字数、その文字が始まるidx ''' s_composed = [] s_sum = [] s_idx = [0] pre = s[0] cnt = 1 ...
s795701172
p03488
u179169725
1589860058
Python
PyPy3 (2.4.0)
py
Runtime Error
2125
348936
3152
# https://atcoder.jp/contests/abc082/tasks/arc087_b def run_length_encoding(s): ''' 連長圧縮を行う s ... iterable object e.g. list, str return ---------- s_composed,s_num,s_idx それぞれ、圧縮後の文字列、その文字数、その文字が始まるidx ''' s_composed = [] s_sum = [] s_idx = [0] pre = s[0] cnt = 1 ...
s347461251
p03488
u179169725
1589860003
Python
PyPy3 (2.4.0)
py
Runtime Error
1477
255112
3152
# https://atcoder.jp/contests/abc082/tasks/arc087_b def run_length_encoding(s): ''' 連長圧縮を行う s ... iterable object e.g. list, str return ---------- s_composed,s_num,s_idx それぞれ、圧縮後の文字列、その文字数、その文字が始まるidx ''' s_composed = [] s_sum = [] s_idx = [0] pre = s[0] cnt = 1 ...
s702856971
p03488
u179169725
1589859920
Python
PyPy3 (2.4.0)
py
Runtime Error
1177
223624
3152
# https://atcoder.jp/contests/abc082/tasks/arc087_b def run_length_encoding(s): ''' 連長圧縮を行う s ... iterable object e.g. list, str return ---------- s_composed,s_num,s_idx それぞれ、圧縮後の文字列、その文字数、その文字が始まるidx ''' s_composed = [] s_sum = [] s_idx = [0] pre = s[0] cnt = 1 ...
s064983932
p03488
u179169725
1589859835
Python
PyPy3 (2.4.0)
py
Runtime Error
852
170332
3178
# https://atcoder.jp/contests/abc082/tasks/arc087_b def run_length_encoding(s): ''' 連長圧縮を行う s ... iterable object e.g. list, str return ---------- s_composed,s_num,s_idx それぞれ、圧縮後の文字列、その文字数、その文字が始まるidx ''' s_composed = [] s_sum = [] s_idx = [0] pre = s[0] cnt = 1 ...
s454351119
p03488
u179169725
1589859090
Python
PyPy3 (2.4.0)
py
Runtime Error
846
168668
3089
# https://atcoder.jp/contests/abc082/tasks/arc087_b def run_length_encoding(s): ''' 連長圧縮を行う s ... iterable object e.g. list, str return ---------- s_composed,s_num,s_idx それぞれ、圧縮後の文字列、その文字数、その文字が始まるidx ''' s_composed = [] s_sum = [] s_idx = [0] pre = s[0] cnt = 1 ...
s768226873
p03488
u179169725
1589859070
Python
PyPy3 (2.4.0)
py
Runtime Error
861
168540
3095
# https://atcoder.jp/contests/abc082/tasks/arc087_b def run_length_encoding(s): ''' 連長圧縮を行う s ... iterable object e.g. list, str return ---------- s_composed,s_num,s_idx それぞれ、圧縮後の文字列、その文字数、その文字が始まるidx ''' s_composed = [] s_sum = [] s_idx = [0] pre = s[0] cnt = 1 ...
s329479917
p03488
u179169725
1589858913
Python
PyPy3 (2.4.0)
py
Runtime Error
861
170332
3067
# https://atcoder.jp/contests/abc082/tasks/arc087_b def run_length_encoding(s): ''' 連長圧縮を行う s ... iterable object e.g. list, str return ---------- s_composed,s_num,s_idx それぞれ、圧縮後の文字列、その文字数、その文字が始まるidx ''' s_composed = [] s_sum = [] s_idx = [0] pre = s[0] cnt = 1 ...
s058050066
p03488
u179169725
1589858700
Python
PyPy3 (2.4.0)
py
Runtime Error
804
168668
3181
# https://atcoder.jp/contests/abc082/tasks/arc087_b def run_length_encoding(s): ''' 連長圧縮を行う s ... iterable object e.g. list, str return ---------- s_composed,s_num,s_idx それぞれ、圧縮後の文字列、その文字数、その文字が始まるidx ''' s_composed = [] s_sum = [] s_idx = [0] pre = s[0] cnt = 1 ...
s846096765
p03488
u034128150
1589740751
Python
Python (3.4.3)
py
Runtime Error
191
14412
1290
import numpy as np s = input() x_goal, y_goal = map(int, input().split()) directed_x = None steps = 0 xs = [0] ys = [0] for c in (s+'T'): #sentinel if c == 'F': steps += 1 else: if directed_x is None: x_goal -= steps directed_x = True elif steps != 0: ...
s322363775
p03488
u714642969
1589313596
Python
PyPy3 (2.4.0)
py
Runtime Error
188
45148
1050
# -*- coding: utf-8 -*- import sys sys.setrecursionlimit(10**9) INF=10**18 MOD=10**9+7 input=lambda: sys.stdin.readline().rstrip() YesNo=lambda b: bool([print('Yes')] if b else print('No')) YESNO=lambda b: bool([print('YES')] if b else print('NO')) int1=lambda x:int(x)-1 def main(): s=list(input())+['T'] x,y=m...
s309736388
p03488
u714642969
1589313076
Python
PyPy3 (2.4.0)
py
Runtime Error
202
45020
1047
# -*- coding: utf-8 -*- import sys sys.setrecursionlimit(10**9) INF=10**18 MOD=10**9+7 input=lambda: sys.stdin.readline().rstrip() YesNo=lambda b: bool([print('Yes')] if b else print('No')) YESNO=lambda b: bool([print('YES')] if b else print('NO')) int1=lambda x:int(x)-1 def main(): s=list(input())+['T'] x,y=m...
s828919756
p03488
u057109575
1588281148
Python
PyPy3 (2.4.0)
py
Runtime Error
470
231560
630
S = input() X, Y = map(int, input().split()) if S.find("F") < 0: if X != 0 or Y != 0: print("No") else: print("Yes") exit() n = len(S) d = list(map(len, S.split("T"))) xs = d[::2] ys = d[1::2] dpx = [set() for _ in range(len(xs))] dpx[0].add(0) for i in range(len(xs)): for j in dpx[i]...
s793324729
p03488
u057109575
1588280128
Python
Python (3.4.3)
py
Runtime Error
2124
474484
932
S = input() X, Y = map(int, input().split()) if S.find("F") < 0: if X != 0 or Y != 0: print("No") exit() n = len(S) d = list(map(len, S.split("T"))) xs = d[::2] ys = d[1::2] dpx = [[False] * (2 * n + 1) for _ in range(len(xs))] for i in range(len(xs)): if i == 0: d = (-1) ** S.find("F...
s003900168
p03488
u057109575
1588279767
Python
PyPy3 (2.4.0)
py
Runtime Error
2135
526600
923
S = input() X, Y = map(int, input().split()) n = len(S) xs = list(map(len, S.split("T")[::2])) ys = list(map(len, S.split("T")[1::2])) dpx = [[False] * (2 * n + 1) for _ in range(len(xs))] for i in range(len(xs)): if i == 0: d = (-1) ** S.find("F") dpx[i][d * xs[i] + n] = True continue ...
s930914312
p03488
u932465688
1587870556
Python
PyPy3 (2.4.0)
py
Runtime Error
186
38480
2189
s = input() x,y = map(int,input().split()) cur_x = 0 cur_y = 0 L_x = [] L_y = [] s += 'K' temp = 0 dirc = 'yoko' for i in range(len(s)): if s[i] == 'F': temp += 1 elif s[i] == 'T': if temp == 0: if dirc == 'yoko': dirc = 'tate' else: dirc =...
s860742242
p03488
u932465688
1587870443
Python
PyPy3 (2.4.0)
py
Runtime Error
1516
285832
2311
s = input() x,y = map(int,input().split()) cur_x = 0 cur_y = 0 L_x = [] L_y = [] s += 'K' temp = 0 dirc = 'yoko' for i in range(len(s)): if s[i] == 'F': temp += 1 elif s[i] == 'T': if temp == 0: if dirc == 'yoko': dirc = 'tate' else: dirc =...
s271700410
p03488
u932465688
1587868861
Python
PyPy3 (2.4.0)
py
Runtime Error
1524
286984
2258
s = input() x,y = map(int,input().split()) cur_x = 0 cur_y = 0 L_x = [] L_y = [] s += 'K' temp = 0 dirc = 'yoko' for i in range(len(s)): if s[i] == 'F': temp += 1 elif s[i] == 'T': if temp == 0: if dirc == 'yoko': dirc = 'tate' else: dirc =...
s552378718
p03488
u345966487
1587850527
Python
PyPy3 (2.4.0)
py
Runtime Error
189
41072
1208
"""Knapsack""" import sys sys.setrecursionlimit(10 ** 9) input = sys.stdin.readline s = input().rstrip() gx, gy = map(int, input().split()) rx, ry = 0, 0 head, inst = 0, [] while head < len(s) and s[head] == "F": head += 1 rx += 1 xlist, ylist = [], [] heading_x = True while head < len(s): tcnt = 0 wh...
s539169957
p03488
u488401358
1587511718
Python
PyPy3 (2.4.0)
py
Runtime Error
202
41692
803
from itertools import groupby s=input() x,y=map(int,input().split()) data=[s[i] for i in range(0,len(s))] data=groupby(data) LR=[] UD=[] point='LR' flag=0 for key,group in data: g=len(list(group)) if key=='F': if flag==0: x-=g flag=1 else: if point=='LR': ...
s841710265
p03488
u488401358
1587504547
Python
PyPy3 (2.4.0)
py
Runtime Error
178
38384
1762
import sys sys.setrecusionlimit(1000000) s=input() x,y=map(int,input().split()) N=len(s) memo={} def dfs(startx,starty,direction,num): if (startx,starty,direction,num) in memo.keys(): return memo[(startx,starty,direction,num)] if num==N: memo[(startx,starty,direction,num)]=0 memo[(sta...
s517358091
p03488
u488401358
1587504500
Python
PyPy3 (2.4.0)
py
Runtime Error
485
43632
1719
s=input() x,y=map(int,input().split()) N=len(s) memo={} def dfs(startx,starty,direction,num): if (startx,starty,direction,num) in memo.keys(): return memo[(startx,starty,direction,num)] if num==N: memo[(startx,starty,direction,num)]=0 memo[(startx,starty,direction,num)]=(startx==x and s...
s755265369
p03488
u189479417
1587329134
Python
PyPy3 (2.4.0)
py
Runtime Error
2154
801792
1734
s = input() x, y = map(int,input().split()) flag = 1 X = [] Y = [] cnt = 0 for i in s: if i == 'T': if flag == 1 and cnt: X.append(cnt) cnt = 0 elif flag == -1 and cnt: Y.append(cnt) cnt = 0 flag *= -1 else: cnt += 1 if flag == 1 an...
s884832850
p03488
u189479417
1587329100
Python
Python (3.4.3)
py
Runtime Error
2138
510300
1734
s = input() x, y = map(int,input().split()) flag = 1 X = [] Y = [] cnt = 0 for i in s: if i == 'T': if flag == 1 and cnt: X.append(cnt) cnt = 0 elif flag == -1 and cnt: Y.append(cnt) cnt = 0 flag *= -1 else: cnt += 1 if flag == 1 an...
s281253431
p03488
u654470292
1587277554
Python
PyPy3 (2.4.0)
py
Runtime Error
487
167260
1619
import bisect import copy import heapq import math import sys from collections import * from itertools import accumulate, combinations, permutations, product # from math import gcd def input(): return sys.stdin.readline()[:-1] def ruiseki(lst): return [0]+list(accumulate(lst)) mod=pow(10,9)+7 al=[chr(ord('a') +...
s187630546
p03488
u678167152
1587274797
Python
PyPy3 (2.4.0)
py
Runtime Error
2107
55004
1584
from collections import deque def check(): S = input() x, y = map(int, input().split()) fs = list(map(len,S.split('T'))) if len(fs)<3: if x != fs[0]: return False if len(fs)==1: if y == 0: return True else: return False ...
s936306596
p03488
u678167152
1587274426
Python
PyPy3 (2.4.0)
py
Runtime Error
2107
54364
1413
from collections import deque def check(): S = input() x, y = map(int, input().split()) fs = list(map(len,S.split('T'))) xs = fs[2::2] ys = fs[1::2] xs.sort(reverse = True) N = len(xs) M = len(ys) cum = [0]*(N+1) for i in range(N-1,-1,-1): cum[i] = cum[i+1]+xs[i] pos ...
s500877925
p03488
u678167152
1587271238
Python
PyPy3 (2.4.0)
py
Runtime Error
2157
691976
1214
from collections import deque def check(): S = input() x, y = map(int, input().split()) fs = list(map(len,S.split('T'))) xs = fs[::2] ys = fs[1::2] xs.sort(reverse = True) N = len(xs) M = len(ys) cum = [0]*(N+1) for i in range(N-1,-1,-1): cum[i] = cum[i+1]+xs[i] pos =...
s450614851
p03488
u678167152
1587271056
Python
PyPy3 (2.4.0)
py
Runtime Error
2147
699400
1224
from collections import deque def check(): S = input() x, y = map(int, input().split()) fs = list(map(len,S.split('T'))) xs = fs[::2] ys = fs[1::2] xs.sort(reverse = True) N = len(xs) M = len(ys) cum = [0]*(N+1) for i in range(N-1,-1,-1): cum[i] = cum[i+1]+xs[i] pos =...
s174464867
p03488
u678167152
1587269925
Python
Python (3.4.3)
py
Runtime Error
2117
210548
1113
from collections import deque def check(): S = input() x, y = map(int, input().split()) fs = list(map(len,S.split('T'))) xs = fs[::2] ys = fs[1::2] xs.sort(reverse = True) N = len(xs) M = len(ys) cum = [xs[-1]]*N for i in range(N-2,-1,-1): cum[i] = cum[i+1]+xs[i] pos ...
s583647981
p03488
u003019316
1587231415
Python
PyPy3 (2.4.0)
py
Runtime Error
2106
61148
1334
import sys s = input() x, y = map(int, input().split()) fn = [ int(len(f)) for f in s.split('T')] h = [] v = [] for i in range(len(fn)): if i % 2 == 0: h.append(fn[i]) else: v.append(fn[i]) if sum(h) < abs(x) or sum(v) < abs(y): print("No") sys.exit(0) # 水平 dph = [False]*(2*sum(h)+1...
s398475107
p03488
u609061751
1587211545
Python
PyPy3 (2.4.0)
py
Runtime Error
703
168412
1623
import sys input = sys.stdin.readline s = input().rstrip() x, y = [int(x) for x in input().split()] horizontal = [] vertical = [] switch = 1 distance = 0 for i in range(len(s)): if s[i] == "F": distance += 1 elif switch: horizontal.append(distance) distance = 0 switch ^= 1 ...
s524521338
p03488
u863442865
1586696320
Python
Python (3.4.3)
py
Runtime Error
22
3572
1064
def main(): import sys input = sys.stdin.readline sys.setrecursionlimit(10**7) from collections import Counter, deque #from collections import defaultdict from itertools import combinations, permutations, accumulate, groupby #from itertools import product from bisect import bisect_left,b...
s792672774
p03488
u863442865
1586648936
Python
PyPy3 (2.4.0)
py
Runtime Error
1203
1027336
1587
def main(): import sys input = sys.stdin.readline sys.setrecursionlimit(10**7) from collections import Counter, deque #from collections import defaultdict from itertools import combinations, permutations, accumulate, groupby #from itertools import product from bisect import bisect_left,b...
s614728764
p03488
u063896676
1586466032
Python
Python (3.4.3)
py
Runtime Error
90
4380
1465
# coding: utf-8 # https://atcoder.jp/contests/abc082/tasks/arc087_b # 16:28- def main(): s = input() x, y = map(int, input().split()) n_f = len([1 for c in s if c == "F"]) directions = { "r": ["u", "d"], "l": ["u", "d"], "u": ["l", "r"], "d": ["l", "r"] } def rec(now_x, now_y, dire...
s367882728
p03488
u139112865
1585700068
Python
PyPy3 (2.4.0)
py
Runtime Error
779
171912
1960
#082_D s = input() x, y = map(int, input().split()) xgo, ygo = [], [] cnt = 0 flg = True check = True if s[0] == 'F' else False for i in range(len(s)): if s[i] == 'T': if flg and cnt > 0: xgo.append(cnt) elif cnt > 0: ygo.append(cnt) cnt = 0 flg = (flg + 1) %...
s349313347
p03488
u139112865
1585698214
Python
PyPy3 (2.4.0)
py
Runtime Error
532
171784
943
#082_D s = input() x, y = map(int, input().split()) xgo, ygo = [], [] flg = True cnt = 0 for i in range(len(s)): if s[i] == 'T': if flg and cnt > 0: xgo.append(cnt) elif cnt > 0: ygo.append(cnt) flg = (flg + 1) % 2 cnt = 0 else: cnt += 1 ...
s425905597
p03488
u139112865
1585698130
Python
PyPy3 (2.4.0)
py
Runtime Error
178
39664
848
#082_D s = input() x, y = map(int, input().split()) xgo, ygo = [], [] flg = True cnt = 0 for i in range(len(s)): if s[i] == 'T': if flg and cnt > 0: xgo.append(cnt) elif cnt > 0: ygo.append(cnt) flg = (flg + 1) % 2 cnt = 0 else: cnt += 1 ...
s907133336
p03488
u139112865
1585697806
Python
PyPy3 (2.4.0)
py
Runtime Error
2144
655368
838
#082_D s = input() x, y = map(int, input().split()) xgo, ygo = [], [] flg = True cnt = 0 for i in range(len(s)): if s[i] == 'T': if flg and cnt > 0: xgo.append(cnt) elif cnt > 0: ygo.append(cnt) flg = (flg + 1) % 2 cnt = 0 else: cnt += 1 ...
s964369865
p03488
u139112865
1585694957
Python
Python (3.4.3)
py
Runtime Error
2136
430908
832
#082_D s = input() x, y = map(int, input().split()) xgo, ygo = [], [] flg = True cnt = 0 for i in range(len(s)): if s[i] == 'T': if flg and cnt > 0: xgo.append(cnt) elif cnt > 0: ygo.append(cnt) flg = (flg + 1) % 2 cnt = 0 else: cnt += 1 ...
s402795369
p03488
u512007680
1584554248
Python
PyPy3 (2.4.0)
py
Runtime Error
544
53852
1161
s = list(str(input())) x,y = map(int,input().split()) i = 0 while i < len(s) and s[i] =="F": i += 1 x -= i s = s[i:] m = [[],[]] num = 0 for i in range(len(s)): if s[i] == "F": m[num][-1] += 1 else: num += 1 num %= 2 m[num].append(0) #print("m",m) sumx = sum(m[0]) dpx = ...
s188908104
p03488
u512007680
1584553608
Python
PyPy3 (2.4.0)
py
Runtime Error
538
53468
1225
s = list(str(input())) x,y = map(int,input().split()) i = 0 while i < len(s) and s[i] =="F": i += 1 x -= i s = s[i:] m = [[],[]] num = 0 for i in range(len(s)): if s[i] == "F": m[num][-1] += 1 else: num += 1 num %= 2 m[num].append(0) #print("m",m) sumx = sum(m[0]) dpx = ...
s167658946
p03488
u512007680
1584553366
Python
PyPy3 (2.4.0)
py
Runtime Error
538
53468
1228
s = list(str(input())) x,y = map(int,input().split()) i = 0 while i < len(s) and s[i] =="F": i += 1 x -= i s = s[i+1:] m = [[],[0]] num = 1 for i in range(len(s)): if s[i] == "F": m[num][-1] += 1 else: num += 1 num %= 2 m[num].append(0) #print("m",m) sumx = sum(m[0]) dpx...
s890395385
p03488
u512007680
1584553003
Python
PyPy3 (2.4.0)
py
Runtime Error
531
53468
1159
s = list(str(input())) x,y = map(int,input().split()) m = [[0],[0]] num = 0 for i in range(len(s)): if s[i] == "F": m[num][-1] += 1 else: num += 1 num %= 2 m[num].append(0) #print("m",m) sumx = sum(m[0]) dpx = [False]*(2*sumx+3) #index(sumx+1)が座標0 dpx[sumx+1] = True #print("d...
s525321507
p03488
u512007680
1584552385
Python
PyPy3 (2.4.0)
py
Runtime Error
537
53468
1151
s = list(str(input())) x,y = map(int,input().split()) m = [[0],[0]] num = 0 for i in range(len(s)): if s[i] == "F": m[num][-1] += 1 else: num += 1 num %= 2 m[num].append(0) #print("m",m) sumx = sum(m[0]) dpx = [False]*(2*sumx+3) #index(sumx+1)が座標0 dpx[sumx+1] = True #print("d...
s994500296
p03488
u512007680
1584552347
Python
Python (3.4.3)
py
Runtime Error
2107
3572
1151
s = list(str(input())) x,y = map(int,input().split()) m = [[0],[0]] num = 0 for i in range(len(s)): if s[i] == "F": m[num][-1] += 1 else: num += 1 num %= 2 m[num].append(0) #print("m",m) sumx = sum(m[0]) dpx = [False]*(2*sumx+3) #index(sumx+1)が座標0 dpx[sumx+1] = True #print("d...
s219939106
p03488
u893063840
1584379548
Python
PyPy3 (2.4.0)
py
Runtime Error
568
168284
741
s = input() x, y = map(int, input().split()) mv = [len(e) for e in s.split("T")] mv_x = mv[2::2] mv_y = mv[1::2] def solve_dp(li, start, end): l = len(li) mx = sum(li) left = start - mx right = start + mx if end > right or end < left: return 0 dp = [[0] * (2 * mx + 1) for _ in rang...
s501391991
p03488
u893063840
1584375929
Python
PyPy3 (2.4.0)
py
Runtime Error
566
167900
739
s = input() x, y = map(int, input().split()) mv = [len(e) for e in s.split("T")] mv_x = mv[2::2] mv_y = mv[1::2] def solve_dp(li, start, end): l = len(li) mx = sum(li) left = start - mx right = start + mx if end > right or end < left: return 0 dp = [[0] * (2 * mx + 1) for _ in rang...
s991367511
p03488
u893063840
1584375535
Python
PyPy3 (2.4.0)
py
Runtime Error
567
167772
712
s = input() x, y = map(int, input().split()) mv = [len(e) for e in s.split("T")] mv_x = mv[2::2] mv_y = mv[1::2] def solve_dp(li, start, end): l = len(li) mx = sum(li) if end > start + mx or end < start - mx: return 0 dp = [[0] * (2 * mx + 1) for _ in range(l + 1)] dp[0][start] = 1 ...
s352606448
p03488
u227082700
1583872603
Python
Python (3.4.3)
py
Runtime Error
17
3064
312
s=input() x,y=map(int,input().split()) xy=[0,0] xx=0 f=0 flag=True for i in s: if i=="F": if flag and f==0: xx+=1 continue xy[f]+=1 else: f^=1 flag=False ans="Yes" if not(xx-xy[0]<=x<=xx+xy[0]):ans="No" xy[0]+=xx if (xy[0]+x)%2==0 and (xy[1]+y)%2==0:print(ans) else:print('No')
s110470529
p03488
u985963315
1583867517
Python
Python (3.4.3)
py
Runtime Error
20
3188
755
order = list(map(len, input().split("T"))) x, y = map(int, input().split()) ans = "No" lon = [order[i] for i in range(len(order)) if i % 2 == 0] lat = [order[i] for i in range(len(order)) if i % 2 == 1] def f(x, y, A, B, D): for p in A: if x > 0: x -= p else: x += p if x == 0: for q ...
s311814508
p03488
u226912938
1583286664
Python
PyPy3 (2.4.0)
py
Runtime Error
2138
574472
1532
s = str(input()) x, y = map(int, input().split()) axis = 1 count = 0 X, Y = [], [] for i in range(len(s)): if s[i] == 'F': count += 1 elif s[i] == 'T': if axis == 1: X.append(count) count = 0 else: Y.append(count) count = 0 axis *=...
s974557899
p03488
u498487134
1582599413
Python
PyPy3 (2.4.0)
py
Runtime Error
380
42224
1300
def main(): def I(): return int(input()) def MI(): return map(int, input().split()) def LI(): return list(map(int, input().split())) s=input()+"T" N=len(s) x,y=MI() F=[[],[]] temp=0 bit=0 for i in range(N): if s[i]=="F": temp+=1 else: i...
s094830785
p03488
u498487134
1582590713
Python
Python (3.4.3)
py
Runtime Error
2134
503796
1299
def I(): return int(input()) def MI(): return map(int, input().split()) def LI(): return list(map(int, input().split())) mod=10**9+7 s=input()+"T" N=len(s) x,y=MI() F=[[],[]] temp=0 bit=0 for i in range(N): if s[i]=="F": temp+=1 else: if temp!=0: F[bit].append(temp) bit=(b...
s695078806
p03488
u498487134
1582590289
Python
PyPy3 (2.4.0)
py
Runtime Error
2136
535304
1300
def I(): return int(input()) def MI(): return map(int, input().split()) def LI(): return list(map(int, input().split())) mod=10**9+7 s=input()+"T" N=len(s) x,y=MI() F=[[],[]] temp=0 bit=0 for i in range(N): if s[i]=="F": temp+=1 else: if temp!=0: F[bit].append(temp) bit=(b...
s586174954
p03488
u498487134
1582589894
Python
PyPy3 (2.4.0)
py
Runtime Error
2145
535304
1336
def I(): return int(input()) def MI(): return map(int, input().split()) def LI(): return list(map(int, input().split())) mod=10**9+7 s=input()+"T" N=len(s) x,y=MI() F=[[],[]] temp=0 bit=0 for i in range(N): if s[i]=="F": temp+=1 else: if temp!=0: F[bit].append(temp) bit=(b...
s429206189
p03488
u498487134
1582589830
Python
PyPy3 (2.4.0)
py
Runtime Error
2136
535304
1337
def I(): return int(input()) def MI(): return map(int, input().split()) def LI(): return list(map(int, input().split())) mod=10**9+7 s=input()+"T" N=len(s) x,y=MI() F=[[],[]] temp=0 bit=0 for i in range(N): if s[i]=="F": temp+=1 else: if temp!=0: F[bit].append(temp) bit=(b...
s469012382
p03488
u698176039
1582233503
Python
PyPy3 (2.4.0)
py
Runtime Error
702
166876
1270
s = input() x,y = map(int,input().split()) #%% mx = [] my = [] mx2 = [] my2 = [] cnt = 0 it = 0 for t in s: if t == 'T': if cnt: if it%2==0: mx.append(cnt) mx2.append(cnt*2) else: my.append(cnt) my2.append(cnt*2) ...
s075439629
p03488
u698176039
1582232957
Python
PyPy3 (2.4.0)
py
Runtime Error
725
166748
1555
s = input() x,y = map(int,input().split()) #%% mx = [] my = [] mx2 = [] my2 = [] cnt = 0 it = 0 for t in s: if t == 'T': if cnt: if it%2==0: mx.append(cnt) mx2.append(cnt*2) else: my.append(cnt) my2.append(cnt*2) ...
s016527599
p03488
u698176039
1582232502
Python
PyPy3 (2.4.0)
py
Runtime Error
708
166748
1202
s = input() x,y = map(int,input().split()) #%% mx = [] my = [] mx2 = [] my2 = [] cnt = 0 it = 0 for t in s: if t == 'T': if cnt: if it%2==0: mx.append(cnt) mx2.append(cnt*2) else: my.append(cnt) my2.append(cnt*2) ...
s293999756
p03488
u698176039
1582232321
Python
PyPy3 (2.4.0)
py
Runtime Error
1491
286088
1189
s = input() x,y = map(int,input().split()) #%% mx = [] my = [] mx2 = [] my2 = [] cnt = 0 it = 0 for t in s: if t == 'T': if cnt: if it%2==0: mx.append(cnt) mx2.append(cnt*2) else: my.append(cnt) my2.append(cnt*2) ...
s416605626
p03488
u698176039
1582232281
Python
Python (3.4.3)
py
Runtime Error
2119
253684
1189
s = input() x,y = map(int,input().split()) #%% mx = [] my = [] mx2 = [] my2 = [] cnt = 0 it = 0 for t in s: if t == 'T': if cnt: if it%2==0: mx.append(cnt) mx2.append(cnt*2) else: my.append(cnt) my2.append(cnt*2) ...
s847839680
p03488
u594244257
1582112922
Python
PyPy3 (2.4.0)
py
Runtime Error
172
38384
1739
def solve(): S = input() X,Y = map(int, input().split()) S_F = S.split('T') move_x = list(map(len, S_F[::2])) move_y = list(map(len,S_F[1::2])) # たどりつけない場合 if sum(move_x) < abs(X) or sum(move_y) < abs(Y): print('No') return # →移動しかできない場合 if not move_y a...
s623535990
p03488
u185325486
1581756598
Python
Python (3.4.3)
py
Runtime Error
19
2940
848
def check(s,x_tag,y_tag): x = s.split('T')[::2] y = s.split('T')[1::2] dp_x = [[False]*16001 for _ in range(len(x)+1)] dp_y = [[False]*16001 for _ in range(len(y)+1)] dp_x[0][8000], dp_y[0][8000] = True, True for i,x_s in enumerate(x): if x_s == '': continue for j,boo...
s287497707
p03488
u185325486
1581753954
Python
Python (3.4.3)
py
Runtime Error
41
7284
926
def check(s,x_tag,y_tag): x = s.split('T')[::2] y = s.split('T')[1::2] while '' in x : x.remove('') while '' in y : y.remove('') dp_x = [[0]*2**len(x) for _ in range(len(x)+1)] dp_y = [[0]*2**len(y) for _ in range(len(y)+1)] for i,x_s in enumerate(x): for j,...
s723038105
p03488
u654470292
1581745781
Python
Python (3.4.3)
py
Runtime Error
2164
997748
1069
import sys from collections import * import heapq import math import bisect from itertools import permutations,accumulate,combinations,product from fractions import gcd def input(): return sys.stdin.readline()[:-1] mod=10**9+7 s=input() x,y=map(int,input().split()) lst=[[],[]] cnt=0 tmp=0 for i in range(len(s)): ...
s063507266
p03488
u654470292
1581745677
Python
PyPy3 (2.4.0)
py
Runtime Error
1787
1036664
1069
import sys from collections import * import heapq import math import bisect from itertools import permutations,accumulate,combinations,product from fractions import gcd def input(): return sys.stdin.readline()[:-1] mod=10**9+7 s=input() x,y=map(int,input().split()) lst=[[],[]] cnt=0 tmp=0 for i in range(len(s)): ...
s969539132
p03488
u654470292
1581743458
Python
PyPy3 (2.4.0)
py
Runtime Error
556
175960
1205
import sys from collections import * import heapq import math import bisect from itertools import permutations,accumulate,combinations,product from fractions import gcd def input(): return sys.stdin.readline()[:-1] mod=pow(10,9)+7 s=input() x,y=map(int,input().split()) lst=[[],[]] cnt=0 tmp=0 for i in range(len(s)...
s765961098
p03488
u654470292
1581742716
Python
PyPy3 (2.4.0)
py
Runtime Error
1161
545396
1099
import sys from collections import * import heapq import math import bisect from itertools import permutations,accumulate,combinations,product from fractions import gcd def input(): return sys.stdin.readline()[:-1] mod=pow(10,9)+7 s=input() x,y=map(int,input().split()) lst=[[],[]] cnt=0 tmp=0 for i in range(len(s)...