Submission #8814402
Source Code Expand
import sys read = sys.stdin.buffer.read readline = sys.stdin.buffer.readline readlines = sys.stdin.buffer.readlines from heapq import heappush, heappop H,W,K = map(int,readline().split()) S = readline().rstrip().decode('utf-8') A = ['#' * (W+2)] A += ['#' + row + '#' for row in read().decode('utf-8').split()] A += ['#' * (W+2)] A = list(''.join(A)) start = A.index('S') goal = A.index('G') A = [x != '#' for x in A] INF = 10 ** 18 S += S wait_U = [INF] * (K+K+1) wait_D = [INF] * (K+K+1) wait_R = [INF] * (K+K+1) wait_L = [INF] * (K+K+1) for n in range(K+K-1,-1,-1): s = S[n] wait_U[n] = 0 if s == 'U' else wait_U[n+1] + 1 wait_D[n] = 0 if s == 'D' else wait_D[n+1] + 1 wait_R[n] = 0 if s == 'R' else wait_R[n+1] + 1 wait_L[n] = 0 if s == 'L' else wait_L[n+1] + 1
Submission Info
Submission Time | |
---|---|
Task | E - 迷路 |
User | maspy |
Language | PyPy3 (2.4.0) |
Score | 0 |
Code Size | 820 Byte |
Status | WA |
Exec Time | 369 ms |
Memory | 144180 KB |
Judge Result
Set Name | Sample | All | ||
---|---|---|---|---|
Score / Max Score | 0 / 0 | 0 / 500 | ||
Status | AC |
|
Set Name | Test Cases |
---|---|
Sample | |
All | 01.txt, 02.txt, 03.txt, 04.txt, 05.txt, 06.txt, 07.txt, 08.txt, 09.txt, 10.txt, 11.txt, 12.txt, 13.txt, 14.txt, 15.txt, 16.txt, 17.txt, 18.txt, 19.txt, 20.txt, 21.txt, 22.txt, 23.txt, 24.txt, 25.txt, 26.txt, 27.txt, 28.txt, 29.txt, 30.txt, 31.txt, 32.txt, 33.txt, 34.txt, 35.txt, 36.txt, 37.txt, 38.txt, 39.txt, 40.txt, 41.txt, s1.txt, s2.txt, s3.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
01.txt | WA | 167 ms | 38384 KB |
02.txt | WA | 163 ms | 38256 KB |
03.txt | WA | 160 ms | 38256 KB |
04.txt | WA | 164 ms | 39728 KB |
05.txt | WA | 161 ms | 38256 KB |
06.txt | WA | 368 ms | 144052 KB |
07.txt | WA | 357 ms | 144180 KB |
08.txt | WA | 369 ms | 144052 KB |
09.txt | WA | 358 ms | 144052 KB |
10.txt | WA | 360 ms | 144052 KB |
11.txt | WA | 356 ms | 144052 KB |
12.txt | WA | 351 ms | 144052 KB |
13.txt | WA | 357 ms | 144052 KB |
14.txt | WA | 348 ms | 144052 KB |
15.txt | WA | 348 ms | 144052 KB |
16.txt | WA | 350 ms | 144052 KB |
17.txt | WA | 351 ms | 144052 KB |
18.txt | WA | 353 ms | 144052 KB |
19.txt | WA | 350 ms | 144052 KB |
20.txt | WA | 352 ms | 144052 KB |
21.txt | WA | 339 ms | 144052 KB |
22.txt | WA | 343 ms | 144052 KB |
23.txt | WA | 349 ms | 144052 KB |
24.txt | WA | 340 ms | 144052 KB |
25.txt | WA | 342 ms | 144052 KB |
26.txt | WA | 339 ms | 144052 KB |
27.txt | WA | 339 ms | 144052 KB |
28.txt | WA | 338 ms | 144052 KB |
29.txt | WA | 339 ms | 144052 KB |
30.txt | WA | 359 ms | 144052 KB |
31.txt | WA | 337 ms | 141108 KB |
32.txt | WA | 338 ms | 141108 KB |
33.txt | WA | 339 ms | 144052 KB |
34.txt | WA | 333 ms | 141108 KB |
35.txt | WA | 339 ms | 141108 KB |
36.txt | WA | 335 ms | 141108 KB |
37.txt | WA | 335 ms | 141108 KB |
38.txt | WA | 336 ms | 141108 KB |
39.txt | WA | 337 ms | 141108 KB |
40.txt | WA | 337 ms | 144052 KB |
41.txt | WA | 160 ms | 38256 KB |
s1.txt | WA | 159 ms | 38256 KB |
s2.txt | WA | 159 ms | 38256 KB |
s3.txt | WA | 160 ms | 38256 KB |