結果

問題 No.1338 Giant Class
ユーザー 👑 deuteridayodeuteridayo
提出日時 2021-01-17 13:58:22
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 690 bytes
コンパイル時間 1,765 ms
コンパイル使用メモリ 172,864 KB
実行使用メモリ 9,404 KB
最終ジャッジ日時 2024-05-07 02:42:25
合計ジャッジ時間 7,145 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
// #include<atcoder/all>
using namespace std;
// using namespace atcoder;
using lint = long long;
#define endl '\n'
lint const mod = 1e9+7;
//long const mod = 998244353;

    lint h,w,q;

    lint y[100000];
    lint x[100000];
unordered_map<lint,lint>mapp;

int main(){
    cin >> h >> w >> q;
    lint ans = h*w;
    for(int i=0;i<q;i++){
        cin >> y[i] >> x[i];
        if(mapp[x[i]] == 0){
            mapp[x[i]] = y[i];
            ans -= (h - y[i]);
        }else{
            if(mapp[x[i]] > y[i]){
                ans -= mapp[x[i]] - y[i];
                mapp[x[i]] = y[i];
            }
        }
        
        
        cout << ans << endl;
    }
}
0