結果

問題 No.1338 Giant Class
ユーザー 👑 deuteridayodeuteridayo
提出日時 2021-01-17 13:59:26
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 255 ms / 2,000 ms
コード長 694 bytes
コンパイル時間 1,648 ms
コンパイル使用メモリ 172,740 KB
実行使用メモリ 9,380 KB
最終ジャッジ日時 2024-05-07 02:43:33
合計ジャッジ時間 5,963 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
6,816 KB
testcase_01 AC 2 ms
6,944 KB
testcase_02 AC 194 ms
6,940 KB
testcase_03 AC 2 ms
6,944 KB
testcase_04 AC 2 ms
6,944 KB
testcase_05 AC 3 ms
6,944 KB
testcase_06 AC 149 ms
6,940 KB
testcase_07 AC 209 ms
9,256 KB
testcase_08 AC 130 ms
6,944 KB
testcase_09 AC 126 ms
6,940 KB
testcase_10 AC 236 ms
9,256 KB
testcase_11 AC 23 ms
6,940 KB
testcase_12 AC 159 ms
6,940 KB
testcase_13 AC 144 ms
6,944 KB
testcase_14 AC 38 ms
6,940 KB
testcase_15 AC 56 ms
6,944 KB
testcase_16 AC 20 ms
6,940 KB
testcase_17 AC 140 ms
6,940 KB
testcase_18 AC 37 ms
6,944 KB
testcase_19 AC 66 ms
6,944 KB
testcase_20 AC 255 ms
9,272 KB
testcase_21 AC 252 ms
9,380 KB
testcase_22 AC 249 ms
9,268 KB
権限があれば一括ダウンロードができます

ソースコード

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] + 1);
        }else{
            if(mapp[x[i]] > y[i]){
                ans -= mapp[x[i]] - y[i];
                mapp[x[i]] = y[i];
            }
        }
        
        
        cout << ans << endl;
    }
}
0