結果

問題 No.1338 Giant Class
ユーザー Manuel1024
提出日時 2021-03-21 13:57:31
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
RE  
実行時間 -
コード長 426 bytes
コンパイル時間 553 ms
コンパイル使用メモリ 68,608 KB
実行使用メモリ 816,384 KB
最終ジャッジ日時 2024-11-22 06:28:54
合計ジャッジ時間 8,300 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 12 RE * 7 MLE * 2
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <vector>
using namespace std;
using ll = long long int;

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