Submission #734791

#TimeUsernameProblemLanguageResultExecution timeMemory
734791keisuke6Circle selection (APIO18_circle_selection)C++14
7 / 100
2975 ms15272 KiB
#pragma GCC target("avx512f") #pragma GCC optimize("O2") #include <bits/stdc++.h> using namespace std; int main(){ int N; cin>>N; vector<long long> 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<long long, long long>> 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 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; } } if(clock()*1.0/CLOCKS_PER_SEC > 2.95){ break; } } for(int i=0;i<N;i++) cout<<(A[i] == N+1 ? i+1 : A[i])<<' '; 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...