結果
問題 | No.2230 Good Omen of White Lotus |
ユーザー | ああいい |
提出日時 | 2023-02-25 17:46:24 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 768 bytes |
コンパイル時間 | 1,150 ms |
コンパイル使用メモリ | 86,636 KB |
実行使用メモリ | 830,208 KB |
最終ジャッジ日時 | 2023-10-11 15:00:54 |
合計ジャッジ時間 | 6,663 ms |
ジャッジサーバーID (参考情報) |
judge11 / judge12 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 72 ms
71,032 KB |
testcase_01 | AC | 73 ms
70,912 KB |
testcase_02 | WA | - |
testcase_03 | AC | 73 ms
70,936 KB |
testcase_04 | AC | 74 ms
70,908 KB |
testcase_05 | AC | 80 ms
71,092 KB |
testcase_06 | AC | 74 ms
71,044 KB |
testcase_07 | AC | 76 ms
70,968 KB |
testcase_08 | WA | - |
testcase_09 | AC | 76 ms
70,972 KB |
testcase_10 | WA | - |
testcase_11 | AC | 73 ms
71,104 KB |
testcase_12 | WA | - |
testcase_13 | WA | - |
testcase_14 | WA | - |
testcase_15 | AC | 145 ms
80,840 KB |
testcase_16 | AC | 360 ms
98,388 KB |
testcase_17 | AC | 352 ms
98,480 KB |
testcase_18 | AC | 367 ms
98,244 KB |
testcase_19 | AC | 362 ms
98,252 KB |
testcase_20 | WA | - |
testcase_21 | WA | - |
testcase_22 | WA | - |
testcase_23 | WA | - |
testcase_24 | MLE | - |
testcase_25 | -- | - |
testcase_26 | -- | - |
testcase_27 | -- | - |
testcase_28 | -- | - |
testcase_29 | -- | - |
testcase_30 | -- | - |
testcase_31 | -- | - |
testcase_32 | -- | - |
testcase_33 | -- | - |
testcase_34 | -- | - |
testcase_35 | -- | - |
testcase_36 | -- | - |
testcase_37 | -- | - |
testcase_38 | -- | - |
testcase_39 | -- | - |
testcase_40 | -- | - |
testcase_41 | -- | - |
testcase_42 | -- | - |
testcase_43 | -- | - |
testcase_44 | -- | - |
testcase_45 | -- | - |
testcase_46 | -- | - |
ソースコード
H,W,N,P = map(int,input().split()) s = set() for _ in range(N): x,y = map(int,input().split()) s.add((x-1,y-1)) dp = [[0] * W for _ in range(H)] memo = [[0] * W for _ in range(H)] stack = [(0,0)] while stack: x,y = stack.pop() for i,j in [(1,0),(0,1)]: if x + i < H and y + j < W: if memo[x + i][y + j] == 0: memo[x + i][y + j] = 1 stack.append((x + i,y + j)) if (x + i,y + j) in s: t = dp[x][y] + 1 else: t = dp[x][y] if t > dp[x + i][y + j]: dp[x + i][y + j] = t u = dp[-1][-1] mod = 998244353 v = H + W - 3 - u r = pow(P,mod-2,mod) tmp = pow((1-r)%mod,v,mod)*pow((1-r * 2)%mod,u,mod) ans = (1-tmp)%mod print(ans)