結果

問題 No.1338 Giant Class
ユーザー umezoumezo
提出日時 2021-01-15 22:32:57
言語 C++17
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 315 ms / 2,000 ms
コード長 383 bytes
コンパイル時間 2,033 ms
コンパイル使用メモリ 204,524 KB
実行使用メモリ 9,684 KB
最終ジャッジ日時 2023-08-17 17:53:22
合計ジャッジ時間 6,790 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,380 KB
testcase_01 AC 1 ms
4,380 KB
testcase_02 AC 193 ms
4,380 KB
testcase_03 AC 2 ms
4,376 KB
testcase_04 AC 2 ms
4,380 KB
testcase_05 AC 3 ms
4,380 KB
testcase_06 AC 174 ms
7,244 KB
testcase_07 AC 254 ms
8,900 KB
testcase_08 AC 161 ms
6,940 KB
testcase_09 AC 151 ms
6,832 KB
testcase_10 AC 282 ms
9,532 KB
testcase_11 AC 25 ms
4,380 KB
testcase_12 AC 187 ms
6,488 KB
testcase_13 AC 164 ms
7,028 KB
testcase_14 AC 42 ms
4,384 KB
testcase_15 AC 64 ms
4,740 KB
testcase_16 AC 22 ms
4,376 KB
testcase_17 AC 168 ms
7,220 KB
testcase_18 AC 41 ms
4,480 KB
testcase_19 AC 74 ms
5,056 KB
testcase_20 AC 315 ms
9,608 KB
testcase_21 AC 303 ms
9,624 KB
testcase_22 AC 307 ms
9,684 KB
権限があれば一括ダウンロードができます

ソースコード

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