結果

問題 No.1338 Giant Class
ユーザー umezo
提出日時 2021-01-15 22:32:57
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 303 ms / 2,000 ms
コード長 383 bytes
コンパイル時間 2,106 ms
コンパイル使用メモリ 197,488 KB
最終ジャッジ日時 2025-01-17 19:53:29
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 21
権限があれば一括ダウンロードができます

ソースコード

diff #

#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define ALL(v) v.begin(),v.end()
typedef long long ll;

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

int main(){
  ll h,w,q;
  cin>>h>>w>>q;
  
  map<ll,ll> m;
  
  ll ans=h*w;
  rep(i,q){
    ll y,x;
    cin>>y>>x;
    y--,x--;
    
    if(m[x]<h-y){
      ans-=h-y-m[x];
      m[x]=h-y;
    }
    cout<<ans<<endl;
  }
  
  return 0;
}
0