用户输出
Yes
系统信息
Exited with return code 0
编号 | 题目 | 状态 | 分数 | 总时间 | 内存 | 代码 / 答案文件 | 提交者 | 提交时间 |
---|---|---|---|---|---|---|---|---|
#672 | #998. 救救小关 | Wrong Answer | 75 | 4135 ms | 30464 K | Python 3 / 865 B | s230034010 | 2023-10-15 15:04:43 |
def can_survive(N, M, H, K, directions, items):
def move(x, y, direction):
if direction == "U":
return x, y+1
elif direction == "D":
return x, y-1
elif direction == "L":
return x-1, y
elif direction == "R":
return x+1, y
x, y = 0, 0
for direction in directions:
if (x, y) in items and H < K:
H = K
H -= 1
if H < 0:
return "No"
x, y = move(x, y, direction)
if (x, y) in items and H < K:
H = K
return "Yes" if H >= 0 else "No"
N, M, H, K = map(int, input().split())
directions = input().strip()
items = set()
for _ in range(M):
xi, yi = map(int, input().split())
items.add((xi, yi))
print(can_survive(N, M, H, K, directions, items))
用户输出
Yes
系统信息
Exited with return code 0
用户输出
Yes
Special Judge 信息
Files user_out and answer differ
系统信息
Exited with return code 0
200000 200000 1 1
RRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR
<1888814 bytes omitted>
用户输出
Yes
系统信息
Exited with return code 0
200000 100000 2 2
DLDLDLDLDLDLDLDLDLDLDLDLDLDLDLDLDLDLDLDLDLDLDLDLDLDLDLDLDLDLDLDLDLDLDLDLDLDLDLDLDL
<1577709 bytes omitted>
用户输出
Yes
系统信息
Exited with return code 0
200000 99998 2 2
DLDLDLDLDLDLDLDLDLDLDLDLDLDLDLDLDLDLDLDLDLDLDLDLDLDLDLDLDLDLDLDLDLDLDLDLDLDLDLDLDLD
<1577678 bytes omitted>
用户输出
No
系统信息
Exited with return code 0
200000 1 199999 100000
DLDLDLDLDLDLDLDLDLDLDLDLDLDLDLDLDLDLDLDLDLDLDLDLDLDLDLDLDLDLDLDLDLDLDLDLDLDLD
<199930 bytes omitted>
用户输出
No
系统信息
Exited with return code 0
199800 333 500 600
RRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR
<202329 bytes omitted>
用户输出
Yes
系统信息
Exited with return code 0
200000 332 500 600
RRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR
<202521 bytes omitted>
用户输出
No
系统信息
Exited with return code 0
200000 399 105 500
ULURRRDLDRRRRURRRRDDRURURURUUURRUUUUUURDRRULUURRRUUUUURURRRURRUURURRRURURRRDDRDLU
<204579 bytes omitted>
用户输出
No
系统信息
Exited with return code 0
200000 241 287 832
UUURURUURUUUUUURRRRURRURDRURUUUURUURURDRRUULURULLURUULURULLURRRUULDLLULLURRURUURU
<202736 bytes omitted>
用户输出
Yes
系统信息
Exited with return code 0
200000 264 736 756
UURDRRUURULUUUURUURURUUULDDLUUURURRRRRURUUUURRRUURRUURURUUUUULUURDRRRRRULUURRULUL
<203008 bytes omitted>
用户输出
Yes
系统信息
Exited with return code 0
200000 672 937 296
UURUURRUURURUUUUURRRRRRURULUURUURRURURUUUUURRURRURDRUURULLUURRURUULLUUUURUULLUURR
<207787 bytes omitted>
用户输出
No
系统信息
Exited with return code 0
200000 399 991 499
URRRUUURUURRRURRURRRRULURUUUUUUUUUURRUURDRRRURULURRRURURDRURRURRRUULURULULURURRRU
<204590 bytes omitted>
用户输出
Yes
Special Judge 信息
Files user_out and answer differ
系统信息
Exited with return code 0
200000 457 419 437
URUUURURRDRRURURDRRRUURUURRRRUULULUULURRRRRRDDRRURRULUULURURURURUUUURUUUURRURURUL
<205265 bytes omitted>
用户输出
Yes
Special Judge 信息
Files user_out and answer differ
系统信息
Exited with return code 0
200000 204 734 976
URUUUUUUUURURRUUURRDRUUUURRURRRUUUUUULUUUUUUURURURURURURULUURUUURDRUUURURUUURRUUU
<202304 bytes omitted>
用户输出
No
系统信息
Exited with return code 0
200000 2 95635 67064
LULDLDRRDRDLLULDLDRRDDRURDRRRDRRRDLLDDDLULDLDLLDDDLDDLLURULURRULULLDRLLDLULDDLL
<199938 bytes omitted>
用户输出
Yes
Special Judge 信息
Files user_out and answer differ
系统信息
Exited with return code 0
200000 3 51656 52962
DRRRUULUURURDDRDLDDDRDRURRRURUUURRUUURUUULULDDRDLDDLLDDDDLLLDRRRLLDDDRRULLURLLD
<199956 bytes omitted>
用户输出
Yes
系统信息
Exited with return code 0
200000 2 38895 65741
LULULLURULULDDLUUUUULDDLULUURRURRRRULLULURRDRURUUULDDLULDLLUULDDLLDDLDRRDLLLDDL
<199944 bytes omitted>
用户输出
No
系统信息
Exited with return code 0
200000 9 58420 15766
RRURDDLLDRRRRULURRULUURDRDDDDLUDDDRURRRDDRRRRDLLLLLLDRDDRDDLLLUURDRLUULUUURURDD
<199998 bytes omitted>
用户输出
Yes
系统信息
Exited with return code 0