結果
| 問題 |
No.1338 Giant Class
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2021-01-15 21:30:37 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 296 ms / 2,000 ms |
| コード長 | 304 bytes |
| コンパイル時間 | 641 ms |
| コンパイル使用メモリ | 76,440 KB |
| 実行使用メモリ | 8,320 KB |
| 最終ジャッジ日時 | 2024-11-26 13:21:33 |
| 合計ジャッジ時間 | 5,184 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 21 |
コンパイルメッセージ
main.cpp:6:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
6 | main()
| ^~~~
ソースコード
#include<iostream>
#include<map>
using namespace std;
int H,W,Q;
map<int,int>mp;
main()
{
cin>>H>>W>>Q;
long ans=(long)H*W;
for(;Q--;)
{
int x,y;cin>>x>>y;
if(mp.find(y)==mp.end())
{
ans-=H+1-x;
mp[y]=x;
}
else if(mp[y]>x)
{
ans-=mp[y]-x;
mp[y]=x;
}
cout<<ans<<endl;
}
}