結果

問題 No.1121 Social Distancing in Cinema
ユーザー kotatsugamekotatsugame
提出日時 2020-07-22 21:46:56
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 931 bytes
コンパイル時間 625 ms
コンパイル使用メモリ 59,264 KB
実行使用メモリ 7,200 KB
最終ジャッジ日時 2023-09-04 17:16:25
合計ジャッジ時間 6,948 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 5 ms
5,348 KB
testcase_01 AC 5 ms
5,356 KB
testcase_02 AC 4 ms
5,328 KB
testcase_03 AC 5 ms
5,308 KB
testcase_04 AC 5 ms
5,376 KB
testcase_05 AC 5 ms
5,320 KB
testcase_06 AC 4 ms
5,324 KB
testcase_07 AC 5 ms
5,336 KB
testcase_08 AC 4 ms
5,316 KB
testcase_09 AC 5 ms
5,336 KB
testcase_10 AC 5 ms
5,348 KB
testcase_11 AC 5 ms
5,388 KB
testcase_12 AC 5 ms
5,356 KB
testcase_13 AC 5 ms
5,424 KB
testcase_14 AC 5 ms
5,468 KB
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 AC 6 ms
5,652 KB
testcase_21 AC 6 ms
5,656 KB
testcase_22 AC 5 ms
5,636 KB
testcase_23 AC 5 ms
5,592 KB
testcase_24 AC 5 ms
5,584 KB
testcase_25 AC 17 ms
6,936 KB
testcase_26 AC 20 ms
6,948 KB
testcase_27 AC 8 ms
6,676 KB
testcase_28 AC 39 ms
7,068 KB
testcase_29 AC 20 ms
6,904 KB
testcase_30 WA -
testcase_31 WA -
testcase_32 WA -
testcase_33 AC 18 ms
6,936 KB
testcase_34 AC 19 ms
6,940 KB
testcase_35 WA -
testcase_36 WA -
testcase_37 AC 17 ms
6,936 KB
testcase_38 AC 21 ms
6,912 KB
testcase_39 AC 39 ms
7,044 KB
testcase_40 AC 13 ms
6,836 KB
testcase_41 AC 8 ms
6,672 KB
testcase_42 WA -
testcase_43 WA -
testcase_44 WA -
testcase_45 WA -
testcase_46 WA -
testcase_47 AC 5 ms
5,380 KB
testcase_48 AC 5 ms
5,376 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp:10:1: 警告: ISO C++ では型の無い ‘main’ の宣言を禁止しています [-Wreturn-type]
   10 | main()
      | ^~~~

ソースコード

diff #

#include<cstdio>
#include<vector>
#include<algorithm>
#include<queue>
using namespace std;
int N;
int X[3<<17],Y[3<<17];
bool ex[555][555],vis[555][555];
int id[555][555];
main()
{
	scanf("%d",&N);
	for(int i=0;i<N;i++)
	{
		scanf("%d%d",&X[i],&Y[i]);
		id[X[i]][Y[i]]=i+1;
	}
	vector<int>ans;
	queue<pair<int,int> >Q;
	Q.push(make_pair(0,0));
	vis[0][0]=true;
	while(!Q.empty())
	{
		int x=Q.front().first,y=Q.front().second;
		Q.pop();
		if(!ex[x][y]&&id[x][y]!=0)
		{
			ans.push_back(id[x][y]);
			for(int dx=-9;dx<=9;dx++)for(int dy=-9;dy<=9;dy++)
			{
				if(x+dx>=0&&y+dy>=0&&dx*dx+dy*dy<100)
				{
					ex[x+dx][y+dy]=true;
				}
			}
		}
		if(x<500&&!vis[x+1][y])
		{
			vis[x+1][y]=true;
			Q.push(make_pair(x+1,y));
		}
		if(y<500&&!vis[x][y+1])
		{
			vis[x][y+1]=true;
			Q.push(make_pair(x,y+1));
		}
	}
	printf("%d\n",(int)ans.size());
	for(int i=0;i<ans.size();i++)printf("%d%c",ans[i],i+1==ans.size()?'\n':' ');
}
0