Submission #734782

# Submission time Handle Problem Language Result Execution time Memory
734782 2023-05-03T05:34:43 Z keisuke6 Circle selection (APIO18_circle_selection) C++14
0 / 100
3000 ms 9896 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);
  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 time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 1 ms 296 KB Output is correct
3 Incorrect 1 ms 212 KB Output isn't correct
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 3041 ms 9896 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 3048 ms 9648 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 1 ms 296 KB Output is correct
3 Incorrect 1 ms 212 KB Output isn't correct
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 1 ms 296 KB Output is correct
3 Incorrect 1 ms 212 KB Output isn't correct
4 Halted 0 ms 0 KB -