Submission #866271

# Submission time Handle Problem Language Result Execution time Memory
866271 2023-10-25T16:57:50 Z danikoynov Circle selection (APIO18_circle_selection) C++14
Compilation error
0 ms 0 KB
#include<bits/stdc++.h>

using namespace std;
typedef long long ll;

struct point
{
    int x, y;

    point(int _x = 0, int _y = 0)
    {
        x = _x;
        y = _y;
    }

    void get()
    {
        cin >> x >> y;
    }
};

struct circle
{
    point centre;
    int radius, idx;

    circle(point _centre = point(), int _radius = 0, int _idx = 0)
    {
        centre = _centre;
        radius = _radius;
        idx = _idx;
    }

    void get()
    {
        centre.get();
        cin >> radius;
    }
};

const int maxn = 3e5 + 10;
const int inf = 1e9 + 10;

bool cmpx(circle c1, circle c2)
{
    return c1.centre.x < c2.centre.x;
}

bool cmpy(circle c1, circle c2)
{
    return c1.centre.y < c2.centre.y;
}

void sort_arrays()
{
    sort(cx + 1, cx + n + 1, cmpx);
    sort(cy + 1, cy + n + 1, cmpy);
}

int n;
circle c[maxn], cx[maxn], cy[maxn];
void input()
{
    cin >> n;
    for (int i = 1; i <= n; i ++)
    {
        c[i].get();
        c[i].idx = i;
        cx[i] = cy[i] = c[i];
    }
}

vector < vector < circle > > field;
bool eliminated[maxn];

void restructure(int block)
{
    vector < int > dx;
    int last = -inf;
    for (int i = 1; i <= n; i ++)
    {
        
    }
}


void simulate()
{

}
void solve()
{
    input();
    sort_arrays();
    simulate();
}

int main()
{
    solve();
    return 0;
}

Compilation message

circle_selection.cpp: In function 'void sort_arrays()':
circle_selection.cpp:56:10: error: 'cx' was not declared in this scope; did you mean 'cmpx'?
   56 |     sort(cx + 1, cx + n + 1, cmpx);
      |          ^~
      |          cmpx
circle_selection.cpp:56:23: error: 'n' was not declared in this scope; did you mean 'yn'?
   56 |     sort(cx + 1, cx + n + 1, cmpx);
      |                       ^
      |                       yn
circle_selection.cpp:57:10: error: 'cy' was not declared in this scope; did you mean 'cmpy'?
   57 |     sort(cy + 1, cy + n + 1, cmpy);
      |          ^~
      |          cmpy
circle_selection.cpp: In function 'void restructure(int)':
circle_selection.cpp:79:9: warning: unused variable 'last' [-Wunused-variable]
   79 |     int last = -inf;
      |         ^~~~