結果

問題 No.1338 Giant Class
ユーザー AngrySadEightAngrySadEight
提出日時 2021-01-15 21:55:49
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 289 ms / 2,000 ms
コード長 516 bytes
コンパイル時間 2,117 ms
コンパイル使用メモリ 172,680 KB
実行使用メモリ 9,728 KB
最終ジャッジ日時 2024-05-04 23:37:49
合計ジャッジ時間 5,877 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
5,248 KB
testcase_01 AC 2 ms
5,376 KB
testcase_02 AC 189 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 159 ms
7,424 KB
testcase_07 AC 230 ms
9,216 KB
testcase_08 AC 153 ms
7,040 KB
testcase_09 AC 158 ms
6,912 KB
testcase_10 AC 289 ms
9,600 KB
testcase_11 AC 27 ms
5,376 KB
testcase_12 AC 174 ms
6,656 KB
testcase_13 AC 163 ms
7,040 KB
testcase_14 AC 40 ms
5,376 KB
testcase_15 AC 60 ms
5,376 KB
testcase_16 AC 22 ms
5,376 KB
testcase_17 AC 167 ms
6,940 KB
testcase_18 AC 40 ms
5,376 KB
testcase_19 AC 70 ms
5,376 KB
testcase_20 AC 272 ms
9,728 KB
testcase_21 AC 269 ms
9,728 KB
testcase_22 AC 269 ms
9,728 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