結果

問題 No.1338 Giant Class
ユーザー kotatsugamekotatsugame
提出日時 2021-01-15 21:30:37
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 286 ms / 2,000 ms
コード長 304 bytes
コンパイル時間 707 ms
コンパイル使用メモリ 76,348 KB
実行使用メモリ 8,132 KB
最終ジャッジ日時 2023-08-17 16:08:16
合計ジャッジ時間 5,480 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,380 KB
testcase_01 AC 2 ms
4,380 KB
testcase_02 AC 192 ms
4,380 KB
testcase_03 AC 2 ms
4,376 KB
testcase_04 AC 2 ms
4,376 KB
testcase_05 AC 3 ms
4,380 KB
testcase_06 AC 161 ms
6,352 KB
testcase_07 AC 234 ms
7,868 KB
testcase_08 AC 146 ms
6,148 KB
testcase_09 AC 139 ms
6,088 KB
testcase_10 AC 261 ms
8,068 KB
testcase_11 AC 24 ms
4,380 KB
testcase_12 AC 175 ms
5,668 KB
testcase_13 AC 153 ms
6,048 KB
testcase_14 AC 38 ms
4,376 KB
testcase_15 AC 58 ms
4,544 KB
testcase_16 AC 20 ms
4,376 KB
testcase_17 AC 157 ms
6,116 KB
testcase_18 AC 39 ms
4,380 KB
testcase_19 AC 71 ms
4,828 KB
testcase_20 AC 285 ms
8,044 KB
testcase_21 AC 280 ms
8,132 KB
testcase_22 AC 286 ms
8,028 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp:6:1: 警告: ISO C++ では型の無い ‘main’ の宣言を禁止しています [-Wreturn-type]
    6 | main()
      | ^~~~

ソースコード

diff #

#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;
	}
}
0