結果
| 問題 | 
                            No.1338 Giant Class
                             | 
                    
| コンテスト | |
| ユーザー | 
                             paruf4
                         | 
                    
| 提出日時 | 2021-01-15 22:15:47 | 
| 言語 | Python3  (3.13.1 + numpy 2.2.1 + scipy 1.14.1)  | 
                    
| 結果 | 
                             
                                AC
                                 
                             
                            
                         | 
                    
| 実行時間 | 749 ms / 2,000 ms | 
| コード長 | 338 bytes | 
| コンパイル時間 | 404 ms | 
| コンパイル使用メモリ | 12,544 KB | 
| 実行使用メモリ | 24,008 KB | 
| 最終ジャッジ日時 | 2024-11-26 15:49:17 | 
| 合計ジャッジ時間 | 9,632 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge2 / judge5 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 2 | 
| other | AC * 21 | 
ソースコード
from collections import defaultdict
h, w, q = map(int, input().split())
d = defaultdict(lambda: 10**18)
res = h*w
for i in range(q):
    y, x = map(int, input().split())
    if y < d[x]:
        if d[x] == 10**18:
            d[x] = y
            res -= h-d[x]+1
        else:
            res -= d[x]-y
            d[x] = y
    print(res)
            
            
            
        
            
paruf4