結果
| 問題 | 
                            No.1121 Social Distancing in Cinema
                             | 
                    
| コンテスト | |
| ユーザー | 
                             沙耶花
                         | 
                    
| 提出日時 | 2020-07-22 21:44:45 | 
| 言語 | C++17  (gcc 13.3.0 + boost 1.87.0)  | 
                    
| 結果 | 
                             
                                WA
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 1,085 bytes | 
| コンパイル時間 | 2,241 ms | 
| コンパイル使用メモリ | 205,908 KB | 
| 最終ジャッジ日時 | 2025-01-12 02:30:36 | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge1 / judge1 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 2 | 
| other | AC * 43 WA * 4 | 
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:17:22: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   17 |                 scanf("%d %d",&X,&Y);
      |                 ~~~~~^~~~~~~~~~~~~~~
            
            ソースコード
#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(P.size()!=0){
		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;
}
            
            
            
        
            
沙耶花