Submission #734775

#TimeUsernameProblemLanguageResultExecution timeMemory
734775keisuke6Circle selection (APIO18_circle_selection)C++14
0 / 100
3074 ms9656 KiB
#include <bits/stdc++.h> using namespace std; #define int long long signed main(){ int N; cin>>N; vector<int> X(N),Y(N),R(N); for(int i=0;i<N;i++) cin>>X[i]>>Y[i]>>R[i]; vector<int> A(N,0); for(int i=0;i<N;i++){ pair<int,int> best = {R[i],i}; for(int j=0;j<N;j++){ if(i == j || (X[i]-X[j])*(X[i]-X[j])+(Y[i]-Y[j])*(Y[i]-Y[j]) > (R[i]+R[j])*(R[i]+R[j])) continue; if(best.first < R[j] || (best.first == R[j] && best.second > j)){ best = {R[j],j}; A[i] = j+1; } } } for(int i=0;i<N;i++) cout<<(A[i] ? A[i] : i+1)<<' '; cout<<endl; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...