Submission #734782

#TimeUsernameProblemLanguageResultExecution timeMemory
734782keisuke6Circle selection (APIO18_circle_selection)C++14
0 / 100
3048 ms9896 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,N); for(int i=0;i<N;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(A[i] == N || R[A[i]] < R[j] || (R[A[i]] == R[j] && A[i] > j)){ A[i] = j; } } } for(int i=0;i<N;i++) cout<<(A[i] != N ? A[i]+1 : 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...