結果
問題 |
No.1338 Giant Class
|
ユーザー |
|
提出日時 | 2021-11-10 02:24:57 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 88 ms / 2,000 ms |
コード長 | 492 bytes |
コンパイル時間 | 1,909 ms |
コンパイル使用メモリ | 198,856 KB |
最終ジャッジ日時 | 2025-01-25 15:09:18 |
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 21 |
ソースコード
#include <bits/stdc++.h> using namespace std; int main(void) { cin.tie(0); ios::sync_with_stdio(false); long long int H,W,Q; map <long long int,long long int> memo; long long int Y,X; cin >> H >> W >> Q; long long int res = H*W; for(int i=0;i<Q;i++) { cin >> Y >> X; if(memo.find(X)==memo.end()) { res -= (H-Y+1); memo[X] = Y; } else { if(memo[X] > Y) { res -= (memo[X]-Y); memo[X] = Y; } } cout << res << '\n'; } return 0; }