結果

問題 No.1338 Giant Class
ユーザー yuji9511yuji9511
提出日時 2021-01-15 21:42:38
言語 C++17
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 103 ms / 2,000 ms
コード長 1,165 bytes
コンパイル時間 2,149 ms
コンパイル使用メモリ 207,976 KB
実行使用メモリ 11,000 KB
最終ジャッジ日時 2023-08-17 16:31:21
合計ジャッジ時間 5,142 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,380 KB
testcase_01 AC 2 ms
4,376 KB
testcase_02 AC 33 ms
4,664 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 55 ms
8,084 KB
testcase_07 AC 85 ms
9,992 KB
testcase_08 AC 50 ms
7,552 KB
testcase_09 AC 47 ms
7,476 KB
testcase_10 AC 96 ms
10,792 KB
testcase_11 AC 8 ms
4,380 KB
testcase_12 AC 59 ms
7,276 KB
testcase_13 AC 51 ms
7,584 KB
testcase_14 AC 14 ms
4,620 KB
testcase_15 AC 18 ms
4,944 KB
testcase_16 AC 7 ms
4,380 KB
testcase_17 AC 51 ms
7,580 KB
testcase_18 AC 13 ms
4,548 KB
testcase_19 AC 22 ms
5,196 KB
testcase_20 AC 101 ms
11,000 KB
testcase_21 AC 103 ms
10,956 KB
testcase_22 AC 99 ms
10,996 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

/*** author: yuji9511 ***/
#include <bits/stdc++.h>
// #include <atcoder/all>
// using namespace atcoder;
using namespace std;
using ll = long long;
using lpair = pair<ll, ll>;
using vll = vector<ll>;
const ll MOD = 1e9+7;
const ll INF = 1e18;
#define rep(i,m,n) for(ll i=(m);i<(n);i++)
#define rrep(i,m,n) for(ll i=(m);i>=(n);i--)
ostream& operator<<(ostream& os, lpair& h){ os << "(" << h.first << ", " << h.second << ")"; return os;}
#define printa(x,n) for(ll i=0;i<n;i++){cout<<(x[i])<<" \n"[i==n-1];};
void print() {}
template <class H,class... T>
void print(H&& h, T&&... t){cout<<h<<" \n"[sizeof...(t)==0];print(forward<T>(t)...);}

void solve(){
    ll H,W,Q;
    cin >> H >> W >> Q;
    vll Y(Q),X(Q);
    ll ans = H * W;
    map<ll,ll> min_pos;
    rep(i,0,Q){
        cin >> Y[i] >> X[i];
        if(min_pos[X[i]] == 0){
            min_pos[X[i]] = Y[i];
            ans -= H - Y[i] + 1;
        }else{
            if(min_pos[X[i]] > Y[i]){
                ans -= min_pos[X[i]] - Y[i];
                min_pos[X[i]] = Y[i];
            }
        }
        print(ans);
    }

}

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    solve();
}
0