結果
| 問題 | No.1338 Giant Class |
| コンテスト | |
| ユーザー |
SSRS
|
| 提出日時 | 2021-01-15 21:28:32 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 289 ms / 2,000 ms |
| コード長 | 377 bytes |
| コンパイル時間 | 1,503 ms |
| コンパイル使用メモリ | 173,380 KB |
| 実行使用メモリ | 8,192 KB |
| 最終ジャッジ日時 | 2024-11-26 13:19:01 |
| 合計ジャッジ時間 | 6,034 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 21 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
int main(){
int H, W, Q;
cin >> H >> W >> Q;
map<int, int> mp;
long long ans = (long long) H * W;
for (int i = 0; i < Q; i++){
int Y, X;
cin >> Y >> X;
X--;
Y--;
if (!mp.count(X)){
mp[X] = H;
}
if (mp[X] > Y){
ans -= mp[X] - Y;
mp[X] = Y;
}
cout << ans << endl;
}
}
SSRS