結果
| 問題 | 
                            No.1338 Giant Class
                             | 
                    
| コンテスト | |
| ユーザー | 
                             titia
                         | 
                    
| 提出日時 | 2021-01-15 21:37:49 | 
| 言語 | Python3  (3.13.1 + numpy 2.2.1 + scipy 1.14.1)  | 
                    
| 結果 | 
                             
                                AC
                                 
                             
                            
                         | 
                    
| 実行時間 | 310 ms / 2,000 ms | 
| コード長 | 294 bytes | 
| コンパイル時間 | 79 ms | 
| コンパイル使用メモリ | 12,672 KB | 
| 実行使用メモリ | 24,144 KB | 
| 最終ジャッジ日時 | 2024-11-26 13:35:49 | 
| 合計ジャッジ時間 | 5,434 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge4 / judge3 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 2 | 
| other | AC * 21 | 
ソースコード
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)
    
            
            
            
        
            
titia