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
s893787180
p03488
u325227960
1551338347
Python
Python (3.4.3)
py
Runtime Error
2132
434932
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 = 8002 ...
s321206237
p03488
u325227960
1551338129
Python
Python (3.4.3)
py
Runtime Error
66
4084
1402
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 = 10 X...
s042004965
p03488
u533885955
1548377384
Python
Python (3.4.3)
py
Runtime Error
22
3316
978
s = str(input()) l = len(s) x,y = map(int,input().split()) Fs = [] count = 0 for i in range(l): if s[i] == "T": Fs.append(count) count = 0 else: count+=1 if s[-1] == "F": Fs.append(count) xFs = [Fs[j] for j in range(len(Fs)) if j%2 == 0 and j!=0] yFs = [Fs[k] for k in range(len(Fs)) ...
s342362782
p03488
u427344224
1548282836
Python
Python (3.4.3)
py
Runtime Error
2137
438388
867
s = input() x, y = map(int, input().split()) command = s.split("T") command_length = len(command) x_command = command_length // 2 y_command = command_length // 2 if command_length % 2 != 0: x_command += 1 dpx = [[False for _ in range(8000 + 1)] for _ in range(x_command + 1)] dpx[0][4000] = True dpy = [[False for ...
s361326024
p03488
u309977459
1548000065
Python
PyPy3 (2.4.0)
py
Runtime Error
179
39024
1306
import sys input = sys.stdin.readline s = input() x, y = map(int, input().split()) movex = [] movey = [] direc = 0 first = None for elem in s.split('T'): if direc == 0: if first is not None: movex.append(len(elem)) else: fiest = len(elem) direc = 1 else: ...
s295297027
p03488
u131213364
1545938434
Python
Python (3.4.3)
py
Runtime Error
2104
3444
1242
#!/usr/bin/env python3 dp0 = [False for i in range(16000)] dp1 = [False for i in range(16000)] def reachable(start, target, lst, S): global dp0, dp1 for i in range(S): dp1[i] = False dp1[target] = True for moves in lst[::-1]: for i in range(S): dp0[i] = False fo...
s113962986
p03488
u131213364
1545937736
Python
Python (3.4.3)
py
Runtime Error
2104
3556
1174
#!/usr/bin/env python3 def reachable(start, target, lst, S): dp0 = [False for i in range(S)] dp1 = [False for i in range(S)] dp1[target] = True for moves in lst[::-1]: for i in range(S): dp0[i] = False for i in range(S): if dp1[i]: dp0[i + move...
s960303986
p03488
u272557899
1545370707
Python
Python (3.4.3)
py
Runtime Error
2112
136672
2413
s = input() x, y = map(int, input().split()) xcnt = 0 ycnt = 0 tcnt = 0 xsym = 0 ysym = 0 xstep = 0 ystep = 0 start = 0 xli = [0] yli = [0] xc = 0 yc = 0 for i in range(len(s)): if s[i] == "F": if tcnt == 0: start += 1 if tcnt % 2 == 0: xcnt += 1 xc += 1 ...
s281545749
p03488
u198062737
1543561411
Python
Python (3.4.3)
py
Runtime Error
18
3060
392
s = input() x,y = map(int,input().split(" ")) l = [len(c) for c in s.split("T")] X = l[::2] Y = l[1::2] ansX = set([X[0]]) for i in range(1,len(X)): ansX = set([c+X[i] for c in ansX]+[c-X[i] for c in ansX])) ansY = set([0]) for i in range(0,len(Y)): ansY = set([c+Y[i] for c in ansY]+[c-Y[i] for c in ansY])) ...
s214577286
p03488
u698479721
1541787652
Python
Python (3.4.3)
py
Runtime Error
2103
4036
657
s = input()+'T' x,y=map(int,input().split()) di = 0 count = 0 xlis = [] ylis = [] for charas in s: if charas == 'F': count += 1 else: if count>0: if di%2==0: xlis.append(count) else: ylis.append(count) count = 0 di += 1 if xlis==[]: xlis.append(0) x = x-xlis[0] del xl...
s153796255
p03488
u698479721
1541781196
Python
Python (3.4.3)
py
Runtime Error
2103
4040
601
s = input()+'T' x,y=map(int,input().split()) di = 0 count = 0 xlis = [] ylis = [] for charas in s: if charas == 'F': count += 1 else: if count>0: if di%2==0: xlis.append(count) else: ylis.append(count) count = 0 di += 1 if xlis==[]: xlis.append(0) if ylis==[]: ylis....
s128778110
p03488
u090225501
1541479369
Python
Python (3.4.3)
py
Runtime Error
2104
20972
989
def main(): s = input() x, y = map(int, input().split()) if solve(s, x, y): print('Yes') else: print('No') def solve(s, x, y): moves = split_moves(s) if not match(x - moves[0][0], moves[0][1:]): return False if not match(y, moves[1]): return False return...
s727492584
p03488
u090225501
1541477789
Python
Python (3.4.3)
py
Runtime Error
2104
20964
988
def main(): s = input() x, y = map(int, input().split()) if solve(s, x, y): print('Yes') else: print('No') def solve(s, x, y): moves = split_moves(s) if not match(x - moves[0][0], moves[0][1:]): return False if not match(y, moves[1]): return False return...
s225213792
p03488
u170201762
1540421771
Python
Python (3.4.3)
py
Runtime Error
1946
3572
810
s = input() x,y = map(int,input().split()) count = 0 d = [] for i in range(len(s)): if s[i] == 'F': count += 1 else: d.append(count) count = 0 if count != 0: d.append(count) dx = [d[i] for i in range(len(d)) if i%2==0] dy = [d[i] for i in range(len(d)) if i%2==1] if len(dx) == 0: ...
s982049742
p03488
u170201762
1540419895
Python
Python (3.4.3)
py
Runtime Error
22
3700
901
s = input() x,y = map(int,input().split()) count = 0 d = [] for i in range(len(s)): if s[i] == 'F': count += 1 else: d.append(count) count = 0 if count != 0: d.append(count) dx = [d[i] for i in range(len(d)) if i%2==0] dy = [d[i] for i in range(len(d)) if i%2==1] if len(dx) == 0: ...
s193399142
p03488
u170201762
1540415408
Python
Python (3.4.3)
py
Runtime Error
83
11384
520
s = input() x,y = map(int,input().split()) count = s.count('F') ans = abs(x)+abs(y) <= count def bfs(x,y,s,count): if count < abs(x)+abs(y): return False elif x==0 and y==0 and s == '': return True else: if s[0] == 'F': x -= 1 s = s[1:] count -= 1 ...
s071345653
p03488
u658993896
1540041037
Python
Python (3.4.3)
py
Runtime Error
25
3188
963
def search(keys,dic,now,goal): if now==len(keys): if goal==0: return True else: return False k=keys[now] for i in range(dic[k]+1): if search(keys,dic,now+1,goal-k*i+k*(dic[k]-i)): return True return False s=input()+'T' x,y=list(map(int,input()...
s278882882
p03488
u620084012
1539776787
Python
PyPy3 (2.4.0)
py
Runtime Error
176
39536
610
S = input() x, y = map(int, input().split()) a = [] t = 0 for s in S: if s == "F": t += 1 else: a.append(t) t = 0 a.append(t) if a == []: if x == y == 0: print("Yes") exit(0) else: print("No") exit(0) d = [[a[0],0]] for k in range(1,len(a)): ...
s213619856
p03488
u827202523
1539775160
Python
Python (3.4.3)
py
Runtime Error
2121
267740
980
def getN(): return int(input()) def getNM(): return map(int, input().split()) def getList(): return list(map(int, input().split())) def move_dp(mlis): posi = [[0 for i in range(8001)] for j in range(len(mlis) + 1)] posi[0][4000] = 1 #print(len(posi), len(posi[0])) for i in range(len(mli...
s811563857
p03488
u827202523
1539775025
Python
Python (3.4.3)
py
Runtime Error
2127
267508
937
def getN(): return int(input()) def getNM(): return map(int, input().split()) def getList(): return list(map(int, input().split())) def move_dp(mlis): posi = [[0 for i in range(8001)] for j in range(len(mlis) + 1)] posi[0][4000] = 1 #print(len(posi), len(posi[0])) for i in range(len(mli...
s450506846
p03488
u698479721
1538681961
Python
Python (3.4.3)
py
Runtime Error
2104
4052
753
s = input()+'T' x,y=map(int,input().split()) di = 0 count = 0 xlis = [] ylis = [] for charas in s: if charas == 'F': count += 1 else: if count>0: if di%2==0: xlis.append(count) else: ylis.append(count) count = 0 di += 1 if xlis==[]: xlis.append(0) if ylis==[]: ylis....
s123795499
p03488
u086612293
1535977225
Python
Python (3.4.3)
py
Runtime Error
18
3064
1436
#!/usr/bin/python3 # -*- coding: utf-8 -*- import sys from itertools import islice def reachable(steps, x): m = len(steps) if m == 0: return x == 0 n = sum(steps) + 1 if n <= x: return False dp = [[False] * n for _ in range(m)] dp[0][steps[0]] = True for i, step in enumerat...
s121259943
p03488
u006657459
1535684389
Python
Python (3.4.3)
py
Runtime Error
20
3188
493
s = input().split('T') x, y = map(int, input().split()) h, v = [], [] for i, si in enumerate(s): if i % 2 == 0: h.append(len(si)) else: v.append(len(si)) def search(move, goal, vertical): if vertical: goal -= move.pop(0) move.sort(reverse=True) for m in move: if go...
s324492212
p03488
u690536347
1535384166
Python
PyPy3 (2.4.0)
py
Runtime Error
2107
57688
690
*s,=map(len,input().split("T")) n=len(s) ix,iy=map(int,input().split()) state=[(0,1),(1,0),(-1,0),(0,-1)] def chk(x,y,turn,pos): if pos<n: tx,ty=turn nx,ny=x+tx*s[pos],y+ty*s[pos] if turn==(1,0) or turn==(-1,0): a=chk(nx,ny,(0,1),pos+1) b=chk(nx,ny,(0,-1),pos+1) ...
s312430290
p03488
u333945892
1534637964
Python
Python (3.4.3)
py
Runtime Error
1304
4332
1177
from collections import defaultdict,deque import sys,heapq,bisect,math,itertools,string,queue,datetime sys.setrecursionlimit(10**8) INF = float('inf') mod = 10**9+7 eps = 10**-7 def inpl(): return list(map(int, input().split())) def inpl_s(): return list(input().split()) S = input() Xans,Yans = inpl() Xmove = [] Ymov...
s707755534
p03488
u333945892
1534637395
Python
Python (3.4.3)
py
Runtime Error
1317
4328
1011
from collections import defaultdict,deque import sys,heapq,bisect,math,itertools,string,queue,datetime sys.setrecursionlimit(10**8) INF = float('inf') mod = 10**9+7 eps = 10**-7 def inpl(): return list(map(int, input().split())) def inpl_s(): return list(input().split()) S = input() Xans,Yans = inpl() Xmove = [] Ymov...
s718542673
p03488
u729707098
1533860797
Python
Python (3.4.3)
py
Runtime Error
2120
271812
695
s = input() x,y = (int(i) for i in input().split()) f,l,dx,now,num = s.count("T"),len(s),True,0,0 ax = [[0 for i in range((l-f)*2+1)] for i in range((f+2)//2+1)] ay = [[0 for i in range((l-f)*2+1)] for i in range(f//2+1)] ax[0][l-f],ay[0][l-f],s = 1,1,s+"T" for i in range(l+1): if s[i]=="F": num+=1 elif dx: for j i...
s544171897
p03488
u334712262
1532317341
Python
Python (3.4.3)
py
Runtime Error
2110
127776
1728
# -*- coding: utf-8 -*- import bisect import heapq import math import random import sys from collections import Counter, defaultdict from decimal import ROUND_CEILING, ROUND_HALF_UP, Decimal from functools import lru_cache, reduce from itertools import combinations, combinations_with_replacement, product, permutations ...
s469117629
p03488
u145035045
1531780893
Python
Python (3.4.3)
py
Runtime Error
1050
3192
1465
def main(): s = input() x, y = map(int, input().split()) lens = len(s) ind = 0 if "T" in s: ind = s.index("T") x -= ind else: ind = lens x -= lens x_lst = [] y_lst = [] direct = 0 while ind < lens: acc = 0 if s[ind] == "F": while ind < lens and s[ind] == "F": in...
s416097558
p03488
u162660367
1528379494
Python
Python (3.4.3)
py
Runtime Error
2117
339296
572
s=input().strip() x,y=map(int,input().split()) sl=[len(i) for i in s.split('T')] x0,y0=sl[0],0 answers={} def search(xx,yy,k,isUD): if (xx,yy,k) in answers: return answers[(xx,yy,k)] if k == len(sl): ans=(xx,yy)==(x,y) else: lng=sl[k] # D or L llr=(lng if not isUD el...
s565255275
p03488
u811202694
1525381356
Python
Python (3.4.3)
py
Runtime Error
2109
40100
572
import numpy as np s = input().split("T") x, y = ([int(i) for i in input().split()]) movex = [] movey = [] for i, t in enumerate(s): if i % 2 == 0: movex.append(len(t)) else: movey.append(len(t)) def t_dfs(move, target, now): #print(move, target, now) if len(move) == 0: if ta...
s129680817
p03488
u329865314
1524343081
Python
Python (3.4.3)
py
Runtime Error
2108
4108
772
s = input() tmp = list(map(int, input().split())) x,y = tmp[0],tmp[1] xy = [[],[]] j = 0 k = 0 for i in s: if i == "F": j += 1 else: xy[k].append(j) j = 0 k = (k + 1) % 2 if j != 0: xy[k].append(j) if s[0] == "F": x -= xy[0][0] del xy[0][0] sumx = sum(xy[0]) - x sumy ...
s605118825
p03488
u329865314
1524342370
Python
Python (3.4.3)
py
Runtime Error
2104
4080
877
s = input() tmp = list(map(int, input().split())) x,y = tmp[0],tmp[1] xy = [[],[]] j = 0 k = 0 for i in s: if i == "F": j += 1 else: xy[k].append(j) j = 0 k = (k + 1) % 2 if j != 0: xy[k].append(j) if s[0] == "F": x -= xy[0][0] del xy[0][0] sumx = sum(xy[0]) - x sumy ...
s543684913
p03488
u075012704
1524238151
Python
Python (3.4.3)
py
Runtime Error
2112
66164
1327
S = input() N = len(S) S = list(S.split("T")) x, y = map(int, input().split()) X_command = sorted([len(i) for i in S[::2]], reverse=True) Y_command = sorted([len(i) for i in S[1::2]], reverse=True) dp_x = [[False] * (sum(X_command)+1) for i in range(len(X_command))] dp_y = [[False] * (sum(Y_command)+1) for i in range...
s773484114
p03488
u075012704
1524237020
Python
Python (3.4.3)
py
Runtime Error
2176
1006452
1165
S = input() N = len(S) S = list(S.split("T")) x, y = map(int, input().split()) X_command = sorted([len(i) for i in S[::2]], reverse=True) Y_command = sorted([len(i) for i in S[1::2]], reverse=True) dp_x = [[False] * N for i in range(N)] dp_y = [[False] * N for i in range(N)] if X_command: dp_x[0][X_command[0]] =...
s308724690
p03488
u061732150
1522729697
Python
Python (3.4.3)
py
Runtime Error
32
3316
1249
from collections import deque def Move(xy_old): xy = xy_old vec = xy[2:4] if vec == [1, 0]: xy[0] += 1 elif vec == [-1, 0]: xy[0] -= 1 elif vec == [0, 1]: xy[1] += 1 elif vec == [0, -1]: xy[1] -= 1 xy[4] += 1 return xy def main(): s = input() x,y = map(int, input(...
s602834031
p03488
u669844881
1522526264
Python
Python (3.4.3)
py
Runtime Error
2112
131956
1607
# coding: utf-8 # Your code here! def possible(goal, move): if len(move) == 0: if goal == 0: return True else: return False sumup = sum(move) if (sumup+goal)%2 == 1: return False dp = [[False for j in range((goal+sumup)+1)] for i in rang...
s719510088
p03488
u669844881
1522525826
Python
Python (3.4.3)
py
Runtime Error
17
3064
1630
# coding: utf-8 # Your code here! def possible(goal, move): if len(move) == 0: if goal == 0: return True else: return False sumup = sum(move) if (sumup+goal)%2 == 1: return False dp = [[False for j in range((goal+sumup)+1)] for i in rang...
s556626152
p03488
u669844881
1522525529
Python
Python (3.4.3)
py
Runtime Error
2112
131956
1640
# coding: utf-8 # Your code here! def possible(goal, move): if len(move) == 0: if goal == 0: return True else: return False sumup = sum(move) if (sumup+goal)%2 == 1: return False dp = [[False for j in range((goal+sumup)+1)] for i in rang...
s725339147
p03488
u669844881
1522524986
Python
Python (3.4.3)
py
Runtime Error
2108
69364
1649
# coding: utf-8 # Your code here! def possible(goal, move): if len(move) == 0: if goal == 0: return True else: return False sumup = sum(move) if (sumup+goal)%2 == 1: return False dp = [[False for j in range((goal+sumup)//2+1)] for i...
s355379678
p03488
u299801457
1522512652
Python
Python (3.4.3)
py
Runtime Error
17
2940
653
import sys sys.setrecursionlimit(100000) dir=[[1,0],[0,-1],[-1,0],[0,1]] s=input() X,Y=map(int,input().split()) log={} def walk(x,y,direction,count): if (x,y,direction,count) in log: return log[(x,y,direction,count] if count==len(s): if x==X and y==Y: return True else: return False if s[count]=="F": ...
s938323663
p03488
u299801457
1522512584
Python
Python (3.4.3)
py
Runtime Error
17
2940
611
dir=[[1,0],[0,-1],[-1,0],[0,1]] s=input() X,Y=map(int,input().split()) log={} def walk(x,y,direction,count): if (x,y,direction,count) in log: return log[(x,y,direction,count] if count==len(s): if x==X and y==Y: return True else: return False if s[count]=="F": log[(x,y,direction,count)]=walk(d+dir[dir...
s922170316
p03488
u299801457
1522512254
Python
Python (3.4.3)
py
Runtime Error
76
3992
420
dir=[[1,0],[0,-1],[-1,0],[0,1]] s=input() X,Y=map(int,input().split()) def walk(x,y,direction,count): if count==len(s): if x==X and y==Y: return True else: return False if s[count]=="F": return walk(x+dir[direction][0],y+dir[direction][1],direction,count+1) else: return walk(x,y,(direction+1)%4,count...
s732096705
p03488
u222841610
1519536005
Python
Python (3.4.3)
py
Runtime Error
2104
4048
1550
s = input() x,y = map(int,input().split()) lr_check = True ud_count = [] lr_count = [] F_count = 0 def dlr(i, p): global lr_count if i < 0: return 0 if i == 0: if abs(p) == abs(lr_count[0]): return 1 else: return 0 else: return dlr(i-1,p+lr_c...
s592024400
p03488
u222841610
1519535999
Python
Python (3.4.3)
py
Runtime Error
2104
4120
1550
s = input() x,y = map(int,input().split()) lr_check = True ud_count = [] lr_count = [] F_count = 0 def dlr(i, p): global lr_count if i < 0: return 0 if i == 0: if abs(p) == abs(lr_count[0]): return 1 else: return 0 else: return dlr(i-1,p+lr_c...
s762308068
p03488
u222841610
1519535205
Python
Python (3.4.3)
py
Runtime Error
2104
4048
1399
s = input() x,y = map(int,input().split()) lr_check = True ud_count = [] lr_count = [] F_count = 0 def dlr(i, p): global lr_count if i < 0: return 0 if i == 0: if p == lr_count[0]: return 1 else: return 0 else: return dlr(i-1,p+lr_count[i]) + dlr(...
s209566629
p03488
u222841610
1519534653
Python
Python (3.4.3)
py
Runtime Error
2104
4044
1408
s = input() x,y = map(int,input().split()) lr_check = True ud_count = [] lr_count = [] F_count = 0 def dlr(i, p): global lr_count if i < 0: return 0 if i == 0: if p == lr_count[0]: return 1 else: return 0 else: return dlr(i-1,p+lr_count[i-1]) + dl...
s452137356
p03488
u222841610
1519533425
Python
Python (3.4.3)
py
Runtime Error
2104
4132
1317
s = input() x,y = map(int,input().split()) lr_check = True ud_count = [] lr_count = [] F_count = 0 def dlr(i, p): global lr_count if i < 0: return 0 if i == 0: if p == lr_count[0]: return 1 else: return 0 else: return dlr(i-1,p+lr_count[i-1]) + dl...
s337088360
p03488
u222841610
1519532783
Python
Python (3.4.3)
py
Runtime Error
2104
4392
1363
import collections as col s = input() x,y = map(int,input().split()) col.Counter(s) lr_check = True ud_count = [] lr_count = [] F_count = 0 def dlr(i, p): global lr_count if i < 0: return 0 if i == 0: if p == lr_count[0]: return 1 else: return 0 else: ...
s858006311
p03488
u222841610
1519531739
Python
Python (3.4.3)
py
Runtime Error
2104
4420
1093
import collections as col s = input() x,y = map(int,input().split()) col.Counter(s) lr_check = True ud_count = [] lr_count = [] F_count = 0 def dlr(i, p): global lr_count if i == 0: if p == lr_count[0]: return 1 else: return 0 else: return dlr(i-1,p+lr_count[...
s069751518
p03488
u673355261
1518903991
Python
Python (3.4.3)
py
Runtime Error
2104
4032
777
#!/usr/bin/env python # -*- coding: utf-8 -*- s = input() x, y = list(map(int, input().split())) F_list = s.split('T') def DP(i, move): if i < 0: if move == 0: return True else: return False elif i == 0: if move == F_list[0]: return True else...
s931669629
p03488
u673355261
1518903398
Python
Python (3.4.3)
py
Runtime Error
2104
4072
676
#!/usr/bin/env python # -*- coding: utf-8 -*- s = input() x, y = list(map(int, input().split())) F_list = s.split('T') def DP(i, move): if i == 0: if move == F_list[0]: return True else: return False elif i == 1: if abs(move) == F_list[1]: return Tru...
s786205335
p03488
u673355261
1518901420
Python
Python (3.4.3)
py
Runtime Error
2104
4188
664
#!/usr/bin/env python # -*- coding: utf-8 -*- s = input() x, y = list(map(int, input().split())) s_list = s.split('T') x_mv = [] y_mv = [] def DP(i, move, mv_list): if i == 0: if move == mv_list[0]: return True else: return False return DP(i-1, move-mv_list[i], mv_list)...
s596651425
p03488
u255280439
1518668533
Python
Python (3.4.3)
py
Runtime Error
85
11412
612
import sys UP = 0 RIGHT = 1 DOWN = 2 LEFT = 3 dx = [0, 1, 0, -1] dy = [-1, 0, 1, 0] x_dst = None y_dst = None def dfs(x, y, d, S): if len(S) == 0: if x == x_dst and y == y_dst: print("Yes") sys.exit() else: return if S[0] == "F": dfs(x+dx[d...
s469469267
p03488
u391475811
1518575073
Python
Python (3.4.3)
py
Runtime Error
1058
181052
900
import sys def check_ans(s,x): if len(s)==0 and x!=0: return False elif len(s)==0 and x==0: return True a=len(s)+1 dp=[[False for i in range(8001)] for j in range(len(s)+1)] dp[1][s[0]]=True for i in range(1,len(s)): for j in range(0,8002): if dp[i][j]: res=abs(j+s[i]) res...
s725764773
p03488
u391475811
1518573959
Python
Python (3.4.3)
py
Runtime Error
26
3192
836
import sys def check_ans(s,x): if len(s)==0 and x!=0: return False elif len(s)==0 and x==0: return True dp=[[False] * 8001] *(len(s)+1) dp[1][s[0]]=True for i in range(1,len(s)): for j in range(0,8002): if dp[i][j]: res=abs(j+s[i]) res2=abs(j-s[i]) dp[i+1][res]=True ...
s060519285
p03488
u391475811
1518573483
Python
Python (3.4.3)
py
Runtime Error
26
3316
750
import sys def check_ans(s,x): if len(s)==0 and x!=0: return False elif len(s)==0 and x==0: return True dp=[[False] * 8001] *(len(s)+1) dp[1][s[0]]=True for i in range(1,len(s)): for j in range(0,8002): if dp[i][j]: res=abs(j+s[i]) res2=abs(j-s[i]) dp[i+1][res]=True ...
s110201800
p03488
u391475811
1518559763
Python
Python (3.4.3)
py
Runtime Error
2104
3188
578
import sys def check_ans(s,x): for i in range(0,2**len(s)): ans=0 for j in range(len(s)): if (i>>j)%2: ans+=s[j] else: ans-=s[j] if ans==x: return True return False S = sys.stdin.readline().strip() X,Y=map(int,input().split()) d=1 while S[0]=='F': S=S[1:] X-=1 nx=...
s049891348
p03488
u391475811
1518555113
Python
Python (3.4.3)
py
Runtime Error
2104
3064
569
def check_ans(s,x): for i in range(0,2**len(s)): ans=0 for j in range(len(s)): if (i>>j)%2: ans+=s[j] else: ans-=s[j] if ans==x: return True return False S=input() X,Y=map(int,input().split()) d=1 while S[0]=='F': S=S[1:] X-=1 nx=[] ny=[] while S: step=0 while...
s700958363
p03488
u391475811
1518554261
Python
Python (3.4.3)
py
Runtime Error
2104
3064
601
def check_ans(s,x): res=sum(s) if res<x: return False for i in range(0,2**len(s)): ans=res for j in range(len(s)): if (i>>j)%2: ans-=s[j] if ans==x: return True return False S=input() X,Y=map(int,input().split()) d=1 while S[0]=='F': S=S[1:] X-=1 nx=[] ny=[] X=abs(X) Y=a...
s483540761
p03488
u812028791
1517904526
Python
Python (2.7.6)
py
Runtime Error
2109
20528
1048
# -*- coding: utf-8 -*- import sys import numpy as np sys.setrecursionlimit(8002) def reachable(cp, cv, tp, rl, s, i, l): # print i, cp, cv if (i > l): if np.array_equal(cp, tp): return True else: return False cmd = s[i] if cmd == 'F': return reachable(c...
s433647906
p03488
u343675824
1517781888
Python
PyPy3 (2.4.0)
py
Runtime Error
2112
136344
845
s = input() x, y = map(int, input().split()) hL = len(s) L = 2 * hL dp = [[False] * L for i in range(2)] def next(i): global s while i < hL and s[i] != 'T': i += 1 i += 1 # print('i: %d' % i) return i def c(x): global hL return x + hL index = 0 t = 0 dp[0][c(0)] = True dp[1][c(0)...
s703239756
p03488
u562016607
1517409502
Python
PyPy3 (2.4.0)
py
Runtime Error
1626
308488
1011
st = input().split("T") x, y = map(int, input().split()) XL = []; YL = []; T = 10 for i in range(len(st)): if i % 2 == 0: XL.append(len(st[i])) else: YL.append(len(st[i])) T += len(st[i]) xx = [[False for j in range(2*T+1)] for i in range(len(XL)+1)] yy = [[False for j in range(2*T+1)] for ...
s386589969
p03488
u562016607
1517409395
Python
PyPy3 (2.4.0)
py
Runtime Error
1631
309128
1010
st = input().split("T") x, y = map(int, input().split()) XL = []; YL = []; T = 3 for i in range(len(st)): if i % 2 == 0: XL.append(len(st[i])) else: YL.append(len(st[i])) T += len(st[i]) xx = [[False for j in range(2*T+1)] for i in range(len(XL)+1)] yy = [[False for j in range(2*T+1)] for i...
s673842907
p03488
u562016607
1517409222
Python
PyPy3 (2.4.0)
py
Runtime Error
1622
308616
1016
st = input().split("T") x, y = map(int, input().split()) XL = []; YL = []; T = 0 for i in range(len(st)): if i % 2 == 0: XL.append(len(st[i])) else: YL.append(len(st[i])) T += len(st[i]) T += 2 xx = [[False for j in range(2*T+1)] for i in range(len(XL)+1)] yy = [[False for j in range(2*T+1)]...
s910778172
p03488
u562016607
1517408986
Python
PyPy3 (2.4.0)
py
Runtime Error
1641
308616
1010
st = input().split("T") x, y = map(int, input().split()) XL = []; YL = []; T = 0 for i in range(len(st)): if i % 2 == 0: XL.append(len(st[i])) else: YL.append(len(st[i])) T += len(st[i]) xx = [[False for j in range(2*T+1)] for i in range(len(XL)+1)] yy = [[False for j in range(2*T+1)] for i...
s004207908
p03488
u923285281
1517171050
Python
Python (3.4.3)
py
Runtime Error
19
3188
585
s = input() F_cnt = [len(f) for f in s.split('T')] x, y = map(int, input().split()) x_all = y_all = {0} for i in range(len(F_cnt)): x_posi = x_nega = y_posi = y_nega = set() if i == 0: x_posi = {n + F_cnt[i] for n in x_all} elif i % 2 == 0: for n in x_all: x_posi = n + F_cnt[i]...
s792016725
p03488
u764600134
1517108497
Python
Python (3.4.3)
py
Runtime Error
1048
3700
1503
# -*- coding: utf-8 -*- """ https://beta.atcoder.jp/contests/abc082/tasks/arc087_b """ import sys from sys import stdin input = stdin.readline def check_x(forwards): n = sum(forwards[::2]) # x軸方向への最大移動量 dpx = [False] * (n * 2 + 1) # 真ん中を0として、±両方向のdp領域を確保 dpx[forwards[0] + n] = True # 最初は0からプラス方向に...
s952585714
p03488
u764600134
1517106746
Python
Python (3.4.3)
py
Runtime Error
1130
3956
9412
# -*- coding: utf-8 -*- """ https://beta.atcoder.jp/contests/abc082/tasks/arc087_b """ import sys from sys import stdin from collections import deque input = stdin.readline def check_x(forwards): n = sum(forwards[::2]) dpx = [False] * (n * 2 + 1) dpx[forwards[0] + n] = True for f in forwards[2::2]: ...
s672571088
p03488
u808427016
1515542865
Python
Python (3.4.3)
py
Runtime Error
2111
152608
1034
import sys def check(s, x, y): while s and s[0] == "F": s = s[1:] x -= 1 while s and s[-1] == "T": s = s[:-1] d = 0 vxs = [] vys = [] while s: while s and s[0] == "T": s = s[1:] d ^= 1 l = 0 while s and s[0] == "F": ...
s664072668
p03488
u590211278
1514679262
Python
Python (3.4.3)
py
Runtime Error
1851
3944
714
import math s=list(input().split('T')) sn=[] for i in range(len(s)): sn.append(len(s[i])) x, y = map(int,input().split(' ')) x = x-sn[0] snx=[] sny=[] for i in range(2,len(sn),2): snx.append(sn[i]) for i in range(1,len(sn),2): sny.append(sn[i]) #X軸判定 xflg = 0 ansx=[] prex=[0] for i in range(len(snx))...
s697245353
p03488
u590211278
1514679165
Python
Python (3.4.3)
py
Runtime Error
1731
3692
714
import math s=list(input().split('T')) sn=[] for i in range(len(s)): sn.append(len(s[i])) x, y = map(int,input().split(' ')) x = x-sn[0] snx=[] sny=[] for i in range(2,len(sn),2): snx.append(sn[i]) for i in range(1,len(sn),2): sny.append(sn[i]) #X軸判定 xflg = 0 ansx=[] prex=[0] for i in range(len(snx))...
s492718052
p03488
u046187684
1514673452
Python
Python (3.4.3)
py
Runtime Error
2104
31244
714
#!/usr/bin/env python3 # coding=utf-8 import sys def become_a(a, start, numbers): if numbers is None: return a == start if len(numbers) == 1: return a == start + numbers[0] or a == start - numbers[0] return become_a(a, start + numbers[0], numbers[1:]) or become_a(a, start - numbers[0], ...
s153811986
p03488
u046187684
1514671380
Python
Python (3.4.3)
py
Runtime Error
420
73964
808
#!/usr/bin/env python3 # coding=utf-8 import sys import numpy as np def culc_pos(x, y, commands, pos=np.matrix([0, 0]), d=np.matrix([1, 0])): if len(commands) == 1: if not commands[0]: pos = pos + d return pos[0, 0] == x and pos[0, 1] == y if commands[0]: ccw = np.matrix([...
s413474140
p03488
u046187684
1514670930
Python
Python (3.4.3)
py
Runtime Error
421
73040
873
#!/usr/bin/env python3 # coding=utf-8 import sys import numpy as np def culc_pos(x, y, commands, pos=np.matrix([0, 0]), d=np.matrix([1, 0])): if len(commands) == 1: if commands[0]: return pos[0, 0] == x and pos[0, 1] == y else: pos = pos + d return pos[0, 0] ==...
s671257180
p03488
u875021335
1514506995
Python
Python (3.4.3)
py
Runtime Error
2104
31168
494
# -*- coding: utf-8 -*- import sys s = list(map(len,input().split('T'))) x,y = list(map(int, input().split())) x_steps = s[2::2] y_steps = s[1::2] x_steps.append(x-s[0]) y_steps.append(y) #あとは、それぞれの和で0になる組み合わせを探すだけ def rec(l,x): if l: return rec(l[1:],x+l[0]) or rec(l[1:],x-l[0]) elif x == 0: r...
s985844570
p03488
u463059138
1514458630
Python
Python (3.4.3)
py
Runtime Error
83
4184
1225
s = input() list_s = list(s) l= input().split() x = int(l[0]) y = int(l[1]) yes = False def run(currentX, currentY, directionX, directionY, num, list_s): global yes if list_s[num] == "F": num += 1 if directionX == 1: currentX += 1 elif directionX == -1: ...
s169777359
p03488
u226155577
1514105172
Python
Python (3.4.3)
py
Runtime Error
22
3188
181
z,*s=map(len,input().split('T'));l=sum(s);Y=1<<l;X=Y<<z for t,u in zip(s[::2],s[1::2]+[0]):Y=Y>>t|Y<<t;X=X>>u|X<<u x,y=map(int,input().split());print("Yes"*(X>>l+x&Y>>l+y&1)or"No")
s066741292
p03488
u226155577
1514104753
Python
Python (3.4.3)
py
Runtime Error
22
3188
183
z,*s=map(len,input().split('T')+['']);l=sum(s,0);Y=1<<l;X=Y<<z for t,u in zip(s[::2],s[1::2]):Y=Y>>t|Y<<t;X=X>>u|X<<u x,y=map(int,input().split());print("Yes"*(X>>l+x&Y>>l+y&1)or"No")
s329460549
p03488
u226155577
1514104018
Python
Python (3.4.3)
py
Runtime Error
22
3188
182
z,*s,=map(len,input().split('T')+['']);l=sum(s);Y=1<<l;X=Y<<z for t,u in zip(s[::2],s[1::2]):Y=Y>>t|Y<<t;X=X>>u|X<<u x,y=map(int,input().split());print("Yes"*(X>>l+x&Y>>l+y&1)or"No")
s988294404
p03488
u799613351
1514074893
Python
Python (3.4.3)
py
Runtime Error
2104
4368
975
s = input() x, y = map(int, input().split()) def part_sum0(integer_list, target_sum, i=0, sum_=0): if i == len(integer_list): return sum_ == target_sum if (part_sum0(integer_list, target_sum, i + 1, sum_)): return True if (part_sum0(integer_list, target_sum, i + 1, sum_ + integer_list[i])...
s309509090
p03488
u545503667
1514068274
Python
Python (3.4.3)
py
Runtime Error
2105
17932
1164
s = input().strip() goal = tuple(map(int, input().split())) def change_dir(direc, case): if case == 0: direc += 1 if direc == 5: direc = 1 else: direc -= 1 if direc == 0: direc = 4 return direc def go_in_dir(direc, pos): if direc == 1: re...
s876142634
p03488
u854165521
1513910227
Python
Python (3.4.3)
py
Runtime Error
2104
4156
1301
# -*- coding: utf-8 -*- cmd = list(input()) end = tuple(map(int, input().split())) count = 0 while len(cmd) > 0: if cmd[0] == "F": count += 1 cmd.pop(0) else: break start = (0 + count, 0) listX = [] listY = [] flag = False if len(cmd) > 0: cmd.pop(0) count = 0 for c in cmd: ...
s258292525
p03488
u854165521
1513895979
Python
Python (3.4.3)
py
Runtime Error
2108
4272
933
# -*- coding: utf-8 -*- cmd = list(input()) end = tuple(map(int, input().split())) count = 0 while len(cmd) > 0: if cmd[0] == "F": count += 1 cmd.pop(0) else: break start = (0 + count, 0) list = [] if len(cmd) > 0: cmd.pop(0) count = 0 for c in cmd: if c == "F": coun...
s255478255
p03488
u854165521
1513895100
Python
Python (3.4.3)
py
Runtime Error
2104
4240
933
# -*- coding: utf-8 -*- cmd = list(input()) end = tuple(map(int, input().split())) count = 0 while len(cmd) > 0: if cmd[0] == "F": count += 1 cmd.pop(0) else: break start = (0 + count, 0) list = [] if len(cmd) > 0: cmd.pop(0) count = 0 for c in cmd: if c == "F": coun...
s975330167
p03488
u875291233
1513889865
Python
Python (3.4.3)
py
Runtime Error
2120
263896
1286
s=input() x,y = [int(i) for i in input().split()] #print(s) susumu = [0] for i in range(len(s)): if s[i] == 'F': susumu[-1] += 1 else: susumu.append(0) #print(susumu) syokiti = susumu.pop(0) susumu_NS = [i for i in susumu[::2] if i != 0] susumu_EW = [i for i in susumu[1::2] if i != 0] x -=...
s672285489
p03488
u875291233
1513889714
Python
Python (3.4.3)
py
Runtime Error
17
2940
642
Beta paiza.IO 新規コード 一覧 ウェブ開発 New! 日本語 サインアップ ログイン Python3 Split Button! Enter a title here Main.py Success 

 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 s=input() x,y = [int(i) for i in input().split()] #print(s) susumu = [0] for i in range(len(s)): if s[i] == 'F': susumu[-1] += 1 els...
s451142587
p03488
u425177436
1513869513
Python
Python (3.4.3)
py
Runtime Error
2110
156300
308
s=list(map(len,input().split("T"))) x,y=map(int,input().split()) def f(i,w): if i==0: return w==0 if (i,w) not in m: m[(i,w)]=f(i-1,w-t[i-1]) or f(i-1,w+t[i-1]) return m[(i,w)] m={} t=sorted(s[2::2]) a=f(len(t),x-s[0]) m={} t=sorted(s[1::2]) print(["No","Yes"][a and f(len(t),y)])
s097876988
p03488
u425177436
1513868464
Python
Python (3.4.3)
py
Runtime Error
2104
4116
259
s=list(map(len,input().split("T"))) x,y=map(int,input().split()) def f(t,i,w): if i==0: return w==0 return f(t,i-1,w-t[i-1]) or f(t,i-1,w+t[i-1]) print(["No","Yes"][f(sorted(s[2::2]),len(s[2::2]),x-s[0]) and f(sorted(s[1::2]),len(s[1::2]),y)])
s287624563
p03488
u814166125
1513786495
Python
Python (3.4.3)
py
Runtime Error
2109
68340
849
# -*- coding: utf-8 -*- """ Created on Tue Dec 19 16:31:02 2017 @author: kotania """ import sys sys.setrecursionlimit(10000) # 判定関数 def judge(target, nlist) : size = len(nlist) if size == 1 : if target == nlist[0] or target == - nlist[0]: return True else : ...
s413303043
p03488
u502314533
1513747397
Python
Python (3.4.3)
py
Runtime Error
81
4432
676
instructions = input() x,y = map(int,input().split()) def recurse(ex,ey,instructions,index=0,x=0,y=0,direction=0): if x == ex and y == ey and index >= len(instructions): return True elif index >= len(instructions): return False directionsx = [1,0,-1,0] directionsy = [0,1,0,-1] if in...
s263077970
p03488
u814166125
1513732427
Python
Python (3.4.3)
py
Runtime Error
2107
70264
1282
# -*- coding: utf-8 -*- """ Created on Tue Dec 19 16:31:02 2017 @author: kotania """ import sys sys.setrecursionlimit(10000) # 判定関数 def judge(target, nlist) : size = len(nlist) if size == 1 : if target == nlist[0] or target == - nlist[0]: return True else : ...
s932601687
p03488
u814166125
1513729710
Python
Python (3.4.3)
py
Runtime Error
2104
31200
1242
# -*- coding: utf-8 -*- """ Created on Tue Dec 19 16:31:02 2017 @author: kotania """ # 判定関数 def judge(target, nlist) : size = len(nlist) if size == 1 : if target == nlist[0] or target == - nlist[0]: return True else : return False else : ...
s413888112
p03488
u225528554
1513724702
Python
Python (3.4.3)
py
Runtime Error
82
4180
1008
def main(): position = [0,0] count = 0 global list list = [] if (S.count('F')-abs(x)-abs(y)) < 0: print("No") exit() findPath(count,position,[1,0]) if [x,y] in list: print("Yes") else: print("No") def findPath(index,position,dic_vector): if len(S) ==...
s815211985
p03488
u225528554
1513724214
Python
Python (3.4.3)
py
Runtime Error
82
4168
845
def main(): position = [0,0] count = 0 if (S.count('F')-abs(x)-abs(y)) < 0: print("No") exit() findPath(count,position,[1,0]) print("No") def findPath(index,position,dic_vector): if len(S) == index: if [x,y] == position: print("Yes") exit() ...
s152873933
p03488
u225528554
1513723913
Python
Python (3.4.3)
py
Runtime Error
81
4132
914
def main(): position = [0,0] count = 0 x_path = abs(target[0]) y_path = abs(target[1]) if (S.count('F')-x_path-y_path) < 0: print("No") exit() findPath(count,position,[1,0]) print("No") def findPath(index,position,dic_vector): if len(S) == index: if target == po...
s521350709
p03488
u225528554
1513723621
Python
Python (3.4.3)
py
Runtime Error
79
4196
780
import sys def main(): position = [0,0] count = 0 findPath(count,position,[1,0]) print("No") def findPath(index,position,dic_vector): if len(S) == index: if target == position: print("Yes") sys.exit() return if S[index] == 'F': position = [posit...
s006341927
p03488
u225528554
1513723394
Python
Python (3.4.3)
py
Runtime Error
79
4200
805
def main(): position = [0,0] count = 0 findPath(count,position,[1,0]) print("No") def findPath(index,position,dic_vector): if len(S) == index: if target == position: print("Yes") exit() return if S[index] == 'F': position = [position[0]+dic_...
s280995318
p03488
u225528554
1513723219
Python
Python (3.4.3)
py
Runtime Error
78
4152
872
def main(): position = [0,0] count = 0 findPath(count,position,[1,0]) if flag: print("Yes") else: print("No") def findPath(index,position,dic_vector): if len(S) == index: if target == position: global flag flag = True return if S[inde...
s303975809
p03488
u225528554
1513722664
Python
Python (3.4.3)
py
Runtime Error
79
4192
817
flag = False def main(): position = [0,0] count = 0 findPath(count,position,[1,0]) print("No") def findPath(index,position,dic_vector): if len(S) == index: if target == position: print("Yes") exit() return if S[index] == 'F': position = [pos...