結果

問題 No.1121 Social Distancing in Cinema
ユーザー kotatsugamekotatsugame
提出日時 2020-07-22 21:42:41
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
TLE  
実行時間 -
コード長 866 bytes
コンパイル時間 2,558 ms
コンパイル使用メモリ 58,332 KB
実行使用メモリ 7,940 KB
最終ジャッジ日時 2023-09-04 16:45:11
合計ジャッジ時間 8,403 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,380 KB
testcase_01 AC 2 ms
4,384 KB
testcase_02 AC 1 ms
4,384 KB
testcase_03 AC 2 ms
4,380 KB
testcase_04 AC 2 ms
4,380 KB
testcase_05 AC 1 ms
4,380 KB
testcase_06 AC 2 ms
4,380 KB
testcase_07 AC 2 ms
4,384 KB
testcase_08 AC 1 ms
4,380 KB
testcase_09 AC 1 ms
4,384 KB
testcase_10 AC 1 ms
4,384 KB
testcase_11 AC 2 ms
4,388 KB
testcase_12 AC 1 ms
4,384 KB
testcase_13 AC 2 ms
4,380 KB
testcase_14 AC 2 ms
4,380 KB
testcase_15 AC 4 ms
4,380 KB
testcase_16 AC 13 ms
4,384 KB
testcase_17 AC 44 ms
5,124 KB
testcase_18 AC 84 ms
7,028 KB
testcase_19 AC 97 ms
7,920 KB
testcase_20 AC 4 ms
4,384 KB
testcase_21 AC 3 ms
4,384 KB
testcase_22 AC 3 ms
4,384 KB
testcase_23 AC 2 ms
4,380 KB
testcase_24 AC 2 ms
4,380 KB
testcase_25 AC 19 ms
4,380 KB
testcase_26 AC 26 ms
4,456 KB
testcase_27 AC 2 ms
4,380 KB
testcase_28 AC 84 ms
7,208 KB
testcase_29 AC 24 ms
4,396 KB
testcase_30 AC 25 ms
4,380 KB
testcase_31 AC 97 ms
7,940 KB
testcase_32 AC 73 ms
6,652 KB
testcase_33 AC 32 ms
4,484 KB
testcase_34 AC 32 ms
4,484 KB
testcase_35 AC 78 ms
6,860 KB
testcase_36 AC 95 ms
7,704 KB
testcase_37 AC 24 ms
4,380 KB
testcase_38 AC 37 ms
4,740 KB
testcase_39 AC 84 ms
7,184 KB
testcase_40 AC 16 ms
4,384 KB
testcase_41 AC 6 ms
4,380 KB
testcase_42 AC 92 ms
7,584 KB
testcase_43 AC 93 ms
7,612 KB
testcase_44 TLE -
testcase_45 TLE -
testcase_46 TLE -
testcase_47 AC 2 ms
4,384 KB
testcase_48 AC 2 ms
4,380 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp:8:1: 警告: ISO C++ では型の無い ‘main’ の宣言を禁止しています [-Wreturn-type]
    8 | main()
      | ^~~~

ソースコード

diff #

#include<cstdio>
#include<vector>
#include<algorithm>
using namespace std;
int N;
int X[3<<17],Y[3<<17];
bool ex[555][555];
main()
{
	scanf("%d",&N);
	vector<pair<pair<int,int>,int> >A(N);
	for(int i=0;i<N;i++)
	{
		scanf("%d%d",&X[i],&Y[i]);
		A[i].first.first=X[i];
		A[i].first.second=Y[i];
		A[i].second=i;
	}
	sort(A.begin(),A.end());
	vector<int>ans;
	int id=0;
	while(ans.size()*90<N)
	{
		while(id<N)
		{
			bool ok=true;
			int x=A[id].first.first,y=A[id].first.second;
			for(int dx=-9;ok&&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])
				{
					ok=false;
					break;
				}
			}
			if(ok)
			{
				ans.push_back(A[id].second);
				ex[x][y]=true;
				break;
			}
			id++;
		}
		id++;
	}
	printf("%d\n",(int)ans.size());
	for(int i=0;i<ans.size();i++)printf("%d%c",ans[i]+1,i+1==ans.size()?'\n':' ');
}
0