結果
| 問題 | No.1338 Giant Class |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2021-05-25 14:41:00 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 159 ms / 2,000 ms |
| コード長 | 275 bytes |
| 記録 | |
| コンパイル時間 | 266 ms |
| コンパイル使用メモリ | 82,048 KB |
| 実行使用メモリ | 85,380 KB |
| 最終ジャッジ日時 | 2024-10-14 00:40:12 |
| 合計ジャッジ時間 | 5,689 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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)