結果

問題 No.1338 Giant Class
ユーザー titiatitia
提出日時 2021-01-15 21:37:49
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 259 ms / 2,000 ms
コード長 294 bytes
コンパイル時間 372 ms
コンパイル使用メモリ 10,612 KB
実行使用メモリ 21,496 KB
最終ジャッジ日時 2023-08-17 16:22:27
合計ジャッジ時間 4,907 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,832 KB
testcase_01 AC 16 ms
7,756 KB
testcase_02 AC 207 ms
8,228 KB
testcase_03 AC 15 ms
7,940 KB
testcase_04 AC 16 ms
7,832 KB
testcase_05 AC 16 ms
7,812 KB
testcase_06 AC 160 ms
14,752 KB
testcase_07 AC 224 ms
21,424 KB
testcase_08 AC 153 ms
14,648 KB
testcase_09 AC 141 ms
14,728 KB
testcase_10 AC 252 ms
21,496 KB
testcase_11 AC 37 ms
8,896 KB
testcase_12 AC 185 ms
14,636 KB
testcase_13 AC 154 ms
14,552 KB
testcase_14 AC 53 ms
9,728 KB
testcase_15 AC 69 ms
11,368 KB
testcase_16 AC 34 ms
8,888 KB
testcase_17 AC 150 ms
14,668 KB
testcase_18 AC 51 ms
9,680 KB
testcase_19 AC 79 ms
11,468 KB
testcase_20 AC 258 ms
21,416 KB
testcase_21 AC 250 ms
21,444 KB
testcase_22 AC 259 ms
21,404 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.readline

H,W,Q=map(int,input().split())

D=dict()
MINUS=0

for i in range(Q):
    y,x=map(int,input().split())

    if x in D:
        if y<D[x]:
            MINUS+=D[x]-y
            D[x]=y
    else:
        D[x]=y
        MINUS+=H-y+1

    print(H*W-MINUS)
    
0