結果
| 問題 | No.1338 Giant Class |
| コンテスト | |
| ユーザー |
zumin
|
| 提出日時 | 2021-02-22 22:24:00 |
| 言語 | C++14 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
AC
|
| 実行時間 | 175 ms / 2,000 ms |
| コード長 | 527 bytes |
| 記録 | |
| コンパイル時間 | 445 ms |
| コンパイル使用メモリ | 86,480 KB |
| 実行使用メモリ | 9,984 KB |
| 最終ジャッジ日時 | 2026-04-09 23:22:51 |
| 合計ジャッジ時間 | 4,486 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 21 |
ソースコード
#include <iostream>
#include <map>
using namespace std;
using ll=long long;
int main(){
ll h,w,q;
cin>>h>>w>>q;
ll ret=h*w;
map<ll,ll> seatingch;
for(int i=0;i<q;i++){
ll y,x;
cin>>y>>x;
if(seatingch.count(x)){
if(seatingch[x]>y){
ret+=h-seatingch[x]+1;
seatingch[x]=y;
ret-=h-y+1;
}
}else{
seatingch[x]=y;
ret-=h-y+1;
}
cout<<ret<<endl;
}
return 0;
}
zumin