結果
| 問題 | No.1338 Giant Class |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2021-01-15 22:25:31 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.89.0) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 487 bytes |
| 記録 | |
| コンパイル時間 | 1,762 ms |
| コンパイル使用メモリ | 176,308 KB |
| 実行使用メモリ | 633,728 KB |
| 最終ジャッジ日時 | 2024-11-26 16:09:26 |
| 合計ジャッジ時間 | 48,271 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 4 WA * 1 TLE * 8 MLE * 8 |
ソースコード
#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(){
ios::sync_with_stdio(0);
cin.tie(0);
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;
}