結果

問題 No.1338 Giant Class
ユーザー ineedyourlovepineedyourlovep
提出日時 2021-01-15 22:01:33
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
RE  
実行時間 -
コード長 1,606 bytes
コンパイル時間 1,495 ms
コンパイル使用メモリ 169,920 KB
実行使用メモリ 814,736 KB
最終ジャッジ日時 2024-05-04 23:48:06
合計ジャッジ時間 5,970 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
5,248 KB
testcase_01 AC 2 ms
5,376 KB
testcase_02 AC 195 ms
5,376 KB
testcase_03 AC 3 ms
5,376 KB
testcase_04 AC 2 ms
5,376 KB
testcase_05 AC 2 ms
5,376 KB
testcase_06 AC 168 ms
72,704 KB
testcase_07 AC 223 ms
72,996 KB
testcase_08 AC 138 ms
25,544 KB
testcase_09 AC 121 ms
9,856 KB
testcase_10 AC 223 ms
26,136 KB
testcase_11 AC 40 ms
64,256 KB
testcase_12 AC 150 ms
5,376 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 <bits/stdc++.h>
#define rep(i, a, n) for(int i = a; i < n; i++)
#define v(T) vector<T>
using namespace std;
using ll = long long;
using P = pair<int, int>;

const int mod = 1000000007;

struct mint {
    ll x;
    mint(ll x=0):x((x%mod+mod)%mod){}
    mint operator-() const { return mint(-x);}
    mint& operator+=(const mint a) {
        if ((x += a.x) >= mod) x -= mod;
        return *this;
    }
    mint& operator-=(const mint a) {
        if ((x += mod-a.x) >= mod) x -= mod;
        return *this;
    }
    mint& operator*=(const mint a) { (x *= a.x) %= mod; return *this;}
    mint operator+(const mint a) const { return mint(*this) += a;}
    mint operator-(const mint a) const { return mint(*this) -= a;}
    mint operator*(const mint a) const { return mint(*this) *= a;}
    mint pow(ll t) const {
        if (!t) return 1;
        mint a = pow(t>>1);
        a *= a;
        if (t&1) a *= *this;
        return a;
    }

    // for prime mod
    mint inv() const { return pow(mod-2);}
    mint& operator/=(const mint a) { return *this *= a.inv();}
    mint operator/(const mint a) const { return mint(*this) /= a;}
};
istream& operator>>(istream& is, mint& a) { return is >> a.x;}
ostream& operator<<(ostream& os, const mint& a) { return os << a.x;}

int main()
{
    ll h, w, q;
    cin >> h >> w >> q;
    v(ll) row(w+1, h);
    ll sum = w*h;
    rep(i, 0, q){
        ll y, x;
        cin >> y >> x;
        ll tmp = row[x];
        row[x] = min(row[x], y-1);
        if(row[x] != tmp){
            sum -= tmp - row[x];
        }
        cout << sum << endl;
    }
    return 0;
}
0