結果
問題 | No.1338 Giant Class |
ユーザー |
|
提出日時 | 2024-01-06 07:02:54 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 343 ms / 2,000 ms |
コード長 | 341 bytes |
コンパイル時間 | 265 ms |
コンパイル使用メモリ | 82,164 KB |
実行使用メモリ | 85,856 KB |
最終ジャッジ日時 | 2024-09-27 19:15:37 |
合計ジャッジ時間 | 6,572 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 21 |
ソースコード
H, W, Q = map(int, input().split())from collections import defaultdictmin_y = defaultdict(int)ans = H*Wfor _ in range(Q):y, x = map(int, input().split())if x not in min_y:ans -= H - y +1min_y[x] = yelse:ans -= min_y[x] - min(min_y[x], y)min_y[x] = min(min_y[x], y)print(ans)