結果

問題 No.1338 Giant Class
ユーザー AngrySadEightAngrySadEight
提出日時 2021-01-15 21:55:49
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 317 ms / 2,000 ms
コード長 516 bytes
コンパイル時間 1,530 ms
コンパイル使用メモリ 172,156 KB
実行使用メモリ 9,660 KB
最終ジャッジ日時 2023-08-17 16:57:34
合計ジャッジ時間 6,612 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,376 KB
testcase_01 AC 1 ms
4,380 KB
testcase_02 AC 196 ms
4,380 KB
testcase_03 AC 2 ms
4,376 KB
testcase_04 AC 2 ms
4,376 KB
testcase_05 AC 2 ms
4,380 KB
testcase_06 AC 183 ms
7,308 KB
testcase_07 AC 268 ms
8,924 KB
testcase_08 AC 164 ms
6,980 KB
testcase_09 AC 157 ms
6,804 KB
testcase_10 AC 300 ms
9,516 KB
testcase_11 AC 25 ms
4,376 KB
testcase_12 AC 194 ms
6,440 KB
testcase_13 AC 170 ms
7,176 KB
testcase_14 AC 42 ms
4,380 KB
testcase_15 AC 64 ms
4,820 KB
testcase_16 AC 22 ms
4,380 KB
testcase_17 AC 172 ms
6,984 KB
testcase_18 AC 43 ms
4,424 KB
testcase_19 AC 78 ms
4,988 KB
testcase_20 AC 311 ms
9,584 KB
testcase_21 AC 317 ms
9,660 KB
testcase_22 AC 314 ms
9,660 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i = 0; i < (int)(n); i++)
#define repr(i,n) for(int i = (int)(n); i >= 0; i--)
#define all(v) v.begin(),v.end()
typedef long long ll;

int main(){
    ll H,W,Q;
    cin >> H >> W >> Q;
    ll ans = H * W;
    map<ll,ll> mp;
    for (ll i = 0; i < Q; i++){
        ll Y,X;
        cin >> Y >> X;
        if (mp[X] < H - Y + 1){
            ans -= (H - Y + 1 - mp[X]);
            mp[X] = H - Y + 1;
        }
        cout << ans << endl;
    }
}
0