結果
| 問題 |
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 defaultdict
min_y = defaultdict(int)
ans = H*W
for _ in range(Q):
y, x = map(int, input().split())
if x not in min_y:
ans -= H - y +1
min_y[x] = y
else:
ans -= min_y[x] - min(min_y[x], y)
min_y[x] = min(min_y[x], y)
print(ans)