結果
| 問題 |
No.2197 Same Dish
|
| コンテスト | |
| ユーザー |
titia
|
| 提出日時 | 2023-01-23 01:15:15 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 292 bytes |
| コンパイル時間 | 507 ms |
| コンパイル使用メモリ | 12,800 KB |
| 実行使用メモリ | 24,972 KB |
| 最終ジャッジ日時 | 2024-06-25 02:17:03 |
| 合計ジャッジ時間 | 6,073 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 7 WA * 13 |
ソースコード
from collections import deque
N,K=map(int,input().split())
LR=[tuple(map(int,input().split())) for i in range(N)]
LR.sort()
ANS=1
mod=998244353
Q=deque()
for l,r in LR:
while Q and Q[0]<=l:
Q.popleft()
ANS=ANS*(K-len(Q))%mod
Q.append(r)
print((pow(K,N,mod)-ANS)%mod)
titia