結果

問題 No.1338 Giant Class
ユーザー yuuiyuui
提出日時 2021-01-15 21:59:33
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
RE  
実行時間 -
コード長 499 bytes
コンパイル時間 2,002 ms
コンパイル使用メモリ 200,112 KB
実行使用メモリ 811,444 KB
最終ジャッジ日時 2023-08-17 17:04:22
合計ジャッジ時間 5,192 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,376 KB
testcase_01 AC 1 ms
4,380 KB
testcase_02 AC 26 ms
4,376 KB
testcase_03 AC 1 ms
4,376 KB
testcase_04 AC 1 ms
4,384 KB
testcase_05 AC 2 ms
4,380 KB
testcase_06 AC 38 ms
37,712 KB
testcase_07 AC 47 ms
37,920 KB
testcase_08 AC 27 ms
14,356 KB
testcase_09 AC 21 ms
6,456 KB
testcase_10 AC 43 ms
14,712 KB
testcase_11 AC 17 ms
33,456 KB
testcase_12 AC 22 ms
4,380 KB
testcase_13 RE -
testcase_14 AC 147 ms
397,728 KB
testcase_15 MLE -
testcase_16 MLE -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    ll H, W, Q;
    cin >> H >> W >> Q;
    vector<int> minV(W, H);
    ll ans = H * W;
    int y, x;
    rep(q, Q) {
        cin >> y >> x;
        --y;
        --x;
        if (minV[x] > y) {
            ans -= (minV[x] - y);
            minV[x] = y;
        }
        cout << ans << "\n";
    }

    return 0;
}
0