Submission #3012402
Source Code Expand
S = sorted(input()) T = int(input()) d = [0, 0] for s in S: if s == '?': continue if s == 'L': d[0] -= 1 elif s == 'R': d[0] += 1 elif s == 'D': d[1] -= 1 else: d[1] += 1 ans = abs(d[0]) + abs(d[1]) if T == 1: ans += S.count('?') else: c = S.count('?') d = min(c, ans) ans -= d c -= d for i in range(c): ans += (1 if i % 2 else -1) * 1 print(ans)
Submission Info
Submission Time | |
---|---|
Task | B - ドローン |
User | peace_of_junk |
Language | PyPy3 (2.4.0) |
Score | 100 |
Code Size | 472 Byte |
Status | WA |
Exec Time | 207 ms |
Memory | 49904 KB |
Judge Result
Set Name | Sample | Subtask1 | All | ||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 100 / 100 | 0 / 1 | ||||||||
Status |
|
|
|
Set Name | Test Cases |
---|---|
Sample | 00_example_01.txt, 00_example_02.txt, 00_example_03.txt, 00_example_04.txt |
Subtask1 | 00_example_01.txt, 00_example_02.txt, 00_example_03.txt, 10_rand_01.txt, 10_rand_02.txt, 10_rand_03.txt, 10_rand_04.txt, 20_no_question_01.txt, 20_no_question_02.txt, 20_no_question_03.txt, 20_no_question_04.txt, 30_max_01.txt, 30_max_02.txt, 30_max_03.txt, 30_max_04.txt, 40_corner_01.txt, 40_corner_02.txt, 40_corner_03.txt, 40_corner_04.txt |
All | 00_example_01.txt, 00_example_02.txt, 00_example_03.txt, 00_example_04.txt, 10_rand_01.txt, 10_rand_02.txt, 10_rand_03.txt, 10_rand_04.txt, 20_no_question_01.txt, 20_no_question_02.txt, 20_no_question_03.txt, 20_no_question_04.txt, 30_max_01.txt, 30_max_02.txt, 30_max_03.txt, 30_max_04.txt, 40_corner_01.txt, 40_corner_02.txt, 40_corner_03.txt, 40_corner_04.txt, 50_hand_01.txt, 50_hand_02.txt, 50_hand_03.txt, 60_rand_01.txt, 60_rand_02.txt, 60_rand_03.txt, 60_rand_04.txt, 70_no_ques_01.txt, 70_no_ques_02.txt, 70_no_ques_03.txt, 70_no_ques_04.txt, 80_max_01.txt, 80_max_02.txt, 80_max_03.txt, 80_max_04.txt, 90_corner_01.txt, 90_corner_02.txt, 90_corner_03.txt, 90_corner_04.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
00_example_01.txt | AC | 161 ms | 38256 KB |
00_example_02.txt | AC | 160 ms | 38256 KB |
00_example_03.txt | AC | 162 ms | 38256 KB |
00_example_04.txt | AC | 161 ms | 38256 KB |
10_rand_01.txt | AC | 170 ms | 39408 KB |
10_rand_02.txt | AC | 161 ms | 38256 KB |
10_rand_03.txt | AC | 169 ms | 39408 KB |
10_rand_04.txt | AC | 166 ms | 39024 KB |
20_no_question_01.txt | AC | 169 ms | 39408 KB |
20_no_question_02.txt | AC | 161 ms | 38384 KB |
20_no_question_03.txt | AC | 170 ms | 39408 KB |
20_no_question_04.txt | AC | 167 ms | 39024 KB |
30_max_01.txt | AC | 203 ms | 49904 KB |
30_max_02.txt | AC | 203 ms | 49904 KB |
30_max_03.txt | AC | 203 ms | 49904 KB |
30_max_04.txt | AC | 203 ms | 49904 KB |
40_corner_01.txt | AC | 195 ms | 49648 KB |
40_corner_02.txt | AC | 177 ms | 49392 KB |
40_corner_03.txt | AC | 178 ms | 49392 KB |
40_corner_04.txt | AC | 196 ms | 49520 KB |
50_hand_01.txt | WA | 162 ms | 38256 KB |
50_hand_02.txt | WA | 160 ms | 38256 KB |
50_hand_03.txt | AC | 162 ms | 38256 KB |
60_rand_01.txt | AC | 169 ms | 39408 KB |
60_rand_02.txt | AC | 161 ms | 38256 KB |
60_rand_03.txt | WA | 180 ms | 39408 KB |
60_rand_04.txt | AC | 166 ms | 39024 KB |
70_no_ques_01.txt | AC | 170 ms | 39408 KB |
70_no_ques_02.txt | AC | 161 ms | 38256 KB |
70_no_ques_03.txt | WA | 170 ms | 39408 KB |
70_no_ques_04.txt | AC | 166 ms | 39024 KB |
80_max_01.txt | WA | 206 ms | 49904 KB |
80_max_02.txt | AC | 205 ms | 49904 KB |
80_max_03.txt | WA | 206 ms | 49904 KB |
80_max_04.txt | AC | 207 ms | 49904 KB |
90_corner_01.txt | AC | 182 ms | 49392 KB |
90_corner_02.txt | WA | 182 ms | 49392 KB |
90_corner_03.txt | WA | 196 ms | 49520 KB |
90_corner_04.txt | AC | 197 ms | 49520 KB |