結果

問題 No.1121 Social Distancing in Cinema
ユーザー kotatsugamekotatsugame
提出日時 2020-07-22 21:37:30
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
TLE  
実行時間 -
コード長 740 bytes
コンパイル時間 752 ms
コンパイル使用メモリ 79,704 KB
実行使用メモリ 12,208 KB
最終ジャッジ日時 2023-09-04 16:13:56
合計ジャッジ時間 13,503 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
8,760 KB
testcase_01 AC 2 ms
4,376 KB
testcase_02 AC 2 ms
4,376 KB
testcase_03 AC 1 ms
4,376 KB
testcase_04 AC 1 ms
4,380 KB
testcase_05 AC 1 ms
4,380 KB
testcase_06 AC 2 ms
4,376 KB
testcase_07 AC 1 ms
4,380 KB
testcase_08 AC 2 ms
4,384 KB
testcase_09 AC 2 ms
4,380 KB
testcase_10 AC 2 ms
4,380 KB
testcase_11 AC 2 ms
4,376 KB
testcase_12 AC 2 ms
4,380 KB
testcase_13 AC 2 ms
4,380 KB
testcase_14 AC 2 ms
4,380 KB
testcase_15 AC 5 ms
4,376 KB
testcase_16 AC 20 ms
4,380 KB
testcase_17 AC 157 ms
5,160 KB
testcase_18 AC 473 ms
7,212 KB
testcase_19 AC 636 ms
7,976 KB
testcase_20 AC 5 ms
4,376 KB
testcase_21 AC 4 ms
4,380 KB
testcase_22 AC 4 ms
4,384 KB
testcase_23 AC 2 ms
4,380 KB
testcase_24 AC 2 ms
4,384 KB
testcase_25 AC 40 ms
4,624 KB
testcase_26 AC 63 ms
4,636 KB
testcase_27 AC 3 ms
4,380 KB
testcase_28 AC 508 ms
7,188 KB
testcase_29 AC 56 ms
4,748 KB
testcase_30 AC 60 ms
4,396 KB
testcase_31 AC 634 ms
7,968 KB
testcase_32 AC 383 ms
6,696 KB
testcase_33 AC 90 ms
4,580 KB
testcase_34 AC 88 ms
4,736 KB
testcase_35 AC 424 ms
7,088 KB
testcase_36 AC 613 ms
7,828 KB
testcase_37 AC 53 ms
4,380 KB
testcase_38 AC 113 ms
5,000 KB
testcase_39 AC 519 ms
7,240 KB
testcase_40 AC 29 ms
4,376 KB
testcase_41 AC 7 ms
4,380 KB
testcase_42 AC 570 ms
7,724 KB
testcase_43 AC 569 ms
7,644 KB
testcase_44 TLE -
testcase_45 -- -
testcase_46 -- -
testcase_47 -- -
testcase_48 -- -
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp:7:1: 警告: ISO C++ では型の無い ‘main’ の宣言を禁止しています [-Wreturn-type]
    7 | main()
      | ^~~~

ソースコード

diff #

#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
int N;
int X[3<<17],Y[3<<17];
main()
{
	cin>>N;
	vector<pair<pair<int,int>,int> >A(N);
	for(int i=0;i<N;i++)
	{
		cin>>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;
			for(int jd:ans)
			{
				int dx=A[id].first.first-X[jd],dy=A[id].first.second-Y[jd];
				if(dx*dx+dy*dy<100)
				{
					ok=false;
					break;
				}
			}
			if(ok)
			{
				ans.push_back(A[id].second);
				break;
			}
			id++;
		}
		id++;
	}
	cout<<ans.size()<<endl;
	for(int i=0;i<ans.size();i++)cout<<ans[i]+1<<(i+1==ans.size()?"\n":" ");
}
0