Submission #734787

#TimeUsernameProblemLanguageResultExecution timeMemory
734787keisuke6Circle selection (APIO18_circle_selection)C++14
7 / 100
3088 ms18380 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+1); vector<pair<int,int>> S(N); for(int i=0;i<N;i++) S[i] = {R[i],N-1-i}; sort(S.rbegin(),S.rend()); for(int i=0;i<N;i++){ int r = S[i].first, ind = N-1-S[i].second; if(A[ind] != N+1) continue; for(int j=0;j<N;j++){ if(A[j] == N+1 && (X[ind]-X[j])*(X[ind]-X[j])+(Y[ind]-Y[j])*(Y[ind]-Y[j]) <= (R[ind]+R[j])*(R[ind]+R[j])){ A[j] = ind+1; } } } for(int i=0;i<N;i++) cout<<A[i]<<' '; cout<<endl; }

Compilation message (stderr)

circle_selection.cpp: In function 'int main()':
circle_selection.cpp:14:9: warning: unused variable 'r' [-Wunused-variable]
   14 |     int r = S[i].first, ind = N-1-S[i].second;
      |         ^
#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...