結果
問題 |
No.2197 Same Dish
|
ユーザー |
|
提出日時 | 2023-01-21 14:40:53 |
言語 | PyPy3 (7.3.15) |
結果 |
RE
|
実行時間 | - |
コード長 | 324 bytes |
コンパイル時間 | 282 ms |
コンパイル使用メモリ | 82,048 KB |
実行使用メモリ | 67,968 KB |
最終ジャッジ日時 | 2024-06-23 22:44:31 |
合計ジャッジ時間 | 3,358 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | RE * 3 |
other | RE * 20 |
ソースコード
N,K = map(int,input().split()) l = [] for _ in range(N): L,R = map(int,input().split()) l.append((L,1)) l,append((R,-1)) l.sort() tmp = 1 num = 0 P = 998244353 for t,i in l: if i == 1: tmp *= (K - num) tmp %= P num += 1 else: num -= 1 ans = pow(K,N,P) - tmp print(ans%P)