結果

問題 No.1338 Giant Class
ユーザー sten_sansten_san
提出日時 2021-01-16 01:22:13
言語 C++17
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 294 ms / 2,000 ms
コード長 610 bytes
コンパイル時間 2,366 ms
コンパイル使用メモリ 204,100 KB
実行使用メモリ 8,216 KB
最終ジャッジ日時 2023-08-17 20:13:53
合計ジャッジ時間 7,146 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,380 KB
testcase_01 AC 2 ms
4,376 KB
testcase_02 AC 197 ms
4,380 KB
testcase_03 AC 2 ms
4,376 KB
testcase_04 AC 2 ms
4,380 KB
testcase_05 AC 3 ms
4,380 KB
testcase_06 AC 172 ms
6,560 KB
testcase_07 AC 251 ms
7,696 KB
testcase_08 AC 162 ms
6,176 KB
testcase_09 AC 146 ms
5,860 KB
testcase_10 AC 272 ms
7,960 KB
testcase_11 AC 25 ms
4,380 KB
testcase_12 AC 186 ms
5,724 KB
testcase_13 AC 163 ms
6,320 KB
testcase_14 AC 42 ms
4,384 KB
testcase_15 AC 61 ms
4,464 KB
testcase_16 AC 22 ms
4,380 KB
testcase_17 AC 161 ms
6,052 KB
testcase_18 AC 42 ms
4,380 KB
testcase_19 AC 76 ms
4,652 KB
testcase_20 AC 286 ms
8,008 KB
testcase_21 AC 285 ms
8,176 KB
testcase_22 AC 294 ms
8,216 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
template <typename T> using vec = vector<T>;
template <typename T> using vvec = vec<vec<T>>;
template <typename T> using lqueue = priority_queue<T, vector<T>, greater<T>>;
template <typename T> using gqueue = priority_queue<T, vector<T>, less<T>>;

int main() {
    int64_t h, w, q; cin >> h >> w >> q;

    int64_t sub = 0;
    map<int, int> used;
    while (q--) {
        int y, x; cin >> y >> x;
        if (used[x] < h - y + 1) {
            sub += h - y + 1 - used[x];
            used[x] = h - y + 1;
        }
        cout << h * w - sub << endl;
    }
}

0