Submission #902368

#TimeUsernameProblemLanguageResultExecution timeMemory
902368Trisanu_DasCircle selection (APIO18_circle_selection)C++17
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; typedef long long int64_t; typedef pair<int64_t, int64_t> pii; const int64_t maxn = 3e5 + 3; const int64_t inf = 1ll << 60; const int64_t bl = 2e9 + 3; struct C { int64_t x, y, r, id; }; int64_t n, res[maxn]; bitset<maxn> rmv; unordered_map<int64_t, vector<int64_t>> mp; int main() { cin.tie(0); ios_base::sync_with_stdio(false); cin >> n; C a[maxn]; for (int64_t i = 0; i < n; ++i) cin >> a[i].x >> a[i].y >> a[i].r, a[i].id = i; stable_sort(a, a + n, [](const C &x, const C &y) { return x.r > y.r; }); int64_t k = inf; for (int64_t i = 0; i < n; ++i) { if (rmv[i]) continue; if (2 * a[i].r < k) { k = a[i].r; mp.clear(); for (int64_t j = i; j < n; ++j) if (!rmv[j]) mp[a[j].x / k * bl + a[j].y / k].push_back(j); } int64_t xx = a[i].x / k, yy = a[i].y / k; for (int64_t x = xx - 2; x <= xx + 2; ++x) for (int64_t y = yy - 2; y <= yy + 2; ++y) { auto &tls = mp[x * bl + y]; for (auto it = tls.begin(); it != tls.end(); ++it) { if (!rmv[*it] && (a[i].x - a[*it].x) * (a[i].x - a[*it].x) + (a[i].y - a[*it].y) * (a[i].y - a[*it].y) <= (a[i].r + a[*it].r) * (a[i].r + a[*it].r)) { res[a[*it].id] = a[i].id; rmv[*it] = 1; } } } } for (int64_t i = 0; i < n; ++i) cout << res[i] + 1 << " "; }

Compilation message (stderr)

circle_selection.cpp:5:19: error: conflicting declaration 'typedef long long int int64_t'
    5 | typedef long long int64_t;
      |                   ^~~~~~~
In file included from /usr/include/x86_64-linux-gnu/sys/types.h:155,
                 from /usr/include/stdlib.h:394,
                 from /usr/include/c++/10/bits/std_abs.h:38,
                 from /usr/include/c++/10/cmath:47,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:41,
                 from circle_selection.cpp:1:
/usr/include/x86_64-linux-gnu/bits/stdint-intn.h:27:19: note: previous declaration as 'typedef __int64_t int64_t'
   27 | typedef __int64_t int64_t;
      |                   ^~~~~~~