結果

問題 No.1121 Social Distancing in Cinema
ユーザー 沙耶花沙耶花
提出日時 2020-07-22 21:42:43
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
RE  
実行時間 -
コード長 1,078 bytes
コンパイル時間 3,294 ms
コンパイル使用メモリ 211,604 KB
実行使用メモリ 6,452 KB
最終ジャッジ日時 2023-09-04 16:45:31
合計ジャッジ時間 8,172 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,432 KB
testcase_01 AC 2 ms
4,492 KB
testcase_02 AC 3 ms
4,444 KB
testcase_03 AC 2 ms
4,544 KB
testcase_04 AC 2 ms
4,728 KB
testcase_05 AC 3 ms
4,428 KB
testcase_06 AC 2 ms
4,428 KB
testcase_07 AC 3 ms
4,388 KB
testcase_08 AC 2 ms
4,448 KB
testcase_09 AC 3 ms
4,496 KB
testcase_10 AC 2 ms
4,500 KB
testcase_11 AC 3 ms
4,440 KB
testcase_12 AC 2 ms
4,436 KB
testcase_13 AC 3 ms
4,524 KB
testcase_14 AC 3 ms
4,472 KB
testcase_15 AC 4 ms
4,444 KB
testcase_16 AC 8 ms
4,388 KB
testcase_17 AC 24 ms
4,920 KB
testcase_18 AC 44 ms
5,648 KB
testcase_19 AC 52 ms
5,900 KB
testcase_20 AC 4 ms
4,504 KB
testcase_21 AC 3 ms
4,548 KB
testcase_22 AC 3 ms
4,476 KB
testcase_23 AC 3 ms
4,472 KB
testcase_24 AC 3 ms
4,388 KB
testcase_25 AC 15 ms
4,592 KB
testcase_26 AC 19 ms
4,752 KB
testcase_27 AC 3 ms
4,560 KB
testcase_28 AC 46 ms
5,744 KB
testcase_29 AC 18 ms
4,644 KB
testcase_30 AC 15 ms
4,660 KB
testcase_31 AC 52 ms
5,908 KB
testcase_32 AC 40 ms
5,392 KB
testcase_33 AC 19 ms
4,720 KB
testcase_34 AC 18 ms
4,660 KB
testcase_35 AC 42 ms
5,640 KB
testcase_36 RE -
testcase_37 AC 14 ms
4,500 KB
testcase_38 AC 20 ms
4,912 KB
testcase_39 AC 45 ms
5,948 KB
testcase_40 AC 11 ms
4,432 KB
testcase_41 AC 5 ms
4,724 KB
testcase_42 AC 50 ms
6,092 KB
testcase_43 AC 50 ms
5,908 KB
testcase_44 RE -
testcase_45 RE -
testcase_46 RE -
testcase_47 AC 2 ms
4,388 KB
testcase_48 AC 2 ms
4,452 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
#define modulo 1000000007
#define mod(mod_x) ((((long long)mod_x+modulo))%modulo)
#define Inf 1000000000000000002


int main(){
	
	map<pair<int,int>,int> mp;
	int N;
	cin>>N;
	vector<vector<int>> ind(501,vector<int>(501,-1));
	vector<pair<int,int>> P(N);
	for(int i=0;i<N;i++){
		int X,Y;
		scanf("%d %d",&X,&Y);
		
		ind[X][Y] = i;
		P[i].first=X;
		P[i].second=Y;
	}
	
	sort(P.begin(),P.end());
	
	vector<int> ans;
	while(true){
		if((N+89)/90 <= ans.size())break;
		if(ind[P.back().first][P.back().second]==-1){
			P.pop_back();
			continue;
		}
		ans.push_back(ind[P.back().first][P.back().second]);
		ind[P.back().first][P.back().second]=-1;
		int X = P.back().first;
		int Y = P.back().second;
		P.pop_back();
		
		for(int i=-10;i<=10;i++){
			for(int j=-10;j<=10;j++){
				if(i*i+j*j<100){
					int x = X+i,y = Y+j;
					if(x<0||y<0||x>500||y>500)continue;
					ind[x][y]=-1;
				}
			}
		}
	}
	
	cout<<ans.size()<<endl;
	for(int i=0;i<ans.size();i++){
		if(i!=0)cout<<' ';
		cout<<ans[i]+1;
	}
	cout<<endl;
		
	
	return 0;
}
0