結果

問題 No.1338 Giant Class
ユーザー yuuiyuui
提出日時 2021-01-15 21:52:27
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
RE  
実行時間 -
コード長 503 bytes
コンパイル時間 2,014 ms
コンパイル使用メモリ 198,416 KB
実行使用メモリ 813,924 KB
最終ジャッジ日時 2023-08-17 16:51:36
合計ジャッジ時間 5,740 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,384 KB
testcase_01 AC 1 ms
4,376 KB
testcase_02 AC 26 ms
4,380 KB
testcase_03 AC 1 ms
4,384 KB
testcase_04 AC 2 ms
4,380 KB
testcase_05 AC 2 ms
4,380 KB
testcase_06 AC 36 ms
37,792 KB
testcase_07 AC 47 ms
37,964 KB
testcase_08 AC 27 ms
14,392 KB
testcase_09 AC 22 ms
6,468 KB
testcase_10 AC 40 ms
14,644 KB
testcase_11 AC 15 ms
33,452 KB
testcase_12 AC 21 ms
4,380 KB
testcase_13 RE -
testcase_14 AC 136 ms
397,604 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;
    rep(q, Q) {
        int y, x;
        cin >> y >> x;
        --y;
        --x;
        if (minV[x] > y) {
            ans -= (minV[x] - y);
            minV[x] = y;
        }
        cout << ans << "\n";
    }

    return 0;
}
0