結果

問題 No.1338 Giant Class
ユーザー 👑 deuteridayodeuteridayo
提出日時 2021-01-17 13:48:06
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
TLE  
実行時間 -
コード長 674 bytes
コンパイル時間 1,908 ms
コンパイル使用メモリ 172,776 KB
実行使用メモリ 10,880 KB
最終ジャッジ日時 2024-05-07 02:28:37
合計ジャッジ時間 6,158 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

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;
    for(int i=0;i<q;i++){
        cin >> y[i] >> x[i];
        if(mapp[x[i]] == 0){
            mapp[x[i]] = y[i];
        }else{
            mapp[x[i]] = min(mapp[x[i]], y[i]);
        }
        lint ans = 0;
        ans += (w - mapp.size()) * h;
        for(auto p : mapp){
            ans += p.second - 1;
        }
        cout << ans << endl;
    }
}
0