結果
問題 | No.1338 Giant Class |
ユーザー |
|
提出日時 | 2021-01-15 22:14:41 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
TLE
|
実行時間 | - |
コード長 | 442 bytes |
コンパイル時間 | 1,690 ms |
コンパイル使用メモリ | 175,600 KB |
実行使用メモリ | 665,984 KB |
最終ジャッジ日時 | 2024-11-26 15:45:16 |
合計ジャッジ時間 | 48,012 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 4 WA * 2 TLE * 13 MLE * 2 |
ソースコード
#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; }