結果

問題 No.1338 Giant Class
ユーザー nephrologistnephrologist
提出日時 2021-01-15 23:24:47
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 185 ms / 2,000 ms
コード長 450 bytes
コンパイル時間 1,398 ms
コンパイル使用メモリ 86,868 KB
実行使用メモリ 87,620 KB
最終ジャッジ日時 2023-08-17 19:07:12
合計ジャッジ時間 6,562 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 74 ms
71,180 KB
testcase_01 AC 73 ms
70,996 KB
testcase_02 AC 134 ms
77,372 KB
testcase_03 AC 78 ms
71,180 KB
testcase_04 AC 75 ms
71,080 KB
testcase_05 AC 75 ms
71,260 KB
testcase_06 AC 148 ms
85,108 KB
testcase_07 AC 161 ms
85,832 KB
testcase_08 AC 145 ms
85,880 KB
testcase_09 AC 137 ms
85,168 KB
testcase_10 AC 177 ms
87,620 KB
testcase_11 AC 115 ms
77,916 KB
testcase_12 AC 139 ms
83,004 KB
testcase_13 AC 140 ms
84,856 KB
testcase_14 AC 96 ms
77,784 KB
testcase_15 AC 115 ms
79,876 KB
testcase_16 AC 93 ms
76,616 KB
testcase_17 AC 140 ms
83,724 KB
testcase_18 AC 96 ms
77,604 KB
testcase_19 AC 105 ms
79,420 KB
testcase_20 AC 175 ms
87,356 KB
testcase_21 AC 185 ms
86,588 KB
testcase_22 AC 170 ms
85,996 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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)
0