結果
| 問題 | No.1338 Giant Class |
| コンテスト | |
| ユーザー |
nephrologist
|
| 提出日時 | 2021-01-15 23:24:47 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
AC
|
| 実行時間 | 90 ms / 2,000 ms |
| コード長 | 450 bytes |
| 記録 | |
| コンパイル時間 | 186 ms |
| コンパイル使用メモリ | 85,280 KB |
| 実行使用メモリ | 92,896 KB |
| 最終ジャッジ日時 | 2026-05-21 03:34:06 |
| 合計ジャッジ時間 | 3,751 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 21 |
ソースコード
import sys
input = sys.stdin.buffer.readline
h, w, q = map(int, input().split())
memo = {}
temp = 0
for _ in range(q):
y, x = map(int, input().split())
y -= 1
x -= 1
if x in memo:
pre = memo[x]
if pre < y:
print(h * w - temp)
else:
memo[x] = y
temp += pre - y
print(h * w - temp)
else:
memo[x] = y
temp += h - y
print(h * w - temp)
nephrologist