답안 #734786

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
734786 2023-05-03T05:42:04 Z keisuke6 원 고르기 (APIO18_circle_selection) C++14
0 / 100
3000 ms 14892 KB
#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] = i+1;
      }
    }
  }
  for(int i=0;i<N;i++) cout<<A[i]<<' ';
  cout<<endl;
}

Compilation message

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;
      |         ^
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Incorrect 0 ms 212 KB Output isn't correct
4 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 331 ms 14892 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Execution timed out 3039 ms 14372 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Incorrect 0 ms 212 KB Output isn't correct
4 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Incorrect 0 ms 212 KB Output isn't correct
4 Halted 0 ms 0 KB -