結果
問題 |
No.1338 Giant Class
|
ユーザー |
|
提出日時 | 2023-05-11 19:31:13 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 220 ms / 2,000 ms |
コード長 | 396 bytes |
コンパイル時間 | 155 ms |
コンパイル使用メモリ | 81,840 KB |
実行使用メモリ | 98,260 KB |
最終ジャッジ日時 | 2024-11-27 16:03:53 |
合計ジャッジ時間 | 5,445 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 21 |
ソースコード
#int(input()) #map(int, input().split()) #list(map(int, input().split())) H, W, Q = map(int, input().split()) z = [0] * Q for i in range(Q): z[i] = list(map(int, input().split())) ans = H*W d = dict() for i in range(Q): y, x = z[i] if x not in d: ans -= H - y + 1 d[x] = y else: ans -= d[x] - min(d[x], y) d[x] = min(d[x], y) print(ans)