Submission #539217

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
5392172022-03-18 15:12:18cadmiumskyCircle selection (APIO18_circle_selection)C++17
57 / 100
2214 ms94028 KiB
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
namespace Cercus {
unordered_map<int, unordered_map<int, vector<int> > > cont;
int lastr = 2e9 + 5;
vector<tuple<int, int, int> > v;
vector<int> sorted, elim;
int xx[2], yy[2], rr[2];
ll p2(ll x) { return x * x; }
bool check(int i, int j) {
tie(rr[0], xx[0], yy[0]) = v[i];
tie(rr[1], xx[1], yy[1]) = v[j];
return p2(xx[0] - xx[1]) + p2(yy[0] - yy[1]) <= p2(rr[0] + rr[1]);
}
void redocontainer(int nr) {
lastr = nr;
for(int i = 0, x, y, r; i < v.size(); i++) {
if(elim[i] == -1) {
tie(r, x, y) = v[i];
cont[x / (2 * nr)][y / (2 * nr)].push_back(i);
}
}
}
void gothrough(int ind) {
if(elim[ind] != -1)
return;
int x, y, r;
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

circle_selection.cpp: In function 'void Cercus::redocontainer(int)':
circle_selection.cpp:20:31: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::tuple<int, int, int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   20 |     for(int i = 0, x, y, r; i < v.size(); i++) {
      |                             ~~^~~~~~~~~~
circle_selection.cpp: In function 'void Cercus::gothrough(int)':
circle_selection.cpp:43:33: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   43 |         for(int ptr = 0, z; ptr < cont[i][j].size(); ptr++) {
      |                             ~~~~^~~~~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...