結果

問題 No.1338 Giant Class
ユーザー first_vilfirst_vil
提出日時 2020-07-08 00:23:09
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 146 ms / 2,000 ms
コード長 314 bytes
コンパイル時間 268 ms
コンパイル使用メモリ 82,176 KB
実行使用メモリ 85,016 KB
最終ジャッジ日時 2024-04-19 02:52:05
合計ジャッジ時間 3,939 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 41 ms
51,456 KB
testcase_01 AC 43 ms
51,712 KB
testcase_02 AC 109 ms
76,160 KB
testcase_03 AC 39 ms
51,712 KB
testcase_04 AC 41 ms
52,480 KB
testcase_05 AC 42 ms
52,736 KB
testcase_06 AC 106 ms
83,072 KB
testcase_07 AC 129 ms
83,620 KB
testcase_08 AC 114 ms
82,816 KB
testcase_09 AC 110 ms
81,152 KB
testcase_10 AC 144 ms
84,828 KB
testcase_11 AC 66 ms
71,168 KB
testcase_12 AC 133 ms
82,300 KB
testcase_13 AC 107 ms
83,456 KB
testcase_14 AC 75 ms
77,056 KB
testcase_15 AC 79 ms
78,336 KB
testcase_16 AC 66 ms
70,272 KB
testcase_17 AC 108 ms
83,456 KB
testcase_18 AC 77 ms
77,312 KB
testcase_19 AC 82 ms
78,976 KB
testcase_20 AC 146 ms
84,212 KB
testcase_21 AC 132 ms
84,092 KB
testcase_22 AC 141 ms
85,016 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.readline
def main():
    h,w,q=map(int,input().split())
    ans=h*w
    d={}
    for _ in range(q):
        y,x=map(int,input().split())
        if x not in d:d[x]=h+1
        ans -= max(0, d[x] - y);
        d[x]=min(d[x],y)
        print(ans)
    
if __name__=='__main__':
    main()
0