結果
問題 |
No.1338 Giant Class
|
ユーザー |
|
提出日時 | 2021-01-17 13:48:06 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
TLE
|
実行時間 | - |
コード長 | 674 bytes |
コンパイル時間 | 1,608 ms |
コンパイル使用メモリ | 173,100 KB |
実行使用メモリ | 18,744 KB |
最終ジャッジ日時 | 2024-11-29 14:48:20 |
合計ジャッジ時間 | 42,502 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 9 TLE * 12 |
ソースコード
#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; for(int i=0;i<q;i++){ cin >> y[i] >> x[i]; if(mapp[x[i]] == 0){ mapp[x[i]] = y[i]; }else{ mapp[x[i]] = min(mapp[x[i]], y[i]); } lint ans = 0; ans += (w - mapp.size()) * h; for(auto p : mapp){ ans += p.second - 1; } cout << ans << endl; } }