結果

問題 No.1338 Giant Class
ユーザー 夜
提出日時 2021-01-15 21:45:30
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 329 ms / 2,000 ms
コード長 705 bytes
コンパイル時間 1,078 ms
コンパイル使用メモリ 112,480 KB
実行使用メモリ 11,264 KB
最終ジャッジ日時 2024-05-04 23:16:30
合計ジャッジ時間 5,792 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
5,248 KB
testcase_01 AC 1 ms
5,376 KB
testcase_02 AC 200 ms
5,376 KB
testcase_03 AC 2 ms
5,376 KB
testcase_04 AC 2 ms
5,376 KB
testcase_05 AC 3 ms
5,376 KB
testcase_06 AC 177 ms
8,448 KB
testcase_07 AC 267 ms
10,496 KB
testcase_08 AC 170 ms
8,064 KB
testcase_09 AC 154 ms
7,680 KB
testcase_10 AC 289 ms
11,264 KB
testcase_11 AC 24 ms
5,376 KB
testcase_12 AC 182 ms
7,680 KB
testcase_13 AC 164 ms
7,808 KB
testcase_14 AC 41 ms
5,376 KB
testcase_15 AC 64 ms
5,376 KB
testcase_16 AC 21 ms
5,376 KB
testcase_17 AC 171 ms
7,936 KB
testcase_18 AC 41 ms
5,376 KB
testcase_19 AC 75 ms
5,632 KB
testcase_20 AC 321 ms
11,264 KB
testcase_21 AC 329 ms
11,264 KB
testcase_22 AC 327 ms
11,264 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <iomanip>
#include <cmath>
#include <stdio.h>
#include <queue>
#include <deque>
#include <cstdio>
#include <set>
#include <map>
#include <bitset>
#include <stack>
#include <cctype>
using namespace std;
map<long long, long long> m;
long long y[100010], x[100010];
int main() {
    long long h, w, q;
    cin >> h >> w >> q;
    long long ans = h * w;
    for (int i = 0; i < q; i++) {
        cin >> y[i] >> x[i];
        m[x[i]] = h + 1;
    }
    for (int i = 0; i < q; i++) {
        if (m[x[i]] > y[i]) {
            ans -= (m[x[i]] - y[i]);
            m[x[i]] = y[i];
        }
        cout << ans << endl;
    }
}
0