結果
| 問題 | No.1338 Giant Class |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2021-05-25 14:41:00 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
AC
|
| 実行時間 | 103 ms / 2,000 ms |
| コード長 | 275 bytes |
| 記録 | |
| コンパイル時間 | 246 ms |
| コンパイル使用メモリ | 84,980 KB |
| 実行使用メモリ | 91,712 KB |
| 最終ジャッジ日時 | 2026-05-01 11:13:03 |
| 合計ジャッジ時間 | 5,998 ms |
|
ジャッジサーバーID (参考情報) |
judge2_1 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 21 |
ソースコード
import sys
input = sys.stdin.readline
from collections import *
H, W, Q = map(int, input().split())
ans = H*W
d = defaultdict(lambda: H+1)
for _ in range(Q):
Y, X = map(int, input().split())
if Y<d[X]:
ans -= d[X]-Y
d[X] = Y
print(ans)