結果

問題 No.1338 Giant Class
ユーザー mmn15277198mmn15277198
提出日時 2021-02-09 14:51:18
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 284 ms / 2,000 ms
コード長 577 bytes
コンパイル時間 699 ms
コンパイル使用メモリ 80,724 KB
実行使用メモリ 8,148 KB
最終ジャッジ日時 2023-09-21 01:54:09
合計ジャッジ時間 6,821 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,380 KB
testcase_01 AC 1 ms
4,380 KB
testcase_02 AC 198 ms
4,380 KB
testcase_03 AC 2 ms
4,380 KB
testcase_04 AC 2 ms
4,380 KB
testcase_05 AC 2 ms
4,376 KB
testcase_06 AC 164 ms
6,536 KB
testcase_07 AC 239 ms
7,452 KB
testcase_08 AC 155 ms
6,176 KB
testcase_09 AC 143 ms
5,872 KB
testcase_10 AC 268 ms
7,932 KB
testcase_11 AC 24 ms
4,376 KB
testcase_12 AC 180 ms
5,600 KB
testcase_13 AC 157 ms
5,960 KB
testcase_14 AC 40 ms
4,376 KB
testcase_15 AC 60 ms
4,520 KB
testcase_16 AC 21 ms
4,376 KB
testcase_17 AC 158 ms
6,012 KB
testcase_18 AC 40 ms
4,376 KB
testcase_19 AC 72 ms
4,588 KB
testcase_20 AC 278 ms
8,052 KB
testcase_21 AC 284 ms
8,148 KB
testcase_22 AC 283 ms
7,980 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <vector>
#include <algorithm>
#include <map>

using namespace std;
using ll = long long;

const int INF = 100100100;

int main(){
    int h , w , q;
    cin >> h >> w >> q;
    map<int , int> mp;

    ll now = (ll)h * w;
    while(q--){
       int y , x;
       cin >> y >> x;
       if(mp[x] == 0){
           now -= (h - y + 1);
           mp[x] = y;
       }else{
           if(mp[x] <= y){
           }else{
               now -=(mp[x] - y);
               mp[x] = y;
           }
       }
       cout << now << endl;
    }
    
    return 0;
}
0