結果
| 問題 | 
                            No.1338 Giant Class
                             | 
                    
| コンテスト | |
| ユーザー | 
                             glreto
                         | 
                    
| 提出日時 | 2021-05-14 17:49:58 | 
| 言語 | C++14  (gcc 13.3.0 + boost 1.87.0)  | 
                    
| 結果 | 
                             
                                AC
                                 
                             
                            
                         | 
                    
| 実行時間 | 257 ms / 2,000 ms | 
| コード長 | 560 bytes | 
| コンパイル時間 | 935 ms | 
| コンパイル使用メモリ | 87,128 KB | 
| 実行使用メモリ | 9,728 KB | 
| 最終ジャッジ日時 | 2024-10-01 21:53:00 | 
| 合計ジャッジ時間 | 6,032 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge3 / judge1 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 2 | 
| other | AC * 21 | 
ソースコード
#include <iostream>
#include<map>
#include<set>
#include<vector>
#include<algorithm>
#include<numeric>
#include<math.h>
using ll = long long;
#define rep(i,n) for(int i = 0;i<n;i++)
#define req(i,n) for(int i = 1;i<=n;i++)
#define rrep(i,n) for(int i = n-1;i>=0;i++)
#define ALL(a) a.begin(),a.end()
using namespace std;
int main(){
    ll h, w, q, x, y; cin >> h >> w >> q;
    map<int, ll> mp; ll sum = h*w,cnt=0;
    rep(i, q) {
        cin >> y >> x;
        if (mp[x] < (h - y + 1))sum-= (h-y+1)-mp[x],mp[x] = h - y+1;
        cout << sum << endl;
    }
}
            
            
            
        
            
glreto