結果

問題 No.1338 Giant Class
ユーザー norikamenorikame
提出日時 2021-01-15 22:16:26
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 315 ms / 2,000 ms
コード長 1,505 bytes
コンパイル時間 2,148 ms
コンパイル使用メモリ 204,648 KB
実行使用メモリ 8,224 KB
最終ジャッジ日時 2023-08-17 17:31:33
合計ジャッジ時間 7,095 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,380 KB
testcase_01 AC 2 ms
4,376 KB
testcase_02 AC 213 ms
4,376 KB
testcase_03 AC 1 ms
4,380 KB
testcase_04 AC 2 ms
4,380 KB
testcase_05 AC 2 ms
4,380 KB
testcase_06 AC 180 ms
6,456 KB
testcase_07 AC 269 ms
7,688 KB
testcase_08 AC 168 ms
6,096 KB
testcase_09 AC 156 ms
5,872 KB
testcase_10 AC 299 ms
7,928 KB
testcase_11 AC 25 ms
4,380 KB
testcase_12 AC 200 ms
5,696 KB
testcase_13 AC 170 ms
6,052 KB
testcase_14 AC 42 ms
4,380 KB
testcase_15 AC 66 ms
4,444 KB
testcase_16 AC 23 ms
4,376 KB
testcase_17 AC 171 ms
6,260 KB
testcase_18 AC 43 ms
4,376 KB
testcase_19 AC 78 ms
4,632 KB
testcase_20 AC 311 ms
8,224 KB
testcase_21 AC 313 ms
8,144 KB
testcase_22 AC 315 ms
8,220 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

using ll = long long;
using ull = unsigned long long;
#define v(t) vector<t>
#define p(t) pair<t, t>
#define p2(t, s) pair<t, s>
#define vp(t) v(p(t))

#define rep(i, n) for (int i=0,i##_len=((int)(n)); i<i##_len; ++i)
#define rep2(i, a, n) for (int i=((int)(a)),i##_len=((int)(n)); i<=i##_len; ++i)
#define repr(i, n) for (int i=((int)(n)-1); i>=0; --i)
#define rep2r(i, a, n) for (int i=((int)(n)),i##_len=((int)(a)); i>=i##_len; --i)

#define repi(itr, c) for (__typeof((c).begin()) itr=(c).begin(); itr!=(c).end(); ++itr)
#define repir(itr, c) for (__typeof((c).rbegin()) itr=(c).rbegin(); itr!=(c).rend(); ++itr)

#define sz(x) ((int)(x).size())
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()

#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end());
#define RSORT(x) sort(rall(x));
#define pb push_back
#define eb emplace_back

#define INF (1e9)
#define LINF (1e18)
#define PI (acos(-1))
#define EPS (1e-7)
#define DEPS (1e-10)

int main(){
    int h, w;
    int q;
    cin >> h >> w >> q;
    ll val = (ll)(h) * w;
    map<int, int> mval;
    rep(i, q) {
        int yi, xi;
        cin >> yi >> xi;
        --yi;
        int pval = 0;
        if (mval.find(xi) != mval.end()) pval = mval[xi];
        mval[xi] = max(mval[xi], h-yi);
        int diff = abs(mval[xi] - pval);
        val -= diff;
        cout << val << endl;
    }
    return 0;
}
0