結果

問題 No.2646 Cycle Maze
ユーザー hirayuu_ychirayuu_yc
提出日時 2024-02-25 19:12:08
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 785 bytes
コンパイル時間 289 ms
コンパイル使用メモリ 81,700 KB
実行使用メモリ 92,528 KB
最終ジャッジ日時 2024-02-25 19:12:24
合計ジャッジ時間 15,158 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 35 ms
53,460 KB
testcase_01 AC 34 ms
53,460 KB
testcase_02 AC 35 ms
53,460 KB
testcase_03 AC 52 ms
66,544 KB
testcase_04 AC 35 ms
53,460 KB
testcase_05 AC 35 ms
53,456 KB
testcase_06 WA -
testcase_07 AC 36 ms
53,460 KB
testcase_08 AC 35 ms
53,460 KB
testcase_09 AC 35 ms
53,460 KB
testcase_10 AC 40 ms
59,712 KB
testcase_11 AC 42 ms
59,712 KB
testcase_12 WA -
testcase_13 AC 36 ms
53,460 KB
testcase_14 AC 35 ms
53,460 KB
testcase_15 AC 36 ms
53,460 KB
testcase_16 WA -
testcase_17 AC 35 ms
53,460 KB
testcase_18 WA -
testcase_19 AC 40 ms
59,584 KB
testcase_20 AC 35 ms
53,460 KB
testcase_21 AC 35 ms
53,460 KB
testcase_22 AC 44 ms
61,972 KB
testcase_23 AC 36 ms
53,460 KB
testcase_24 AC 35 ms
53,460 KB
testcase_25 AC 115 ms
76,324 KB
testcase_26 AC 137 ms
76,460 KB
testcase_27 AC 274 ms
77,460 KB
testcase_28 AC 97 ms
76,128 KB
testcase_29 AC 107 ms
76,336 KB
testcase_30 AC 123 ms
76,460 KB
testcase_31 AC 73 ms
73,896 KB
testcase_32 AC 71 ms
73,292 KB
testcase_33 AC 162 ms
76,716 KB
testcase_34 AC 262 ms
77,728 KB
testcase_35 AC 173 ms
76,476 KB
testcase_36 AC 163 ms
76,664 KB
testcase_37 AC 185 ms
77,716 KB
testcase_38 AC 75 ms
74,488 KB
testcase_39 AC 128 ms
76,352 KB
testcase_40 AC 69 ms
73,304 KB
testcase_41 AC 156 ms
76,588 KB
testcase_42 AC 93 ms
75,964 KB
testcase_43 AC 81 ms
76,248 KB
testcase_44 AC 107 ms
76,252 KB
testcase_45 AC 535 ms
82,532 KB
testcase_46 AC 627 ms
84,080 KB
testcase_47 AC 163 ms
77,936 KB
testcase_48 AC 451 ms
81,520 KB
testcase_49 AC 560 ms
83,312 KB
testcase_50 AC 1,037 ms
87,792 KB
testcase_51 AC 1,504 ms
92,144 KB
testcase_52 AC 1,533 ms
92,528 KB
testcase_53 AC 1,523 ms
92,528 KB
testcase_54 AC 1,570 ms
92,140 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
#sys.setrecursionlimit((1<<19)-1)
#import pypyjit
#pypyjit.set_param('max_unroll_recursion=-1')

H,W,T=map(int,input().split())
Sy,Sx=map(int,input().split())
Gy,Gx=map(int,input().split())
Sy-=1
Sx-=1
Gy-=1
Gx-=1
A=[list(map(int,input())) for i in range(H)]
dp=[[0]*W for i in range(H)]
dp[Sy][Sx]=1
for i in range(T):
    ndp=[[0]*W for i in range(H)]
    for j in range(H):
        for k in range(W):
            if (A[j][k]-i-1)%(A[j][k]+1):
                if dp[j][k]:
                    ndp[j][k]=1
                for my,mx in ((0,1),(1,0),(0,-1),(-1,0)):
                    if 0<=my+j<H and 0<=mx+k<W:
                        if dp[my+j][mx+k]:
                            ndp[j][k]=1
    if ndp[Gy][Gx]:
        print("Yes")
        exit()
    dp=ndp
print("No")
0