結果

問題 No.1338 Giant Class
ユーザー 👑 deuteridayodeuteridayo
提出日時 2021-01-17 13:59:26
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 248 ms / 2,000 ms
コード長 694 bytes
コンパイル時間 1,982 ms
コンパイル使用メモリ 170,256 KB
実行使用メモリ 9,192 KB
最終ジャッジ日時 2023-08-19 19:48:21
合計ジャッジ時間 6,747 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,380 KB
testcase_01 AC 1 ms
4,376 KB
testcase_02 AC 193 ms
4,968 KB
testcase_03 AC 2 ms
4,376 KB
testcase_04 AC 2 ms
4,376 KB
testcase_05 AC 2 ms
4,376 KB
testcase_06 AC 141 ms
6,600 KB
testcase_07 AC 205 ms
8,920 KB
testcase_08 AC 135 ms
6,364 KB
testcase_09 AC 125 ms
6,400 KB
testcase_10 AC 224 ms
9,192 KB
testcase_11 AC 22 ms
4,376 KB
testcase_12 AC 157 ms
6,388 KB
testcase_13 AC 137 ms
6,336 KB
testcase_14 AC 37 ms
4,376 KB
testcase_15 AC 55 ms
4,568 KB
testcase_16 AC 20 ms
4,376 KB
testcase_17 AC 136 ms
6,392 KB
testcase_18 AC 37 ms
4,380 KB
testcase_19 AC 66 ms
4,724 KB
testcase_20 AC 240 ms
9,100 KB
testcase_21 AC 248 ms
9,144 KB
testcase_22 AC 242 ms
9,156 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