結果

問題 No.1338 Giant Class
ユーザー lloyzlloyz
提出日時 2022-06-05 01:25:04
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 166 ms / 2,000 ms
コード長 337 bytes
コンパイル時間 958 ms
コンパイル使用メモリ 81,672 KB
実行使用メモリ 85,808 KB
最終ジャッジ日時 2023-10-21 02:53:23
合計ジャッジ時間 5,266 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 42 ms
53,432 KB
testcase_01 AC 42 ms
53,432 KB
testcase_02 AC 107 ms
76,196 KB
testcase_03 AC 44 ms
55,504 KB
testcase_04 AC 44 ms
55,504 KB
testcase_05 AC 46 ms
55,504 KB
testcase_06 AC 129 ms
83,192 KB
testcase_07 AC 152 ms
84,416 KB
testcase_08 AC 115 ms
82,476 KB
testcase_09 AC 125 ms
81,708 KB
testcase_10 AC 163 ms
85,344 KB
testcase_11 AC 87 ms
76,944 KB
testcase_12 AC 127 ms
80,780 KB
testcase_13 AC 122 ms
82,476 KB
testcase_14 AC 77 ms
77,040 KB
testcase_15 AC 96 ms
78,976 KB
testcase_16 AC 66 ms
72,768 KB
testcase_17 AC 124 ms
82,172 KB
testcase_18 AC 76 ms
77,020 KB
testcase_19 AC 84 ms
78,784 KB
testcase_20 AC 166 ms
85,808 KB
testcase_21 AC 162 ms
85,732 KB
testcase_22 AC 161 ms
85,576 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import defaultdict
import sys
input = sys.stdin.readline

h, w, q = map(int, input().split())
ans = h * w
N = defaultdict(int)
for _ in range(q):
    y, x = map(int, input().split())
    prev = N[x]
    curr = h - y + 1
    if curr > prev:
        dif = curr - prev
        ans -= dif
        N[x] = curr
    print(ans)
0