結果
問題 | No.1338 Giant Class |
ユーザー |
![]() |
提出日時 | 2023-08-25 00:01:32 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 318 ms / 2,000 ms |
コード長 | 461 bytes |
コンパイル時間 | 2,082 ms |
コンパイル使用メモリ | 199,960 KB |
最終ジャッジ日時 | 2025-02-16 13:22:18 |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 21 |
ソースコード
#include <bits/stdc++.h>using namespace std;using ll = long long;int main(){ll H, W, Q, ans, x, y, mi;cin >> H >> W >> Q;map<ll, ll> mp;ans = H*W;while(Q){Q--;cin >> x >> y;swap(x, y);mi = H+1;if (mp.count(x)){mi = mp[x];mp[x] = min(mi, y);}else mp[x] = y;ans -= max(mi-y, 0LL);cout << ans << endl;}return 0;}