結果

問題 No.1338 Giant Class
ユーザー Nzt3Nzt3
提出日時 2021-01-15 22:46:30
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 302 ms / 2,000 ms
コード長 344 bytes
コンパイル時間 1,730 ms
コンパイル使用メモリ 171,188 KB
実行使用メモリ 8,324 KB
最終ジャッジ日時 2023-08-17 18:04:27
合計ジャッジ時間 6,546 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,380 KB
testcase_01 AC 1 ms
4,380 KB
testcase_02 AC 199 ms
4,376 KB
testcase_03 AC 2 ms
4,376 KB
testcase_04 AC 2 ms
4,376 KB
testcase_05 AC 3 ms
4,376 KB
testcase_06 AC 173 ms
6,300 KB
testcase_07 AC 251 ms
7,844 KB
testcase_08 AC 160 ms
6,056 KB
testcase_09 AC 146 ms
5,932 KB
testcase_10 AC 278 ms
7,936 KB
testcase_11 AC 24 ms
4,376 KB
testcase_12 AC 188 ms
5,880 KB
testcase_13 AC 164 ms
6,032 KB
testcase_14 AC 41 ms
4,376 KB
testcase_15 AC 60 ms
4,544 KB
testcase_16 AC 21 ms
4,380 KB
testcase_17 AC 164 ms
6,112 KB
testcase_18 AC 41 ms
4,376 KB
testcase_19 AC 73 ms
4,620 KB
testcase_20 AC 301 ms
8,316 KB
testcase_21 AC 302 ms
8,324 KB
testcase_22 AC 297 ms
8,128 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h> 
using namespace std;
const int64_t mod=1e9+7;
int main(){
  int64_t h,w,q;
  cin>>h>>w>>q;
  int64_t ans=h*w;
  map<int,int>isu;
  int x,y;
  while(q--){
    cin>>y>>x;
    if(!isu.count(x)){
      ans-=h+1-y;
      isu[x]=y;
    }else if(isu[x]>y){
      ans-=isu[x]-y;
      isu[x]=y;
    }
    cout<<ans<<'\n';
  }
}
0