結果

問題 No.1338 Giant Class
ユーザー yuui
提出日時 2021-01-15 21:59:33
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
RE  
実行時間 -
コード長 499 bytes
コンパイル時間 2,750 ms
コンパイル使用メモリ 192,644 KB
最終ジャッジ日時 2025-01-17 19:21:37
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 12 RE * 7 MLE * 2
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    ll H, W, Q;
    cin >> H >> W >> Q;
    vector<int> minV(W, H);
    ll ans = H * W;
    int y, x;
    rep(q, Q) {
        cin >> y >> x;
        --y;
        --x;
        if (minV[x] > y) {
            ans -= (minV[x] - y);
            minV[x] = y;
        }
        cout << ans << "\n";
    }

    return 0;
}
0