結果

問題 No.1338 Giant Class
ユーザー 👑 hitonanodehitonanode
提出日時 2021-01-15 23:42:10
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 55 ms / 2,000 ms
コード長 497 bytes
コンパイル時間 1,820 ms
コンパイル使用メモリ 205,160 KB
実行使用メモリ 8,100 KB
最終ジャッジ日時 2024-05-05 02:05:48
合計ジャッジ時間 3,998 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
5,248 KB
testcase_01 AC 2 ms
5,376 KB
testcase_02 AC 25 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 AC 31 ms
5,924 KB
testcase_07 AC 46 ms
7,968 KB
testcase_08 AC 29 ms
5,672 KB
testcase_09 AC 27 ms
5,672 KB
testcase_10 AC 50 ms
7,972 KB
testcase_11 AC 6 ms
5,376 KB
testcase_12 AC 30 ms
5,632 KB
testcase_13 AC 30 ms
5,668 KB
testcase_14 AC 8 ms
5,376 KB
testcase_15 AC 13 ms
5,376 KB
testcase_16 AC 5 ms
5,376 KB
testcase_17 AC 30 ms
5,800 KB
testcase_18 AC 9 ms
5,376 KB
testcase_19 AC 15 ms
5,376 KB
testcase_20 AC 54 ms
8,100 KB
testcase_21 AC 55 ms
7,844 KB
testcase_22 AC 53 ms
7,972 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
using lint = long long;

int main() {
    cin.tie(nullptr), ios::sync_with_stdio(false);
    lint H, W;
    cin >> H >> W;
    lint ret = H * W;
    int Q;
    cin >> Q;
    unordered_map<int, int> mp;
    while (Q--) {
        int y, x;
        cin >> y >> x;
        if (!mp.count(x)) mp[x] = H + 1;
        if (y < mp[x]) {
            lint d = mp[x] - y;
            mp[x] = y;
            ret -= d;
        }
        cout << ret << '\n';
    }
}
0