結果

問題 No.1338 Giant Class
ユーザー Manuel1024Manuel1024
提出日時 2021-03-21 14:02:51
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 292 ms / 2,000 ms
コード長 536 bytes
コンパイル時間 836 ms
コンパイル使用メモリ 80,336 KB
実行使用メモリ 8,728 KB
最終ジャッジ日時 2023-08-14 10:30:30
合計ジャッジ時間 5,990 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,384 KB
testcase_01 AC 2 ms
4,384 KB
testcase_02 AC 173 ms
4,384 KB
testcase_03 AC 2 ms
4,380 KB
testcase_04 AC 1 ms
4,384 KB
testcase_05 AC 2 ms
4,384 KB
testcase_06 AC 154 ms
6,476 KB
testcase_07 AC 224 ms
7,752 KB
testcase_08 AC 145 ms
6,176 KB
testcase_09 AC 132 ms
5,908 KB
testcase_10 AC 249 ms
8,280 KB
testcase_11 AC 21 ms
4,384 KB
testcase_12 AC 163 ms
5,900 KB
testcase_13 AC 159 ms
6,212 KB
testcase_14 AC 39 ms
4,384 KB
testcase_15 AC 54 ms
4,664 KB
testcase_16 AC 18 ms
4,380 KB
testcase_17 AC 145 ms
6,280 KB
testcase_18 AC 36 ms
4,380 KB
testcase_19 AC 66 ms
4,968 KB
testcase_20 AC 277 ms
8,548 KB
testcase_21 AC 281 ms
8,728 KB
testcase_22 AC 292 ms
8,596 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <vector>
#include <map>
using namespace std;
using ll = long long int;

int main(){
    int h, w, q;
    cin >> h >> w >> q;
    ll ans = (ll)h*w;
    vector<int> y(q), x(q);
    map<int, int> memo;
    for(int i = 0; i < q; i++){
        cin >> y[i] >> x[i];
        memo[x[i]] = h;
    }

    for(int i = 0; i < q; i++){
        if(memo[x[i]] > y[i]-1){
            ans -= memo[x[i]];
            ans += y[i]-1;
            memo[x[i]] = y[i]-1;
        }
        cout << ans << endl;
    }
    return 0;
}
0