結果

問題 No.1338 Giant Class
ユーザー chocoruskchocorusk
提出日時 2021-01-15 21:52:16
言語 C++17
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 290 ms / 2,000 ms
コード長 920 bytes
コンパイル時間 1,224 ms
コンパイル使用メモリ 133,648 KB
実行使用メモリ 9,592 KB
最終ジャッジ日時 2023-08-17 16:51:21
合計ジャッジ時間 6,022 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,376 KB
testcase_01 AC 1 ms
4,376 KB
testcase_02 AC 202 ms
4,380 KB
testcase_03 AC 2 ms
4,380 KB
testcase_04 AC 2 ms
4,384 KB
testcase_05 AC 2 ms
4,376 KB
testcase_06 AC 170 ms
7,276 KB
testcase_07 AC 246 ms
8,944 KB
testcase_08 AC 155 ms
6,964 KB
testcase_09 AC 143 ms
6,712 KB
testcase_10 AC 268 ms
9,480 KB
testcase_11 AC 25 ms
4,380 KB
testcase_12 AC 182 ms
6,396 KB
testcase_13 AC 155 ms
6,876 KB
testcase_14 AC 41 ms
4,380 KB
testcase_15 AC 61 ms
5,020 KB
testcase_16 AC 21 ms
4,380 KB
testcase_17 AC 159 ms
7,120 KB
testcase_18 AC 41 ms
4,380 KB
testcase_19 AC 75 ms
5,016 KB
testcase_20 AC 290 ms
9,588 KB
testcase_21 AC 290 ms
9,584 KB
testcase_22 AC 286 ms
9,592 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <cstdio>
#include <cstring>
#include <iostream>
#include <string>
#include <cmath>
#include <bitset>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <algorithm>
#include <complex>
#include <unordered_map>
#include <unordered_set>
#include <random>
#include <cassert>
#include <fstream>
#include <utility>
#include <functional>
#include <stack>
#include <array>
#include <list>
#define popcount __builtin_popcount
using namespace std;
typedef long long int ll;
typedef pair<int, int> P;

int main()
{
    ll h, w;
    int q; cin>>h>>w>>q;
    ll s=0;
    map<ll, ll> mp;
    for(int i=0; i<q; i++){
        ll y, x; cin>>y>>x;
        if(mp.find(x)!=mp.end()){
            if(mp[x]>y){
                s+=mp[x]-y;
                mp[x]=y;
            }
        }else{
            s+=h-y+1;
            mp[x]=y;
        }
        cout<<h*w-s<<endl;
    }
    return 0;
}
0