結果
問題 | No.2230 Good Omen of White Lotus |
ユーザー | ニックネーム |
提出日時 | 2023-02-24 23:21:27 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 565 bytes |
コンパイル時間 | 312 ms |
コンパイル使用メモリ | 87,000 KB |
実行使用メモリ | 94,352 KB |
最終ジャッジ日時 | 2023-10-11 06:56:52 |
合計ジャッジ時間 | 16,536 ms |
ジャッジサーバーID (参考情報) |
judge15 / judge14 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 75 ms
71,036 KB |
testcase_01 | AC | 74 ms
71,484 KB |
testcase_02 | AC | 75 ms
71,196 KB |
testcase_03 | AC | 74 ms
71,200 KB |
testcase_04 | AC | 73 ms
71,408 KB |
testcase_05 | AC | 75 ms
71,380 KB |
testcase_06 | AC | 75 ms
71,256 KB |
testcase_07 | AC | 74 ms
71,352 KB |
testcase_08 | WA | - |
testcase_09 | AC | 78 ms
71,488 KB |
testcase_10 | WA | - |
testcase_11 | AC | 73 ms
71,480 KB |
testcase_12 | WA | - |
testcase_13 | WA | - |
testcase_14 | WA | - |
testcase_15 | AC | 88 ms
75,928 KB |
testcase_16 | WA | - |
testcase_17 | WA | - |
testcase_18 | WA | - |
testcase_19 | WA | - |
testcase_20 | WA | - |
testcase_21 | WA | - |
testcase_22 | WA | - |
testcase_23 | WA | - |
testcase_24 | AC | 76 ms
72,816 KB |
testcase_25 | AC | 76 ms
72,880 KB |
testcase_26 | AC | 75 ms
72,896 KB |
testcase_27 | AC | 283 ms
92,252 KB |
testcase_28 | AC | 287 ms
92,288 KB |
testcase_29 | WA | - |
testcase_30 | WA | - |
testcase_31 | AC | 295 ms
92,236 KB |
testcase_32 | AC | 296 ms
92,256 KB |
testcase_33 | WA | - |
testcase_34 | WA | - |
testcase_35 | WA | - |
testcase_36 | WA | - |
testcase_37 | WA | - |
testcase_38 | WA | - |
testcase_39 | WA | - |
testcase_40 | AC | 301 ms
82,932 KB |
testcase_41 | WA | - |
testcase_42 | WA | - |
testcase_43 | WA | - |
testcase_44 | WA | - |
testcase_45 | WA | - |
testcase_46 | AC | 467 ms
85,472 KB |
ソースコード
class BIT: def __init__(self, n): self.n = n; self.k = [0]*(n+1) def u(self, i, x): while i <= self.n: self.k[i] = max(self.k[i], x); i += i&-i def m(self, i): t = 0 while i > 0: t = max(t, self.k[i]); i -= i&-i return t h,w,n,p = map(int,input().split()) xy = []; mod = 998244353; bit = BIT(w+1) for _ in range(n): x,y = map(int,input().split()) xy.append((x,-y)) for x,y in sorted(xy): bit.u(-y,bit.m(-y)+1) c = bit.m(w) print((1-pow(p-1,h+w-3-c,mod)*pow(p-2,c,mod)*pow(pow(p,h+w-3,mod),mod-2,mod))%mod)