結果

問題 No.1338 Giant Class
ユーザー glretoglreto
提出日時 2021-05-14 17:49:58
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 291 ms / 2,000 ms
コード長 560 bytes
コンパイル時間 920 ms
コンパイル使用メモリ 86,504 KB
実行使用メモリ 9,984 KB
最終ジャッジ日時 2024-04-09 21:25:26
合計ジャッジ時間 6,293 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
6,812 KB
testcase_01 AC 2 ms
6,940 KB
testcase_02 AC 189 ms
6,944 KB
testcase_03 AC 2 ms
6,944 KB
testcase_04 AC 2 ms
6,944 KB
testcase_05 AC 2 ms
6,944 KB
testcase_06 AC 162 ms
7,424 KB
testcase_07 AC 247 ms
9,088 KB
testcase_08 AC 151 ms
7,040 KB
testcase_09 AC 142 ms
6,940 KB
testcase_10 AC 265 ms
9,600 KB
testcase_11 AC 24 ms
6,940 KB
testcase_12 AC 176 ms
6,940 KB
testcase_13 AC 157 ms
7,168 KB
testcase_14 AC 42 ms
6,940 KB
testcase_15 AC 59 ms
6,940 KB
testcase_16 AC 22 ms
6,944 KB
testcase_17 AC 170 ms
7,168 KB
testcase_18 AC 39 ms
6,940 KB
testcase_19 AC 72 ms
6,940 KB
testcase_20 AC 280 ms
9,984 KB
testcase_21 AC 282 ms
9,856 KB
testcase_22 AC 291 ms
9,728 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include<map>
#include<set>
#include<vector>
#include<algorithm>
#include<numeric>
#include<math.h>
using ll = long long;
#define rep(i,n) for(int i = 0;i<n;i++)
#define req(i,n) for(int i = 1;i<=n;i++)
#define rrep(i,n) for(int i = n-1;i>=0;i++)
#define ALL(a) a.begin(),a.end()
using namespace std;
int main(){
    ll h, w, q, x, y; cin >> h >> w >> q;
    map<int, ll> mp; ll sum = h*w,cnt=0;
    rep(i, q) {
        cin >> y >> x;
        if (mp[x] < (h - y + 1))sum-= (h-y+1)-mp[x],mp[x] = h - y+1;
        cout << sum << endl;
    }
}
0