Submission #399785

# Submission time Handle Problem Language Result Execution time Memory
399785 2021-05-06T15:30:08 Z my99n Circle selection (APIO18_circle_selection) C++14
Compilation error
0 ms 0 KB
#include<bits/stdc++.h>
using namespace std;
#define x first
#define y second
typedef pair<long long,long long> point;

struct A {
  long long x, y, r;
  int i;
  bool operator < (const A & o) const {
    if (r == o.r) return i < o.i;
    return r > o.r;
  }
} cir[5050];
int ans[5010];
int mark[5010];

long long dis (point i, point j) {
  long long temp = ((i.x-j.x) * (i.x-j.x)) + ((i.y-j.y) * (i.y-j.y));
  return temp;
}

bool intersect (A i, A j) {
  return (dis({i.x, i.y}, {j.x, j.y}) <= (i.r+j.r)*(i.r+j.r));
}

int main(){
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n; cin >> n;
  for (int i = 1; i <= n; i++) {
    long long x, y, r; cin >> x >> y >> r;
    cir[i] = {x, y, r, i};
  }
  sort(cir+1, cir+1+n);
  for (int i = 1; i <= n; i++) {
    int ind = cir[i].i;
    cerr << ind << endl;
    if (mark[i]) continue;
    mark[i] = 1;
    ans[ind] = ind;
    for (int j = i+1; j <= n; j++) {
      if (mark[j]) continue;
      int anind = cir[j].i;
      if (intersect(cir[i], cir[j])) {
        ans[anind] = ind;
        mark[j] = 1;
      }
    }
  }
  for (int i = 1; i <= n; i++) {
    cout << ans[i] << ' ';
  } cour << endl;
  return 0;
}

Compilation message

circle_selection.cpp: In function 'int main()':
circle_selection.cpp:53:5: error: 'cour' was not declared in this scope
   53 |   } cour << endl;
      |     ^~~~