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
s446725375
p03488
u225528554
1513721999
Python
Python (3.4.3)
py
Runtime Error
84
4144
953
def main(): position = [0,0] x_path = abs(target[0]) y_path = abs(target[1]) if (S.count('F')-x_path-y_path) < 0: print("No") quit() count = 0 findPath(count,position,[1,0]) print("No") def findPath(index,position,dic_vector): if len(S) == index: if target == po...
s588577296
p03488
u636684559
1513721275
Python
Python (3.4.3)
py
Runtime Error
81
13292
586
def move(key,gx,gy,x,y,mx,my): if key[0]=='F': return move(key[1::],gx,gy,x+mx,y+my,mx,my) elif key[0]=='T': if mx==0: return move(key[1::],gx,gy,x,y,1,0) return move(key[1::],gx,gy,x,y,-1,0) else: return move(key[1::],gx,gy,x,y,0,1) return...
s865019984
p03488
u225528554
1513720776
Python
Python (3.4.3)
py
Runtime Error
223
4468
1008
def main(): position = [0,0] x_path = abs(target[0]) y_path = abs(target[1]) if (S.count('F')-x_path-y_path) < 0: print("No") exit() count = 0 findPath(count,position,[1,0]) print("No") def findPath(index,position,dic_vector): if len(S) == index: if target == po...
s016278010
p03488
u225528554
1513720582
Python
Python (3.4.3)
py
Runtime Error
81
4128
967
def main(): position = [0,0] x_path = abs(target[0]) y_path = abs(target[1]) if (S.count('F')-x_path-y_path)<0: print("No") exit() count = 0 try: findPath(count,position,[1,0]) except Exception: raise Exception print("No") def findPath(index,position,dic...
s332133223
p03488
u225528554
1513720129
Python
Python (3.4.3)
py
Runtime Error
80
4204
914
def main(): position = [0,0] x_path = abs(target[0]) y_path = abs(target[1]) if (S.count('F')-x_path-y_path)<0: print("No") exit() count = 0 findPath(count,position,[1,0]) print("No") def findPath(index,position,dic_vector): if len(S) == index: if target == posi...
s405244496
p03488
u225528554
1513719667
Python
Python (3.4.3)
py
Runtime Error
81
4128
1080
def main(): dic_vector = [1,0] position = [0,0] x_path = abs(target[0]) y_path = abs(target[1]) if (S.count('F')-x_path-y_path)<0: print("No") exit() count = 0 findPath(count,position,dic_vector) print("No") def findPath(index,position,dic_vector): if len(S) == inde...
s839298744
p03488
u225528554
1513718460
Python
Python (3.4.3)
py
Runtime Error
81
4156
1038
def main(): dic_vector = [1,0] position = [0,0] x_path = abs(target[0]) y_path = abs(target[1]) if (S.count('F')-x_path-y_path)<0: print("No") exit() count = 0 findPath(count,position,dic_vector) print("No") def findPath(index,position,dic_vector): if len(S) == inde...
s722073154
p03488
u225528554
1513718208
Python
Python (3.4.3)
py
Runtime Error
79
4128
1052
def main(): dic_vector = [1,0] position = [0,0] x_path = abs(target[0]) y_path = abs(target[1]) if (S.count('F')-x_path-y_path)<0: print("No") exit() count = 0 findPath(count,S,position,dic_vector) print("No") def findPath(index,S,position,dic_vector): if len(S) == ...
s202349541
p03488
u909643606
1513664519
Python
Python (3.4.3)
py
Runtime Error
2108
71540
1598
s=input() x,y=[int(i) for i in input().split()] count=0 x_v=[] y_v=[] dir=1 for i in range(len(s)): if s[i]=="F": count=count+1 else: if dir==1: if count!=0: x_v.append(count) dir=0 count=0 else: if count!=0: ...
s018627512
p03488
u909643606
1513664388
Python
Python (3.4.3)
py
Runtime Error
2110
69492
1591
s=input() x,y=[int(i) for i in input().split()] count=0 x_v=[] y_v=[] dir=1 for i in range(len(s)): if s[i]=="F": count=count+1 else: if dir==1: if count!=0: x_v.append(count) dir=0 count=0 else: if count!=0: ...
s350728707
p03488
u909643606
1513663767
Python
Python (3.4.3)
py
Runtime Error
18
3188
987
number_x=sum(x_v) x_check=0 dp_x=[[0 for i in range(number_x+1)] for j in range(len(x_v))] if sum(x_v)!=0: dp_x[0][0]=1 for i in range(len(x_v)-1): for j in range(number_x+1): if dp_x[i][j]==1: dp_x[i+1][j+x_v[i+1]], dp_x[i+1][abs(j-x_v[i+1])]=1,1 if sum(x_v)!=0 and sum(x_v)>=abs(x) and...
s031888614
p03488
u909643606
1513662846
Python
Python (3.4.3)
py
Runtime Error
2107
71412
1474
s=input() x,y=[int(i) for i in input().split()] count=0 x_v=[] y_v=[] dir=1 for i in range(len(s)): if s[i]=="F": count=count+1 else: if dir==1: if count!=0: x_v.append(count) dir=0 count=0 else: if count!=0: ...
s798041310
p03488
u909643606
1513651033
Python
Python (3.4.3)
py
Runtime Error
2108
69492
1497
s=input() x,y=[int(i) for i in input().split()] count=0 x_v=[] y_v=[] dir=1 for i in range(len(s)): if s[i]=="F": count=count+1 else: if dir==1: if count!=0: x_v.append(count) dir=0 count=0 else: if count!=0: ...
s975022503
p03488
u209594105
1513634542
Python
Python (3.4.3)
py
Runtime Error
1925
3924
638
order = input() pos = input() x = pos.split()[0] y = pos.split()[1] dir = 0 # yoko count = [[], []] tmp = 0 for com in order: if com == "F": tmp += 1 else: if tmp != 0: count[dir].append(tmp) dir = abs(dir - 1) tmp = 0 if tmp != 0: count[dir].append(tmp) first = ...
s874277753
p03488
u209594105
1513634262
Python
Python (3.4.3)
py
Runtime Error
1962
3972
678
order = input() pos = input() x = pos.split()[0] y = pos.split()[1] dir = 0 # yoko count = [[], []] tmp = 0 for com in order: if com == "F": tmp += 1 else: if tmp != 0: count[dir].append(tmp) dir = abs(dir - 1) tmp = 0 if tmp != 0: count[dir].append(tmp) print(co...
s783457287
p03488
u810625173
1513627735
Python
Python (2.7.6)
py
Runtime Error
12
2696
662
# coding:utf-8 alls = raw_input() tarx, tary = map(int, raw_input().split()) ss = alls.split("T") xs = [] ys = [] posx = set() posy = set() posy.add(0) for i, s in enumerate(ss): if i == 0: posx.add(len(s)) elif i % 2 == 0: xs....
s366341894
p03488
u909643606
1513619623
Python
Python (3.4.3)
py
Runtime Error
2108
70900
1544
s=input() x,y=[int(i) for i in input().split()] count=0 x_v=[] y_v=[] dir=1 for i in range(len(s)): if s[i]=="F": count=count+1 else: if dir==1: x_v.append(count) dir=0 count=0 else: y_v.append(count) dir=1 count=0 ...
s016640623
p03488
u909643606
1513619230
Python
Python (3.4.3)
py
Runtime Error
2108
70900
1549
s=input() x,y=[int(i) for i in input().split()] count=0 x_v=[] y_v=[] dir=1 for i in range(len(s)): if s[i]=="F": count=count+1 else: if dir==1: x_v.append(count) dir=0 count=0 else: y_v.append(count) dir=1 count=0 ...
s059372302
p03488
u909643606
1513618808
Python
Python (3.4.3)
py
Runtime Error
2108
70900
1483
s=input() x,y=[int(i) for i in input().split()] count=0 x_v=[] y_v=[] dir=1 for i in range(len(s)): if s[i]=="F": count=count+1 else: if dir==1: x_v.append(count) dir=0 count=0 else: y_v.append(count) dir=1 count=0 ...
s816284704
p03488
u909643606
1513618340
Python
Python (3.4.3)
py
Runtime Error
2108
71540
1417
s=input() x,y=[int(i) for i in input().split()] count=0 x_v=[] y_v=[] dir=1 for i in range(len(s)): if s[i]=="F": count=count+1 else: if dir==1: x_v.append(count) dir=0 count=0 else: y_v.append(count) dir=1 count=0 ...
s866128590
p03488
u909643606
1513618259
Python
Python (3.4.3)
py
Runtime Error
2108
69492
1418
s=input() x,y=[int(i) for i in input().split()] count=0 x_v=[] y_v=[] dir=1 for i in range(len(s)): if s[i]=="F": count=count+1 else: if dir==1: x_v.append(count) dir=0 count=0 else: y_v.append(count) dir=1 count=0 ...
s885044187
p03488
u909643606
1513618201
Python
Python (3.4.3)
py
Runtime Error
2108
69492
1418
s=input() x,y=[int(i) for i in input().split()] count=0 x_v=[] y_v=[] dir=1 for i in range(len(s)): if s[i]=="F": count=count+1 else: if dir==1: x_v.append(count) dir=0 count=0 else: y_v.append(count) dir=1 count=0 ...
s479813126
p03488
u909643606
1513615371
Python
Python (3.4.3)
py
Runtime Error
2108
70900
1402
s=input() x,y=[int(i) for i in input().split()] count=0 x_v=[] y_v=[] dir=1 for i in range(len(s)): if s[i]=="F": count=count+1 else: if dir==1: x_v.append(count) dir=0 count=0 else: y_v.append(count) dir=1 count=0 ...
s064992088
p03488
u909643606
1513614932
Python
Python (3.4.3)
py
Runtime Error
1700
70900
1384
s=input() x,y=[int(i) for i in input().split()] count=0 x_v=[] y_v=[] dir=1 for i in range(len(s)): if s[i]=="F": count=count+1 else: if dir==1: x_v.append(count) dir=0 count=0 else: y_v.append(count) dir=1 count=0 ...
s631126401
p03488
u909643606
1513614549
Python
Python (3.4.3)
py
Runtime Error
1649
70900
1347
s=input() x,y=[int(i) for i in input().split()] count=0 x_v=[] y_v=[] dir=1 for i in range(len(s)): if s[i]=="F": count=count+1 else: if dir==1: x_v.append(count) dir=0 count=0 else: y_v.append(count) dir=1 count=0 ...
s281844819
p03488
u909643606
1513555611
Python
Python (3.4.3)
py
Runtime Error
2112
137204
1878
s=input() x,y=[int(i) for i in input().split()] count=0 x_v=[] y_v=[] dir=1 for i in range(len(s)): if s[i]=="F": count=count+1 else: if dir==1: x_v.append(count) dir=0 count=0 else: y_v.append(count) dir=1 count=0 ...
s760543217
p03488
u909643606
1513553680
Python
Python (3.4.3)
py
Runtime Error
2112
137204
1247
s=input() x,y=[int(i) for i in input().split()] count=0 x_v=[] y_v=[] dir=1 for i in range(len(s)): if s[i]=="F": count=count+1 else: if dir==1: x_v.append(count) dir=0 count=0 else: y_v.append(count) dir=1 count=0 ...
s897094402
p03488
u909643606
1513553124
Python
Python (3.4.3)
py
Runtime Error
2120
261964
1290
s=input() x,y=[int(i) for i in input().split()] count=0 x_v=[] y_v=[] dir=1 for i in range(len(s)): if s[i]=="F": count=count+1 else: if dir==1: x_v.append(count) dir=0 count=0 else: y_v.append(count) dir=1 count=0 ...
s624633712
p03488
u909643606
1513551919
Python
Python (3.4.3)
py
Runtime Error
2120
262864
1286
s=input() x,y=[int(i) for i in input().split()] count=0 x_v=[] y_v=[] dir=1 for i in range(len(s)): if s[i]=="F": count=count+1 else: if dir==1: x_v.append(count) dir=0 count=0 else: y_v.append(count) dir=1 count=0 ...
s992064128
p03488
u909643606
1513551753
Python
Python (3.4.3)
py
Runtime Error
2115
136564
1280
s=input() x,y=[int(i) for i in input().split()] count=0 x_v=[] y_v=[] dir=1 for i in range(len(s)): if s[i]=="F": count=count+1 else: if dir==1: x_v.append(count) dir=0 count=0 else: y_v.append(count) dir=1 count=0 ...
s736914027
p03488
u909643606
1513494030
Python
Python (3.4.3)
py
Runtime Error
2116
139328
1299
s=input() x,y=[int(i) for i in input().split()] count=0 x_v=[] y_v=[] dir=1 for i in range(len(s)): if s[i]=="F": count=count+1 else: if dir==1: x_v.append(count) dir=0 count=0 else: y_v.append(count) dir=1 count=0 ...
s227493864
p03488
u909643606
1513493982
Python
Python (3.4.3)
py
Runtime Error
2112
137204
1297
s=input() x,y=[int(i) for i in input().split()] count=0 x_v=[] y_v=[] dir=1 for i in range(len(s)): if s[i]=="F": count=count+1 else: if dir==1: x_v.append(count) dir=0 count=0 else: y_v.append(count) dir=1 count=0 ...
s615908894
p03488
u909643606
1513493451
Python
Python (3.4.3)
py
Runtime Error
2112
138776
1243
s=input() x,y=[int(i) for i in input().split()] count=0 x_v=[] y_v=[] dir=1 for i in range(len(s)): if s[i]=="F": count=count+1 else: if dir==1: x_v.append(count) dir=0 count=0 else: y_v.append(count) dir=1 count=0 ...
s024802779
p03488
u909643606
1513493078
Python
Python (3.4.3)
py
Runtime Error
2112
136564
1224
s=input() x,y=[int(i) for i in input().split()] count=0 x_v=[] y_v=[] dir=1 for i in range(len(s)): if s[i]=="F": count=count+1 else: if dir==1: x_v.append(count) dir=0 count=0 else: y_v.append(count) dir=1 count=0 ...
s428544435
p03488
u657357805
1513488401
Python
Python (3.4.3)
py
Runtime Error
34
3316
1517
import sys def check(i,a): b = {} for j in a: if j == i: return True for k in b.keys(): if k+j == i: return True b[k+j]=True b[j]=True print(a) print(b) return False s = input() x,y = [int(x) for x in input().split()] xf ...
s483276522
p03488
u657357805
1513488064
Python
Python (3.4.3)
py
Runtime Error
35
3192
1474
import sys def check(i,a): b = {} for j in a: for k in b.keys(): if k+j == i: return True b[k+j]=True return False s = input() x,y = [int(x) for x in input().split()] xf = [] yf = [] now = xf t = 0 for i in s: if i == 'F': t += 1 else: ...
s511018451
p03488
u052363612
1513482575
Python
Python (3.4.3)
py
Runtime Error
225
62668
590
from operator import add debug = False if debug: s = "FTFFTFFF" x, y = [4, 2] else: s = input() x, y = list(map(int, input().split())) s = list(s) xys = [(1, 0), (0, 1), (-1, 0), (0, -1)] def search(xy, idx, s): if xy == [x, y] and len(s) == 0: return True if len(s) == 0: ret...
s225357959
p03488
u537905693
1513482391
Python
Python (3.4.3)
py
Runtime Error
2130
438132
2241
#!/usr/bin/env python # coding: utf-8 def no(): print("No") return def shift(i): return i+8001 def main(): s = input() x, y = list(map(int, input().split())) x_start = 0 x_count = 0 y_count = 0 t_count = 0 f_count = 0 x_dirs = [] y_dirs = [] is_x = True # xを向いてるか ...
s516890129
p03488
u858748695
1513481942
Python
Python (3.4.3)
py
Runtime Error
2104
3940
1483
#!/usr/bin/env python3 s = list(input()) x, y = map(int, input().split()) X = [0] * 16001 Y = [0] * 16001 X[8000] = Y[8000] = 0 isx = 1 tcnt = 0 fcnt = 0 for i in range(len(s)): if s[i] == 'T': for j in range(len(X)): if isx == 1: if tcnt == 0: X[8000 + fcnt...
s209755908
p03488
u052363612
1513481881
Python
Python (3.4.3)
py
Runtime Error
218
62732
657
from operator import add debug = False if debug: s = "FTFFTFFF" x, y = [4, 2] else: s = input() x, y = list(map(int, input().split())) s = list(s) xys = [(1, 0), (0, 1), (-1, 0), (0, -1)] def search(xy, idx, s): if xy == [x, y] and len(s) == 0: return True if len(s) == 0: ret...
s522453740
p03488
u052363612
1513481703
Python
Python (3.4.3)
py
Runtime Error
216
62756
641
from operator import add debug = False if debug: s = "FTFFTFFF" x, y = [4, 2] else: s = input() x, y = list(map(int, input().split())) s = list(s) xys = [(1, 0), (0, 1), (-1, 0), (0, -1)] def search(xy, idx, s): if xy == [x, y]: return True if len(s) == 0: return False m ...
s771055728
p03488
u657357805
1513481700
Python
Python (3.4.3)
py
Runtime Error
34
3192
1559
import sys sys.setrecursionlimit(10000) def check(i,t,a): if i == t: return True for j in range(a): if i == t+a[j]: return True elif i < t+a[j]: return False else: return check(i,t+a[j],a[:j]+a[j+1:]) return False s = input() x,y = [int(...
s767298008
p03488
u657357805
1513481472
Python
Python (3.4.3)
py
Runtime Error
34
3192
1528
import sys def check(i,t,a): if i == t: return True for j in range(a): if i == t+a[j]: return True elif i < t+a[j]: return False else: return check(i,t+a[j],a[:j]+a[j+1:]) return False s = input() x,y = [int(x) for x in input().split()] ...
s380767034
p03488
u657357805
1513481222
Python
Python (3.4.3)
py
Runtime Error
34
3192
1532
import sys def check(i,t,a): if i == t: return True for j in range(a): if i == t+a[j]: return True elif i < t+a[j]: return False else: return check(i,t+a[j],a[:j-1]+a[j+1:]) return False s = input() x,y = [int(x) for x in input().split...
s304371651
p03488
u657357805
1513480915
Python
Python (3.4.3)
py
Runtime Error
53
3316
1507
import sys def check(i,t,a): if i == t: return True for j in range(a): if i == t+a[j]: return True elif i < t+a[j]: return False else: return check(i,t+a[j],a[:j-1]+a[j+1:]) s = input() x,y = [int(x) for x in input().split()] xf = [] yf ...
s169414275
p03488
u293976191
1513480895
Python
Python (3.4.3)
py
Runtime Error
2117
244700
869
from collections import deque S = input() x, y = map(int, input().split(' ')) move = [(1, 0), (0, 1), (-1, 0), (0, -1)] direction = 0 position = set((0, 0)) state = [((0, 0), 0)] can_move = False idx = 0 for i, s in enumerate(S): rest_inst_num = len(S) - (i) next_position = set() next_state = [] for...
s558288874
p03488
u293976191
1513480800
Python
Python (3.4.3)
py
Runtime Error
20
3316
896
from collections import deque S = input() x, y = map(int, input().split(' ')) move = [(1, 0), (0, 1), (-1, 0), (0, -1)] direction = 0 position = set((0, 0)) state = [((0, 0), 0)] can_move = False idx = 0 for i, s in enumerate(S): rest_inst_num = len(S) - (i + 1) next_position = set() next_state = [] ...
s163566216
p03488
u293976191
1513480474
Python
Python (3.4.3)
py
Runtime Error
2128
396884
721
from collections import deque S = input() x, y = map(int, input().split(' ')) move = [(1, 0), (0, 1), (-1, 0), (0, -1)] direction = 0 position = set((0, 0)) state = [((0, 0), 0)] can_move = False idx = 0 for s in S: next_position = set() next_state = [] for p, d in state: if s == 'T': ...
s578875084
p03488
u456806668
1513480253
Python
Python (3.4.3)
py
Runtime Error
2107
56308
857
s=input().strip() x,y=[int(i) for i in input().split()] # print(s,x,y) F_list=s.split("T") # print(F_list) x_F_num=[] y_F_num=[] for i in range(len(F_list)): if i%2==0: x_F_num.append(len(F_list[i])) else: y_F_num.append(len(F_list[i])) # print(x_F_num,y_F_num) #x ikeru=[] next_ikeru=[] ikeru....
s403093469
p03488
u214617707
1513478915
Python
Python (3.4.3)
py
Runtime Error
152
4012
677
s = input() x, y = map(int, input().split()) dic = {"U": (1, 0), "R": (0, 1), "D": (-1, 0), "L": (0, -1)} rec = [] def dfs(x1, y1, pos, k): if k == len(s): if (x1, y1) not in rec: rec.append((x1, y1)) return else: if s[k] == "F": nx, ny = x1 + dic[pos][0], y1 + ...
s123798246
p03488
u214617707
1513478295
Python
Python (3.4.3)
py
Runtime Error
77
4068
651
s = input() x, y = map(int, input().split()) sx, sy = 0, 0 dic = {"U":(1,0), "R":(0, 1), "D":(-1,0), "L":(0, -1)} rec = [] def dfs(x1, y1, pos, k): if k == len(s): rec.append((x1, y1)) return else: if s[k] == "F": nx, ny = x1 + dic[pos][0], y1 + dic[pos][1] dfs(...
s720112472
p03488
u787679173
1513478224
Python
Python (3.4.3)
py
Runtime Error
87
13424
743
s = input() x, y = [int(x) for x in input().split()] d = ( (1, 0), (0, 1), (-1, 0), (0, -1), ) def next_dr(dr): def fix(dr): if dr == -1: return 3 if dr == 4: return 0 return dr return fix(dr - 1), fix(dr + 1) def dfs(s, a, b, dr): # print("...
s080691072
p03489
u374802266
1596231153
Python
Python (3.8.2)
py
Runtime Error
35
17148
713
s=input() x,y=map(int,input().split()) p=8010 a,b=[],0 for c in s: if c=='T': a.append(b) b=0 else: b+=1 a.append(b) x-=a.pop(0) yl,xl=a[::2],a[1::2] mx,my=[0]*(p*2),[0]*(p*2) mx[p],my[p]=1,1 for dx in xl: nx=[0]*(p*2) for i in range((p*2)): nx[i]=max(nx[i],mx[i]) ...
s329507979
p03489
u672454878
1596171512
Python
PyPy3 (7.3.0)
py
Runtime Error
161
100512
195
n = len(input()) mp, res = {}, 0 for el in list(map(int, input().split())): mp[el] = mp.get(el, 0) + 1 for key, val in mp: if key > val: res += val elif key < val: res += val - key print(res)
s401545062
p03489
u197300773
1585092848
Python
PyPy3 (2.4.0)
py
Runtime Error
195
56304
380
def f(m,l): tmpm=set() for x in m: tmpm.add(x+l);tmpm.add(x-l) return tmpm s=input()+"T" x,y=map(int,input().split()) while s and s[0]=="F": x-=1 s=s[1:] ss=[{0},{0}] mode=0 l=0 for i in range(len(s)): if s[i]=="F": l+=1 else: ss[mode]=f(ss[mode],l) mode^=1 ...
s553796704
p03489
u940061594
1573684010
Python
Python (3.4.3)
py
Runtime Error
28
11508
666
#FT Robot_2 s = input() x, y = map(int, input().split()) L = [] stack = 0 p = [0] q = [0] for i in range(len(s)): if s[i] == "F": stack = stack + 1 else: L.append(stack) stack = 0 if stack != 0: L.append(stack) for i in range(len(L)): if i == 0: p = [L[i]] elif i ...
s048159578
p03489
u077291787
1561399394
Python
Python (3.4.3)
py
Runtime Error
43
14212
409
# ARC087C - Good Sequence (ABC082C) import sys input = sys.stdin.readline def main(): n = int(input()) lst = list(map(int, input().rstrip().split())) cnt = [0] * (10 * 9 + 1) for i in lst: cnt[i] += 1 ans = 0 for i, j in enumerate(cnt): if i > j: ans += j eli...
s237041809
p03489
u131405882
1542133391
Python
Python (3.4.3)
py
Runtime Error
109
14692
310
N = int(input()) a = list(map(int, input().strip().split())) a.sort() i = 0 j = 1 ans = 0 for i in range(N-1): if a[i] == a[i+1]: j += 1 else: if j >= a[i]: ans += j - a[i] else: ans += j if a[N-1] != A[N-2]: if a[N-1] != 1: ans += 1 else: if j >= a[i]: ans += j - a[i] else: ans += j
s803713930
p03489
u015768390
1542056070
Python
Python (3.4.3)
py
Runtime Error
28
11128
134
N=int(input()) num={} for a in input().split(): num[a]+=1 ans=0 for k,v in num: if k>v: ans+=v else: ans+=v-k print(ans)
s784862990
p03489
u603234915
1539804536
Python
Python (3.4.3)
py
Runtime Error
75
14244
309
N = int(input()) l = list(map(int, input().split())) l.sort() ans = 0 j = 0 for i in unique_l: cnt = 0 while l[j] == i and j < len(l): cnt += 1 j += 1 j += 1 if cnt == i: pass elif cnt > i: ans += cnt - 1 elif cnt < i: ans += cnt print(ans)
s547837390
p03489
u603234915
1539803389
Python
Python (3.4.3)
py
Runtime Error
63
14692
314
N = int(input()) l = list(map(int, input().split())) N_MAX = int(1e+5 + 1) cnt = [0 for _ in range(N_MAX)] for i in l: cnt[i] += 1 ans = 0 for idx, val in enumerate(cnt): if val == 0 or val == idx: pass elif val < idx: ans += val elif idx < val: ans += val - idx print(ans)
s869023833
p03489
u619631862
1528573012
Python
PyPy3 (2.4.0)
py
Runtime Error
215
63984
712
def i1(): return int(input()) def i2(): return [int(i) for i in input().split()] s=input() [x,yy]=i2() t=[] y=[] k=0 for i in range(len(s)): if s[i]=="T": if len(t)==len(y): y.append(k) else: t.append(k) k=0 else: k+=1 if s[-1]=="F": if len(t)==len(y): y.append(k) ...
s369280425
p03489
u081763438
1516560522
Python
Python (3.4.3)
py
Runtime Error
43
14688
278
# coding:utf-8 x=int(input()) member=list(map(int, input().split())) table=(10**9)*[int(0)] ans=0 for i in range(x): table[member[i]] += 1 if (table[member[i]] != member[i]): ans += 1 else: ans -= (member[i]-1); print(ans) ''' # {{{ # }}} '''
s547169478
p03489
u318861481
1515822622
Python
Python (3.4.3)
py
Runtime Error
17
2940
250
length = raw_input() nums = raw_input().split(" ") numdict = {} for i, num in enumerate(nums): if num not in dic: dic[num] = 1 else: dic[num]++ ret = 0 for k,v in numdict.iteritems(): if k > v: += k - v else: ret += v - k print(ret)
s145070924
p03489
u425351967
1514477041
Python
PyPy3 (2.4.0)
py
Runtime Error
184
56304
1081
s = input() + "T" x, y = map(int, input().split()) N = len(s) for i in range(N): if s[i] == "F": x -= 1 else: cnt_Y = True index = i + 1 break steps_X = [] steps_Y = [] while index < N: cnt = 0 for j in range(index, N): if s[j] == "F": cnt += 1 ...
s913390265
p03489
u596276291
1514223212
Python
Python (3.4.3)
py
Runtime Error
36
12012
1585
import sys from collections import defaultdict, Counter from itertools import product, groupby, count, permutations, combinations from math import pi, sqrt, ceil, floor from collections import deque from bisect import bisect, bisect_left, bisect_right from string import ascii_lowercase from functools import lru_cache, ...
s399735914
p03489
u692632484
1513576580
Python
Python (3.4.3)
py
Runtime Error
46
14020
238
N=int(input()) a=[int(i) for i in input().split()] data={} for num in a: data[num]+=1 ans=0 for key in data.keys(): if data[key]<key: ans+=data[key] else: ans+=data[key]-key print(ans)
s842365615
p03489
u777923818
1513484761
Python
Python (3.4.3)
py
Runtime Error
44
15004
845
# -*- coding: utf-8 -*- from collections import Counter from itertools import product def inpl(): return tuple(map(int, input().split())) S = input() x, y = inpl() M = [] d = 0 for s in S: if s == "F": d += 1 else: M.append(d) d = 0 M.append(d) Cx = Counter(M[2::2]) Cy = Counter(M...
s884940350
p03489
u475695911
1513481958
Python
Python (3.4.3)
py
Runtime Error
17
2940
338
N = input() count = 0 if (N=0): count = 0 else: a = [] for i in range(N): a.append(map(int, raw_input().split())) a.sort() a.reverse() i = 0 while a[0] > N: del a[0] i++ key = a[0] while key > 0 b = a.count(key) if (b < key): i += b elif(b > key): i += b - key cou...
s528230035
p03489
u872191059
1513479481
Python
PyPy3 (2.4.0)
py
Runtime Error
182
56176
1086
s = str(input()) x, y = map(int, input().split()) n = 8000 fs = list(map(len, s.split('T'))) x -= fs[0] dx = [] dy = [] for i in range(1, len(fs)): if fs[i] == 0: continue if i % 2 == 0: dx.append(fs[i]) else: dy.append(fs[i]) dpx = [[False for _ in range(4 * n + 1)] for _ in range(...
s747148958
p03490
u374802266
1596231115
Python
Python (3.8.2)
py
Runtime Error
99
9108
710
s=input() x,y=map(int,input().split()) p=5 a,b=[],0 for c in s: if c=='T': a.append(b) b=0 else: b+=1 a.append(b) x-=a.pop(0) yl,xl=a[::2],a[1::2] mx,my=[0]*(p*2),[0]*(p*2) mx[p],my[p]=1,1 for dx in xl: nx=[0]*(p*2) for i in range((p*2)): nx[i]=max(nx[i],mx[i]) if...
s639632982
p03490
u208713671
1593108981
Python
PyPy3 (7.3.0)
py
Runtime Error
304
81748
1491
S = list(input()) N = len(S) x,y = list(map(int,input().split())) now = 1 YOKO = [] TATE = [] cnt=0 for i in range(N): if now==1: if S[i]=="F": cnt+=1 elif S[i]=="T": if cnt!=0: YOKO.append(cnt) cnt=0 now=-1*now elif now==-1: ...
s908058810
p03490
u389910364
1584217855
Python
Python (3.4.3)
py
Runtime Error
25
3064
822
import os import sys if os.getenv("LOCAL"): sys.stdin = open("_in.txt", "r") sys.setrecursionlimit(10 ** 9) INF = float("inf") IINF = 10 ** 18 MOD = 10 ** 9 + 7 # MOD = 998244353 S = sys.stdin.buffer.readline().decode().rstrip() X, Y = list(map(int, sys.stdin.buffer.readline().split())) # X 軸と Y 軸は独立に考えられる。 d =...
s841296374
p03490
u892251744
1577758621
Python
PyPy3 (2.4.0)
py
Runtime Error
370
105436
1085
s = input() x, y = map(int, input().split()) flg = 1 x_list = [] y_list = [] tmp = 0 for i, si in enumerate(s): if si == 'F': tmp += 1 else: if flg == 1: x_list.append(tmp) else: y_list.append(tmp) flg *= -1 tmp = 0 if flg == 1: x_list.append(...
s395193054
p03490
u673361376
1575148156
Python
PyPy3 (2.4.0)
py
Runtime Error
182
39280
1495
import bisect from itertools import accumulate def exist_dif(inputS, difx): tmpi = bisect.bisect(inputS,difx//2) if inputS[0] == difx//2: return True tmp_acmS = accumulate(inputS[:min(tmpi+1,len(inputS))]) len_tmp_acmS = len(tmp_acmS) for i in range(len_tmp_acmS): for j in range(i+1,len_tmp_a...
s214677867
p03490
u673361376
1575147832
Python
PyPy3 (2.4.0)
py
Runtime Error
179
39280
1398
import bisect from itertools import accumulate def exist_dif(inputS, difx): tmpi = bisect.bisect(inputS,difx//2) if inputS[0] == difx//2: return True tmp_acmS = accumulate(inputS[:min(tmpi+1,len(inputS))]) len_tmp_acmS = len(tmp_acmS) for i in range(len_tmp_acmS): for j in range(i+1,len_tmp_a...
s624947330
p03490
u673361376
1575147495
Python
PyPy3 (2.4.0)
py
Runtime Error
186
39280
1368
import bisect def exist_dif(inputS, difx): tmpi = bisect.bisect(inputS,difx//2) if inputS[0] == difx//2: return True tmp_acmS = accumulate(inputS[:min(tmpi+1,len(inputS))]) len_tmp_acmS = len(tmp_acmS) for i in range(len_tmp_acmS): for j in range(i+1,len_tmp_acmS): if tmp_acmS[j]-tmp_...
s385037879
p03490
u673361376
1575147262
Python
PyPy3 (2.4.0)
py
Runtime Error
173
39408
1262
import bisect def exist_dif(inputS, difx): tmpi = bisect.bisect(inputS,difx//2) if inputS[0] == difx//2: return True tmp_acmS = accumulate(inputS[:tmpi+1]) for i in range(tmpi+1): for j in range(i+1,tmpi+1): if tmp_acmS[j]-tmp_acmx[i]==difx//2: return True return False ...
s445245220
p03490
u353797797
1573844576
Python
Python (3.4.3)
py
Runtime Error
119
3188
1232
import sys sys.setrecursionlimit(10 ** 6) input = sys.stdin.readline int1 = lambda x: int(x) - 1 p2D = lambda x: print(*x, sep="\n") def no(): print("No") exit() def main(): def ok(dir): goal = abs(xy[dir]) over=total[dir]-goal if over<0 or over%2: return False ...
s490080776
p03490
u940061594
1573686485
Python
Python (3.4.3)
py
Runtime Error
2135
12508
661
#FT Robot_2 import numpy as np s = input() x, y = map(int, input().split()) x = np.array([x]) y = np.array([y]) L = [] stack = 0 p = np.array([0]) q = np.array([0]) for i in range(len(s)): if s[i] == "F": stack = stack + 1 else: L.append(stack) stack = 0 if stack != 0: L.append(sta...
s648067758
p03490
u940061594
1573686062
Python
PyPy3 (2.4.0)
py
Runtime Error
179
39856
660
#FT Robot_2 import numpy as np s = input() x, y = map(int, input().split()) x = np.array([x]) y = np.array([y]) L = [] stack = 0 p = np.array([0]) q = np.array([0]) for i in range(len(s)): if s[i] == "F": stack = stack + 1 else: L.append(stack) stack = 0 if stack != 0: L.append(sta...
s999293510
p03490
u375616706
1561477328
Python
Python (3.4.3)
py
Runtime Error
639
4252
1958
from collections import defaultdict import sys sys.setrecursionlimit(10**9) input = sys.stdin.readline def solve(): S = input()[:-1] GX, GY = map(int, input().split()) # 連続するFをまとめる ex.)FF->2 # 連続するTをまとめる ex.)TTT->T S_parsed = [] prev = S[0] seq = 1 for c in S[1:]: if c == "F":...
s681084039
p03490
u375616706
1561477287
Python
Python (3.4.3)
py
Runtime Error
23
3436
1952
from collections import defaultdict import sys sys.setrecursionlimit(10**9) input = sys.stdin.readline def solve(): S = input()[:-1] GX, GY = map(int, input().split()) # 連続するFをまとめる ex.)FF->2 # 連続するTをまとめる ex.)TTT->T S_parsed = [] prev = S[0] seq = 1 for c in S[1:]: if c == "F":...
s028648826
p03490
u375616706
1561474324
Python
PyPy3 (2.4.0)
py
Runtime Error
401
82908
1868
from collections import defaultdict # -*- coding: utf-8 -*- # python template for atcoder1 import sys sys.setrecursionlimit(10**9) input = sys.stdin.readline def solve(): S = input()[:-1] GX, GY = map(int, input().split()) S_parsed = [] prev = S[0] seq = 1 for c in S[1:]: if c == "F":...
s822006210
p03490
u375616706
1561473351
Python
PyPy3 (2.4.0)
py
Runtime Error
736
120668
1695
from collections import defaultdict # -*- coding: utf-8 -*- # python template for atcoder1 import sys sys.setrecursionlimit(10**9) input = sys.stdin.readline def solve(): S = input()[:-1] GX, GY = map(int, input().split()) S_parsed = [] prev = S[0] seq = 1 for c in S[1:]: if c == "F":...
s512515313
p03490
u310678820
1558915483
Python
PyPy3 (2.4.0)
py
Runtime Error
887
778632
693
import gc def dp(l, z): length = len(l) m=24000 dp=[[0]*m for i in range(length+1)] dp[0][0]=1 for i in range(1, length+1): for j in range(m): if dp[i-1][j]==1: dp[i][(j+l[i-1])%m]=1 dp[i][(j-l[i-1])%m]=1 res = dp[length][z%mod] del dp ...
s801362927
p03490
u310678820
1558915203
Python
PyPy3 (2.4.0)
py
Runtime Error
719
534024
666
def dp(l, z): length = len(l) m=16100 dp=[[0]*m for i in range(length+1)] dp[0][0]=1 for i in range(1, length+1): for j in range(m): if dp[i-1][j]==1: dp[i][(j+l[i-1])%m]=1 dp[i][(j-l[i-1])%m]=1 res = dp[length][z%mod] del dp return res...
s825423518
p03490
u054106284
1548359280
Python
Python (3.4.3)
py
Runtime Error
18
2940
221
s = input() x, y = (int(i) for i in input().split()) while s: if s[0] == "F": x -= 1 if len(s) != 1: s = s[1:] else: s = "" def pm(L): DP = for i in range for i in range(len(s)): pass
s318989518
p03490
u627417051
1545941597
Python
Python (3.4.3)
py
Runtime Error
1946
4584
755
from collections import defaultdict s = list(input()) x, y = list(map(int, input().split())) X = [] Y = [] judge = "x" l = 0 for i in s: if i == "F": l += 1 else: if judge == "x": X.append(l) judge = "y" else: judge == "y" Y.append(l) judge = "x" l =0 if judge == "x": X.append(l) else: Y.a...
s850096446
p03490
u608088992
1545864489
Python
Python (3.4.3)
py
Runtime Error
2108
117652
926
s = input() x, y = map(int, input().split()) MoveX, MoveY = [], [] dir = "X" count = 0 for i in range(len(s)): if s[i] == "T": if count: if dir == "X": MoveX.append(count) else: MoveY.append(count) count = 0 dir = ("Y" if dir == "X" else "X") else: ...
s673854952
p03490
u368780724
1541943432
Python
Python (3.4.3)
py
Runtime Error
18
3188
548
def inpl(): return [int(i) for i in input().split()] s = input().split('T') x, y = inpl() xi = [len(s[i]) for i in s if i%2 == 0] yi = [len(s[i]) for i in s if i%2 == 1] X = (sum(xi)-x)//2 x0 = xi.pop(0) Hx = {0: True} for i in xi: for j in Hx.copy().keys(): Hx[j+i] = True Y = (sum(yi)-y)//2 Hy = {0: Tru...
s471487163
p03490
u177398299
1539038926
Python
Python (3.4.3)
py
Runtime Error
18
3188
429
s = input() x, y = map(int, input().split()) m = list(map(len, s.split('T'))) # 最初は右に行くしかない dp_x = {m[0]} for i in m[2::2]: new_dp = set() for v in dp_x: new_dp += {v + i, v - i} dp_x = new_dp dp_y = {0} for i in m[1::2]: new_dp = set() for v in dp_y: new_dp += {v + i, v - i} dp...
s831571871
p03490
u653005308
1536380702
Python
Python (3.4.3)
py
Runtime Error
54
3700
1183
s=input() s+='T' x,y=map(int,input().split()) n=len(s) direction=0 count=0 X=[] Y=[] Y.append(0) for i in range(n): if s[i]=='F': count+=1 else : if direction==0: X.append(count) else : Y.append(count) count=0 direction=1-direction x_dp=[[0]*16001...
s853979928
p03490
u278479217
1529449451
Python
PyPy3 (2.4.0)
py
Runtime Error
176
38384
4
hoge
s049162439
p03490
u218843509
1525319076
Python
Python (3.4.3)
py
Runtime Error
1667
3980
533
s = input().split("T") x, y = map(int, input().split()) x -= len(s[0]) s.pop(0) list_yoko = [len(s[i]) for i in range(1, len(s), 2)] list_tate = [len(s[i]) for i in range(0, len(s), 2)] set_yoko = {list_yoko[0], -list_yoko[0]} set_tate = {list_tate[0], -list_tate[0]} for i in list_yoko[1:]: sy = set() for j in set...
s482113030
p03490
u218843509
1525318881
Python
Python (3.4.3)
py
Runtime Error
1816
3980
533
import sys s = input().split("T") x, y = map(int, input().split()) x -= len(s[0]) s.pop(0) list_yoko = [len(s[i]) for i in range(1, len(s), 2)] list_tate = [len(s[i]) for i in range(0, len(s), 2)] set_yoko = {list_yoko[0], -list_yoko[0]} set_tate = {list_tate[0], -list_tate[0]} for i in list_yoko[1:]: sy = set() ...
s364744143
p03490
u585191037
1515080643
Python
Python (2.7.6)
py
Runtime Error
122
36132
1370
import sys import numpy as np s = raw_input() x, y = [int(x) for x in raw_input().split(" ")] s = s + "T" a = [] b = [] cum_len = 0 turn = 0 for command in s: if command == "F": cum_len += 1 elif command == "T": (a if turn == 0 else b).append(cum_len) turn ^= 1 cum_len = 0 ...
s839020823
p03490
u585191037
1515079326
Python
Python (2.7.6)
py
Runtime Error
331
35748
1196
import sys import numpy as np s = raw_input() x, y = [int(x) for x in raw_input().split(" ")] s = s + "T" a = [] b = [] cum_len = 0 turn = 0 for command in s: if command == "F": cum_len += 1 elif command == "T": (a if turn == 0 else b).append(cum_len) turn ^= 1 cum_len = 0 ...
s137248458
p03490
u425351967
1514475851
Python
Python (3.4.3)
py
Runtime Error
30
3700
1447
s = input() + "T" x, y = map(int, input().split()) N = len(s) for i in range(N): if s[i] == "F": x -= 1 else: cnt_Y = True index = i + 1 break steps_X = [] steps_Y = [] while index < N: cnt = 0 for j in range(index, N): if s[j] == "F": cnt += 1 ...
s651380764
p03490
u425351967
1514475777
Python
Python (3.4.3)
py
Runtime Error
30
3700
1452
s = input() + "T" x, y = map(int, input().split()) N = len(s) for i in range(N): if s[i] == "F": x -= 1 else: cnt_Y = True index = i + 1 break steps_X = [] steps_Y = [] while index < N: cnt = 0 for j in range(index, N): if s[j] == "F": cnt += 1 ...