結果

問題 No.1338 Giant Class
ユーザー paya2paya2
提出日時 2021-01-22 00:47:32
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
RE  
実行時間 -
コード長 750 bytes
コンパイル時間 771 ms
コンパイル使用メモリ 90,260 KB
実行使用メモリ 814,504 KB
最終ジャッジ日時 2023-08-26 16:18:51
合計ジャッジ時間 7,225 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,380 KB
testcase_01 AC 2 ms
4,376 KB
testcase_02 AC 185 ms
5,772 KB
testcase_03 AC 2 ms
4,376 KB
testcase_04 AC 2 ms
4,376 KB
testcase_05 AC 2 ms
4,376 KB
testcase_06 AC 152 ms
73,776 KB
testcase_07 AC 206 ms
74,528 KB
testcase_08 AC 126 ms
26,500 KB
testcase_09 AC 114 ms
10,804 KB
testcase_10 AC 211 ms
27,792 KB
testcase_11 AC 36 ms
64,360 KB
testcase_12 AC 141 ms
5,240 KB
testcase_13 RE -
testcase_14 MLE -
testcase_15 MLE -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
#include<vector>
#include <cmath>
#include <map>
#include <set>
#include <algorithm>
#include <string>
#include <iomanip>
#include <queue>
#define rep(i,n) for (int i= 0;i<(n);++i)
using namespace std;
typedef long long ll;
using Graph = vector<vector<int>>;
int main()
{   
    ll H , W , Q;
    cin >> H >> W >> Q ;
    ll y[Q] , x[Q] ;
    ll h[W] ;
    for(ll j = 0 ; j < W ; j++){
         h[j] = H ; ;
    }
    for(ll i = 0 ; i < Q ; i++){
        cin >> y[i] >> x[i] ;
    }

    ll ans = H * W ;

    for(ll i= 0 ; i < Q ; i++){
        //cout << h[x[i]-1] << endl; 
        if(h[x[i]-1] >= y[i]){
            ans -= h[x[i]-1] - y[i] + 1 ;
            h[x[i]-1] = y[i] -1;
        }
        cout << ans << endl;
    }



}
0