Submission #3435335
Source Code Expand
s = input() x, y = map(int, input().split()) x_list = [] y_list = [] st = s.split("T") x -= len(st[0]) for i, ls in enumerate(st[1:]): if i % 2: x_list.append(len(ls)) else: y_list.append(len(ls)) dpx = [[0 for i in range(16001)] for j in range(len(x_list)+1)] dpy = [[0 for i in range(16001)] for j in range(len(y_list)+1)] dpx[0][8000] = 1 dpy[0][8000] = 1 for i in range(len(x_list)): for num in range(16001): if num + x_list[i] <= 16000 and dpx[i][num] == 1: dpx[i+1][num+x_list[i]] = 1 if num - x_list[i] >= 0 and dpx[i][num] == 1: dpx[i+1][num-x_list[i]] = 1 for i in range(len(y_list)): for num in range(16001): if num + y_list[i] <= 16000 and dpy[i][num] == 1: dpy[i+1][num+y_list[i]] = 1 if num - y_list[i] >= 0 and dpy[i][num] == 1: dpy[i+1][num-y_list[i]] = 1 if dpx[len(x_list)][x+8000] == 1 and dpy[len(y_list)][y+8000] == 1: print("Yes") else: print("No")
Submission Info
Submission Time | |
---|---|
Task | D - FT Robot |
User | mizukurage |
Language | PyPy3 (2.4.0) |
Score | 0 |
Code Size | 1035 Byte |
Status | TLE |
Exec Time | 2175 ms |
Memory | 1135112 KB |
Judge Result
Set Name | Sample | All | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 0 / 500 | ||||||||
Status |
|
|
Set Name | Test Cases |
---|---|
Sample | 0_00.txt, 0_01.txt, 0_02.txt, 0_03.txt, 0_04.txt, 0_05.txt |
All | 0_00.txt, 0_01.txt, 0_02.txt, 0_03.txt, 0_04.txt, 0_05.txt, 1_00.txt, 1_01.txt, 1_02.txt, 1_03.txt, 1_04.txt, 1_05.txt, 1_06.txt, 1_07.txt, 1_08.txt, 1_09.txt, 1_10.txt, 1_11.txt, 1_12.txt, 1_13.txt, 1_14.txt, 1_15.txt, 1_16.txt, 1_17.txt, 1_18.txt, 1_19.txt, 1_20.txt, 1_21.txt, 1_22.txt, 1_23.txt, 1_24.txt, 1_25.txt, 1_26.txt, 1_27.txt, 1_28.txt, 1_29.txt, 1_30.txt, 1_31.txt, 1_32.txt, 1_33.txt, 1_34.txt, 1_35.txt, 1_36.txt, 1_37.txt, 1_38.txt, 1_39.txt, 1_40.txt, 1_41.txt, 1_42.txt, 1_43.txt, 1_44.txt, 1_45.txt, 1_46.txt, 1_47.txt, 1_48.txt, 1_49.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
0_00.txt | AC | 175 ms | 39792 KB |
0_01.txt | AC | 175 ms | 39792 KB |
0_02.txt | AC | 166 ms | 38768 KB |
0_03.txt | AC | 171 ms | 39280 KB |
0_04.txt | AC | 175 ms | 39792 KB |
0_05.txt | AC | 176 ms | 40048 KB |
1_00.txt | AC | 169 ms | 38896 KB |
1_01.txt | AC | 168 ms | 38896 KB |
1_02.txt | AC | 174 ms | 39664 KB |
1_03.txt | AC | 174 ms | 39664 KB |
1_04.txt | AC | 177 ms | 40176 KB |
1_05.txt | AC | 177 ms | 40176 KB |
1_06.txt | MLE | 1899 ms | 589704 KB |
1_07.txt | MLE | 1897 ms | 589704 KB |
1_08.txt | TLE | 2163 ms | 774408 KB |
1_09.txt | TLE | 2150 ms | 774408 KB |
1_10.txt | TLE | 2150 ms | 774408 KB |
1_11.txt | TLE | 2150 ms | 774408 KB |
1_12.txt | AC | 1333 ms | 407432 KB |
1_13.txt | AC | 1329 ms | 405384 KB |
1_14.txt | MLE | 1866 ms | 589704 KB |
1_15.txt | MLE | 1871 ms | 589704 KB |
1_16.txt | MLE | 1884 ms | 589704 KB |
1_17.txt | MLE | 1870 ms | 589760 KB |
1_18.txt | MLE | 1848 ms | 578184 KB |
1_19.txt | MLE | 1848 ms | 579336 KB |
1_20.txt | MLE | 1844 ms | 578312 KB |
1_21.txt | MLE | 1912 ms | 588808 KB |
1_22.txt | MLE | 1877 ms | 586504 KB |
1_23.txt | MLE | 1876 ms | 581768 KB |
1_24.txt | MLE | 1934 ms | 591240 KB |
1_25.txt | MLE | 1885 ms | 578440 KB |
1_26.txt | TLE | 2173 ms | 1111432 KB |
1_27.txt | TLE | 2175 ms | 1135112 KB |
1_28.txt | MLE | 1866 ms | 578568 KB |
1_29.txt | MLE | 1934 ms | 588424 KB |
1_30.txt | AC | 1095 ms | 315656 KB |
1_31.txt | AC | 1020 ms | 299016 KB |
1_32.txt | AC | 655 ms | 178440 KB |
1_33.txt | AC | 682 ms | 172936 KB |
1_34.txt | AC | 415 ms | 112604 KB |
1_35.txt | AC | 424 ms | 107996 KB |
1_36.txt | AC | 318 ms | 78172 KB |
1_37.txt | AC | 331 ms | 85212 KB |
1_38.txt | AC | 247 ms | 59100 KB |
1_39.txt | AC | 254 ms | 61020 KB |
1_40.txt | AC | 219 ms | 50396 KB |
1_41.txt | AC | 225 ms | 52060 KB |
1_42.txt | AC | 1341 ms | 406792 KB |
1_43.txt | AC | 1341 ms | 406536 KB |
1_44.txt | AC | 1376 ms | 407688 KB |
1_45.txt | AC | 1359 ms | 406920 KB |
1_46.txt | AC | 1333 ms | 405768 KB |
1_47.txt | AC | 1357 ms | 406664 KB |
1_48.txt | AC | 1492 ms | 406408 KB |
1_49.txt | AC | 1364 ms | 406664 KB |