結果
問題 | No.1338 Giant Class |
ユーザー | outline |
提出日時 | 2021-01-15 21:49:45 |
言語 | C++17 (gcc 12.3.0 + boost 1.83.0) |
結果 |
RE
|
実行時間 | - |
コード長 | 1,289 bytes |
コンパイル時間 | 1,229 ms |
コンパイル使用メモリ | 133,804 KB |
実行使用メモリ | 811,280 KB |
最終ジャッジ日時 | 2023-08-17 16:46:02 |
合計ジャッジ時間 | 5,308 ms |
ジャッジサーバーID (参考情報) |
judge14 / judge11 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 2 ms
4,376 KB |
testcase_01 | AC | 1 ms
4,376 KB |
testcase_02 | AC | 25 ms
4,376 KB |
testcase_03 | AC | 1 ms
4,376 KB |
testcase_04 | AC | 1 ms
4,376 KB |
testcase_05 | AC | 1 ms
4,376 KB |
testcase_06 | AC | 35 ms
37,864 KB |
testcase_07 | AC | 45 ms
37,860 KB |
testcase_08 | AC | 23 ms
14,228 KB |
testcase_09 | AC | 18 ms
6,372 KB |
testcase_10 | AC | 36 ms
14,580 KB |
testcase_11 | AC | 15 ms
33,504 KB |
testcase_12 | AC | 20 ms
4,380 KB |
testcase_13 | RE | - |
testcase_14 | AC | 141 ms
397,996 KB |
testcase_15 | MLE | - |
testcase_16 | MLE | - |
testcase_17 | -- | - |
testcase_18 | -- | - |
testcase_19 | -- | - |
testcase_20 | -- | - |
testcase_21 | -- | - |
testcase_22 | -- | - |
ソースコード
#include <iostream> #include <vector> #include <algorithm> #include <cmath> #include <queue> #include <string> #include <map> #include <set> #include <stack> #include <tuple> #include <deque> #include <array> #include <numeric> #include <bitset> #include <iomanip> #include <cassert> #include <chrono> #include <random> #include <limits> #include <iterator> #include <functional> #include <sstream> #include <fstream> #include <complex> #include <cstring> #include <unordered_map> #include <unordered_set> using namespace std; using ll = long long; constexpr int INF = 1001001001; constexpr int mod = 1000000007; // constexpr int mod = 998244353; template<class T> inline bool chmax(T& x, T y){ if(x < y){ x = y; return true; } return false; } template<class T> inline bool chmin(T& x, T y){ if(x > y){ x = y; return true; } return false; } int main(){ ios::sync_with_stdio(false); cin.tie(nullptr); int H, W, Q; cin >> H >> W >> Q; ll ans = (ll)H * W; vector<int> upper(W + 1, H + 1); for(int q = 0; q < Q; ++q){ int R, C; cin >> R >> C; if(R < upper[C]){ ans -= upper[C] - R; upper[C] = R; } cout << ans << '\n'; } return 0; }