結果
問題 |
No.1338 Giant Class
|
ユーザー |
|
提出日時 | 2021-01-15 21:48:47 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
RE
|
実行時間 | - |
コード長 | 446 bytes |
コンパイル時間 | 2,508 ms |
コンパイル使用メモリ | 193,176 KB |
最終ジャッジ日時 | 2025-01-17 19:07:27 |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 11 RE * 7 MLE * 3 |
ソースコード
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) using namespace std; using ll = long long; int main() { ll H, W, Q; cin >> H >> W >> Q; vector<ll> minV(W, H); ll ans = H * W; rep(q, Q) { ll y, x; cin >> y >> x; --y; --x; if (minV[x] > y) { ans -= (minV[x] - y); minV[x] = y; } cout << ans << "\n"; } return 0; }