結果

問題 No.1338 Giant Class
ユーザー CleyLCleyL
提出日時 2022-01-01 21:24:12
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 306 ms / 2,000 ms
コード長 379 bytes
コンパイル時間 991 ms
コンパイル使用メモリ 75,508 KB
実行使用メモリ 9,856 KB
最終ジャッジ日時 2024-04-18 21:32:59
合計ジャッジ時間 6,719 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
5,248 KB
testcase_01 AC 2 ms
5,248 KB
testcase_02 AC 204 ms
5,376 KB
testcase_03 AC 2 ms
5,376 KB
testcase_04 AC 2 ms
5,376 KB
testcase_05 AC 2 ms
5,376 KB
testcase_06 AC 173 ms
7,424 KB
testcase_07 AC 240 ms
9,344 KB
testcase_08 AC 162 ms
7,168 KB
testcase_09 AC 154 ms
6,912 KB
testcase_10 AC 269 ms
9,600 KB
testcase_11 AC 25 ms
5,376 KB
testcase_12 AC 191 ms
6,656 KB
testcase_13 AC 162 ms
7,040 KB
testcase_14 AC 42 ms
5,376 KB
testcase_15 AC 63 ms
5,376 KB
testcase_16 AC 22 ms
5,376 KB
testcase_17 AC 162 ms
7,168 KB
testcase_18 AC 39 ms
5,376 KB
testcase_19 AC 76 ms
5,376 KB
testcase_20 AC 306 ms
9,856 KB
testcase_21 AC 300 ms
9,728 KB
testcase_22 AC 306 ms
9,856 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <map>
using namespace std;
int main(){
  long long h,w,q;cin>>h>>w>>q;
  map<long long,long long> A;
  long long ans = h*w;
  for(int i = 0; q > i; i++){
    long long x,y;cin>>y>>x;
    if(!A.count(x)){
      ans -= h-(y-1);
      A[x] = y-1;
    }else if(A[x] > y-1){
      ans -= A[x]-(y-1);
      A[x] = y-1;
    }
    cout << ans << endl;

  }
}
0