結果

問題 No.1121 Social Distancing in Cinema
ユーザー kotatsugamekotatsugame
提出日時 2020-07-22 22:01:19
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 857 bytes
コンパイル時間 455 ms
コンパイル使用メモリ 54,660 KB
実行使用メモリ 6,908 KB
最終ジャッジ日時 2023-09-04 20:16:32
合計ジャッジ時間 10,186 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 3 ms
5,036 KB
testcase_01 AC 2 ms
5,036 KB
testcase_02 AC 3 ms
5,016 KB
testcase_03 AC 2 ms
5,092 KB
testcase_04 AC 3 ms
5,088 KB
testcase_05 AC 3 ms
5,056 KB
testcase_06 AC 2 ms
5,088 KB
testcase_07 AC 3 ms
5,040 KB
testcase_08 AC 3 ms
5,076 KB
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
testcase_30 WA -
testcase_31 WA -
testcase_32 WA -
testcase_33 WA -
testcase_34 WA -
testcase_35 WA -
testcase_36 WA -
testcase_37 WA -
testcase_38 WA -
testcase_39 WA -
testcase_40 WA -
testcase_41 WA -
testcase_42 WA -
testcase_43 WA -
testcase_44 WA -
testcase_45 WA -
testcase_46 WA -
testcase_47 AC 2 ms
5,084 KB
testcase_48 AC 3 ms
5,040 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;
	for(int x=1;x<=500;x++)for(int y=1;y<=500;y++)
	{
		if(id[x][y]!=0)
		{
			bool ok=true;
			for(int dx=-5;dx<=5;dx++)for(int dy=-5;dy<=5;dy++)
			{
				if(x+dx>=1&&y+dy>=1&&dx*dx+dy*dy<=25&&ex[x+dx][y+dy])
				{
					ok=false;
				}
			}
			if(ok)
			{
				ans.push_back(id[x][y]);
				for(int dx=-5;dx<=5;dx++)for(int dy=-5;dy<=5;dy++)
				{
					if(x+dx>=1&&y+dy>=1&&dx*dx+dy*dy<=25)
					{
						ex[x+dx][y+dy]=true;
					}
				}
			}
			
		}
	}
	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