Submission #54465

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
544652018-07-03 14:43:00SpaimaCarpatilor원 고르기 (APIO18_circle_selection)C++17
100 / 100
1938 ms447580 KiB
#include<bits/stdc++.h>
using namespace std;
int N, x[300009], y[300009], r[300009], id[300009], oldOrd[300009], ord[300009], ans[300009];
pair < int, int > h[300009];
bool cmp (int i, int j)
{
if (r[i] == r[j]) return (i < j);
return (r[i] > r[j]);
}
unsigned int K = 1 << 31;
void doubleGrid ()
{
memcpy (oldOrd, ord, sizeof (ord));
int M = 0;
for (int i=1; i<=N; i++)
{
int j = i;
while (j < N && h[j + 1].first == h[j].first) j++;
for (int k=0; k<2; k++)
for (int l=i; l<=j; l++)
{
int r = l;
while (r < j && h[r + 1].second == h[l].second) r ++;
///playing with [l, r]
for (int p=0; p<2; p++)
for (int pos=l; pos<=r; pos++)
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

circle_selection.cpp: In function 'int main()':
circle_selection.cpp:77:18: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     while (K / 2 >= r[id[i]])
            ~~~~~~^~~~~~~~~~~
circle_selection.cpp:69:7: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
 scanf ("%d", &N);
 ~~~~~~^~~~~~~~~~
circle_selection.cpp:73:30: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
     scanf ("%d %d %d", &x[i], &y[i], &r[i]),
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     x[i] += 1e9, y[i] += 1e9,
     ~~~~~~~~~~~~~~~~~~~~~~~~~~
     ord[i] = i, h[i] = {0, 0}, id[i] = i;
     ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~
#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...