結果

問題 No.1338 Giant Class
ユーザー 🍮かんプリン🍮かんプリン
提出日時 2021-01-15 23:21:16
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 306 ms / 2,000 ms
コード長 576 bytes
コンパイル時間 1,899 ms
コンパイル使用メモリ 172,196 KB
実行使用メモリ 9,884 KB
最終ジャッジ日時 2023-08-17 18:35:23
合計ジャッジ時間 6,752 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,376 KB
testcase_01 AC 2 ms
4,376 KB
testcase_02 AC 208 ms
4,376 KB
testcase_03 AC 2 ms
4,380 KB
testcase_04 AC 2 ms
4,380 KB
testcase_05 AC 2 ms
4,376 KB
testcase_06 AC 170 ms
7,320 KB
testcase_07 AC 256 ms
8,900 KB
testcase_08 AC 163 ms
7,256 KB
testcase_09 AC 149 ms
6,708 KB
testcase_10 AC 284 ms
9,496 KB
testcase_11 AC 24 ms
4,376 KB
testcase_12 AC 197 ms
6,492 KB
testcase_13 AC 164 ms
6,968 KB
testcase_14 AC 41 ms
4,376 KB
testcase_15 AC 61 ms
4,844 KB
testcase_16 AC 22 ms
4,380 KB
testcase_17 AC 162 ms
6,940 KB
testcase_18 AC 41 ms
4,384 KB
testcase_19 AC 75 ms
5,096 KB
testcase_20 AC 306 ms
9,884 KB
testcase_21 AC 303 ms
9,624 KB
testcase_22 AC 306 ms
9,884 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

/**
 *   @FileName	a.cpp
 *   @Author	kanpurin
 *   @Created	2021.01.15 23:21:12
**/

#include "bits/stdc++.h" 
using namespace std; 
typedef long long ll;

int main() {
    ll h,w,q;cin >> h >> w >> q;
    map<ll,ll> mp;
    ll ans = h * w;
    for (int i = 0; i < q; i++) {
        ll y,x;cin >> y >> x;
        if (mp.find(x) != mp.end()) {
            ans += h-mp[x]+1;
            mp[x] = min(mp[x],y);
            ans -= h-mp[x]+1;
        }
        else {
            mp[x] = y;
            ans -= h - y + 1;
        }
        cout << ans << endl;
    }
    return 0;
}
0