結果
問題 |
No.1338 Giant Class
|
ユーザー |
|
提出日時 | 2021-01-17 13:58:22 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 690 bytes |
コンパイル時間 | 1,756 ms |
コンパイル使用メモリ | 173,904 KB |
実行使用メモリ | 9,276 KB |
最終ジャッジ日時 | 2024-11-29 15:06:22 |
合計ジャッジ時間 | 6,135 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | WA * 2 |
other | WA * 21 |
ソースコード
#include<bits/stdc++.h> // #include<atcoder/all> using namespace std; // using namespace atcoder; using lint = long long; #define endl '\n' lint const mod = 1e9+7; //long const mod = 998244353; lint h,w,q; lint y[100000]; lint x[100000]; unordered_map<lint,lint>mapp; int main(){ cin >> h >> w >> q; lint ans = h*w; for(int i=0;i<q;i++){ cin >> y[i] >> x[i]; if(mapp[x[i]] == 0){ mapp[x[i]] = y[i]; ans -= (h - y[i]); }else{ if(mapp[x[i]] > y[i]){ ans -= mapp[x[i]] - y[i]; mapp[x[i]] = y[i]; } } cout << ans << endl; } }