結果
問題 |
No.1338 Giant Class
|
ユーザー |
|
提出日時 | 2021-01-22 00:47:32 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
RE
|
実行時間 | - |
コード長 | 750 bytes |
コンパイル時間 | 849 ms |
コンパイル使用メモリ | 91,352 KB |
実行使用メモリ | 816,324 KB |
最終ジャッジ日時 | 2024-12-25 15:04:14 |
合計ジャッジ時間 | 11,861 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 11 RE * 7 MLE * 3 |
ソースコード
#include<iostream> #include<vector> #include <cmath> #include <map> #include <set> #include <algorithm> #include <string> #include <iomanip> #include <queue> #define rep(i,n) for (int i= 0;i<(n);++i) using namespace std; typedef long long ll; using Graph = vector<vector<int>>; int main() { ll H , W , Q; cin >> H >> W >> Q ; ll y[Q] , x[Q] ; ll h[W] ; for(ll j = 0 ; j < W ; j++){ h[j] = H ; ; } for(ll i = 0 ; i < Q ; i++){ cin >> y[i] >> x[i] ; } ll ans = H * W ; for(ll i= 0 ; i < Q ; i++){ //cout << h[x[i]-1] << endl; if(h[x[i]-1] >= y[i]){ ans -= h[x[i]-1] - y[i] + 1 ; h[x[i]-1] = y[i] -1; } cout << ans << endl; } }