結果

問題 No.1338 Giant Class
ユーザー HaaHaa
提出日時 2021-01-15 21:40:48
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 306 ms / 2,000 ms
コード長 528 bytes
コンパイル時間 1,720 ms
コンパイル使用メモリ 171,328 KB
実行使用メモリ 8,088 KB
最終ジャッジ日時 2023-08-17 16:28:02
合計ジャッジ時間 7,213 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,380 KB
testcase_01 AC 2 ms
4,380 KB
testcase_02 AC 206 ms
4,376 KB
testcase_03 AC 2 ms
4,376 KB
testcase_04 AC 3 ms
4,380 KB
testcase_05 AC 3 ms
4,376 KB
testcase_06 AC 176 ms
6,360 KB
testcase_07 AC 257 ms
7,532 KB
testcase_08 AC 163 ms
6,056 KB
testcase_09 AC 151 ms
5,828 KB
testcase_10 AC 279 ms
8,012 KB
testcase_11 AC 25 ms
4,384 KB
testcase_12 AC 191 ms
5,656 KB
testcase_13 AC 166 ms
5,992 KB
testcase_14 AC 42 ms
4,380 KB
testcase_15 AC 63 ms
4,444 KB
testcase_16 AC 22 ms
4,380 KB
testcase_17 AC 166 ms
6,000 KB
testcase_18 AC 42 ms
4,376 KB
testcase_19 AC 77 ms
4,624 KB
testcase_20 AC 303 ms
8,088 KB
testcase_21 AC 302 ms
8,008 KB
testcase_22 AC 306 ms
8,056 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef pair<ll,ll> P;
typedef vector<ll> VI;
typedef vector<VI> VVI;
#define REP(i,n) for(int i=0;i<(n);i++)
#define ALL(v) v.begin(),v.end()
constexpr ll MOD=1000000007;
constexpr ll INF=1e18;

int main(){
    int h, w, q; cin >> h >> w >> q;
    ll ans=(ll)h*w;
    int x, y;
    map<int,int> mp;
    REP(i,q){
        cin >> y >> x;
        ans-=max(0,(h-y+1)-mp[x]);
        cout << ans << endl;
        mp[x]=max(mp[x],(h-y+1));
    }
    return 0;
}
0