結果

問題 No.2197 Same Dish
ユーザー ニックネームニックネーム
提出日時 2023-01-20 22:06:18
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 303 bytes
コンパイル時間 342 ms
コンパイル使用メモリ 10,640 KB
実行使用メモリ 32,460 KB
最終ジャッジ日時 2023-09-05 14:23:14
合計ジャッジ時間 6,089 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 57 ms
9,480 KB
testcase_01 AC 56 ms
9,588 KB
testcase_02 AC 59 ms
9,572 KB
testcase_03 AC 58 ms
9,684 KB
testcase_04 AC 56 ms
9,644 KB
testcase_05 AC 58 ms
9,640 KB
testcase_06 AC 58 ms
9,644 KB
testcase_07 AC 56 ms
9,692 KB
testcase_08 WA -
testcase_09 AC 56 ms
9,536 KB
testcase_10 AC 56 ms
9,592 KB
testcase_11 AC 57 ms
9,588 KB
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 AC 470 ms
32,272 KB
testcase_22 AC 455 ms
26,336 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n,k = map(int,input().split())
lr = [[v-1 for v in map(int,input().split())] for _ in range(n)]
imos = [0]*(200000); x = 1; mod = 998244353
for l,r in lr: imos[l] += 1; imos[r] -= 1
for i in range(199999): imos[i+1] += imos[i]
for l,_ in lr: x *= max(k-imos[l]+1,0); x %= mod
print((pow(k,n,mod)-x)%mod)
0