제출 #107112

#제출 시각UTC-0아이디문제언어결과실행 시간메모리
1071122019-04-22 03:43:26tictaccat원 고르기 (APIO18_circle_selection)C++14
19 / 100
3056 ms270652 KiB
#include <bits/stdc++.h>
using namespace std;
#define int long long
const int MAX = 3e5;
int n;
int gridSize;
vector<pair<int,pair<int,int>>> circles(MAX);
unordered_map<int,vector<int>> grid;
set<pair<int,int>> cur;
vector<int> elim(MAX,-1);
int dist(pair<int,int> p1, pair<int,int> p2) {return (p2.first-p1.first)*(p2.first-p1.first) + (p2.second-p1.second)*(p2.second-p1.second);}
bool intsct(pair<int,pair<int,int>> c1, pair<int,pair<int,int>> c2) {return dist(c1.second,c2.second) <= (c1.first+c2.first)*(c1.first+c2.first);}
int toInt(int xbin, int ybin) {return xbin + ybin * (int)(5e9);}
void makeGrid() {
grid.clear();
grid.reserve(count(elim.begin(),elim.end(),-1));
for (int i = 0; i < n; i++) {
if (elim[i] != -1) continue;
auto c = circles[i]; auto p = c.second;
int xbin = p.first/gridSize; int ybin = p.second/gridSize;
// cout << toInt(p) << "\n";
//assert (toInt(p) < numeric_limits<long long>::max());
if (grid.count(toInt(xbin,ybin)) == 0) grid[toInt(xbin,ybin)] = {i};
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

컴파일 시 표준 에러 (stderr) 메시지

circle_selection.cpp:35:6: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
 main() {
      ^
#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...