結果

問題 No.1338 Giant Class
ユーザー kaede2020kaede2020
提出日時 2021-01-15 22:14:41
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
TLE  
実行時間 -
コード長 442 bytes
コンパイル時間 1,467 ms
コンパイル使用メモリ 175,232 KB
実行使用メモリ 524,800 KB
最終ジャッジ日時 2024-05-05 00:09:22
合計ジャッジ時間 6,153 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
10,752 KB
testcase_01 AC 2 ms
5,376 KB
testcase_02 AC 253 ms
9,600 KB
testcase_03 AC 2 ms
5,376 KB
testcase_04 AC 2 ms
5,376 KB
testcase_05 AC 3 ms
5,376 KB
testcase_06 TLE -
testcase_07 WA -
testcase_08 MLE -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)

int main(){
    ll h,w,q;
    cin>>h>>w>>q;
    map<ll,ll>a;
    ll ans=h*w;
    for(int i=1;i<=h;i++)a[i]=h+1;
    rep(i,q){
        ll y,x;
        cin>>y>>x;
        ll tmp=a[x];
        a[x]=min(tmp,y);
        //cout<<a[x]<<" "<<tmp<<endl;
        ans-=max(0LL,tmp-a[x]);
        cout<<ans<<endl;
    }
    return 0;
}
0