Submission #253015

# Submission time Handle Problem Language Result Execution time Memory
253015 2020-07-26T15:57:05 Z infinite_iq Circle selection (APIO18_circle_selection) C++14
Compilation error
0 ms 0 KB
#define fast ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0)
#include <bits/stdc++.h>
using namespace std;
#define sqr 340
#define mp make_pair
#define mid (l+r)/2
#define le node * 2 
#define ri node * 2 + 1 
#define pb push_back
#define ppb pop_back
#define fi first
#define se second
#define lb lower_bound
#define ub upper_bound
#define ins insert
#define era erase
#define C continue
#define mem(dp,i) memset(dp,i,sizeof(dp))
#define mset multiset
#define all(x) x.begin(), x.end()
#define gc getchar_unlocked
typedef long long ll;
typedef short int si;
typedef long double ld;
typedef pair<int,int> pi;
typedef pair<ll,ll> pll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<pi> vpi;
typedef vector<pll> vpll;
typedef pair<double,ll>pdi;
const ll inf=1e18;
const ll mod=987654321;
const ld Pi=acos(-1);
int n ;
int X [300009] , Y [300009] , R [300009] ;
int ans [300009] ;
int main () {
        cin >> n ;
        for ( int i = 0 ; i < n ; i ++ ) {
                scanf ("%d%d%d", &X [i], &Y [i] , &R [i] ) ;
                s1 .ins ( { R [i] , n - i } ) ;
                s2 .ins ( { X [i] - R [i] , i } ) ;
                s3 .ins ( { X [i] + R [i] , i } ) ;
        }
        while ( s1 .size () ) {
                pi ret = * s1 .rbegin () ;
                s1 .era ( ( -- s1.end () ) ) ;
                ret .se = n - ret .se ;
                int l = X [ret.se] - R [ret.se] , r = X [ret.se] + R [ret.se] ;
                vi todel ;
                for ( auto it = s2 .lb ( { l , - 1 } ) ; it != s2 .end () ; it ++ ) {
                        pi crnt = *it ;
                        if ( crnt .fi > r ) break ;
                        todel .pb ( crnt .se ) ;
                }
                for ( auto it = s3 .lb ( { l , - 1 } ) ; it != s3 .end () ; it ++ ) {
                        pi crnt = *it ;
                        if ( crnt .fi > r ) break ;
                        todel .pb ( crnt .se ) ;
                }
                for ( auto u : todel ) {
                        if ( s1 .find ( {   R [u] , u } ) != s1 .end () )
                                s1 .era ( { R [u] , u } ) ;
                        if ( s2 .find ( {   X [u] - R [u] , u } ) != s2 .end () )
                                s2 .era ( { X [u] - R [u] , u } ) ;
                        if ( s3 .find ( {   X [u] + R [u] , u } ) != s3 .end () )
                                s3 .era ( { X [u] + R [u] , u } ) ;
                        ans [u] = ret .se ;
                }
        }
        for ( int i = 0 ; i < n ; i ++ ) printf ("%d ", ans [i] + 1 ) ;
        cout << endl ;
}

Compilation message

circle_selection.cpp: In function 'int main()':
circle_selection.cpp:42:17: error: 's1' was not declared in this scope
                 s1 .ins ( { R [i] , n - i } ) ;
                 ^~
circle_selection.cpp:42:17: note: suggested alternative: 'si'
                 s1 .ins ( { R [i] , n - i } ) ;
                 ^~
                 si
circle_selection.cpp:43:17: error: 's2' was not declared in this scope
                 s2 .ins ( { X [i] - R [i] , i } ) ;
                 ^~
circle_selection.cpp:43:17: note: suggested alternative: 'si'
                 s2 .ins ( { X [i] - R [i] , i } ) ;
                 ^~
                 si
circle_selection.cpp:44:17: error: 's3' was not declared in this scope
                 s3 .ins ( { X [i] + R [i] , i } ) ;
                 ^~
circle_selection.cpp:44:17: note: suggested alternative: 'si'
                 s3 .ins ( { X [i] + R [i] , i } ) ;
                 ^~
                 si
circle_selection.cpp:46:17: error: 's1' was not declared in this scope
         while ( s1 .size () ) {
                 ^~
circle_selection.cpp:46:17: note: suggested alternative: 'si'
         while ( s1 .size () ) {
                 ^~
                 si
circle_selection.cpp:52:33: error: 's2' was not declared in this scope
                 for ( auto it = s2 .lb ( { l , - 1 } ) ; it != s2 .end () ; it ++ ) {
                                 ^~
circle_selection.cpp:52:33: note: suggested alternative: 'si'
                 for ( auto it = s2 .lb ( { l , - 1 } ) ; it != s2 .end () ; it ++ ) {
                                 ^~
                                 si
circle_selection.cpp:57:33: error: 's3' was not declared in this scope
                 for ( auto it = s3 .lb ( { l , - 1 } ) ; it != s3 .end () ; it ++ ) {
                                 ^~
circle_selection.cpp:57:33: note: suggested alternative: 'si'
                 for ( auto it = s3 .lb ( { l , - 1 } ) ; it != s3 .end () ; it ++ ) {
                                 ^~
                                 si
circle_selection.cpp:65:30: error: 's2' was not declared in this scope
                         if ( s2 .find ( {   X [u] - R [u] , u } ) != s2 .end () )
                              ^~
circle_selection.cpp:65:30: note: suggested alternative: 'si'
                         if ( s2 .find ( {   X [u] - R [u] , u } ) != s2 .end () )
                              ^~
                              si
circle_selection.cpp:67:30: error: 's3' was not declared in this scope
                         if ( s3 .find ( {   X [u] + R [u] , u } ) != s3 .end () )
                              ^~
circle_selection.cpp:67:30: note: suggested alternative: 'si'
                         if ( s3 .find ( {   X [u] + R [u] , u } ) != s3 .end () )
                              ^~
                              si
circle_selection.cpp:41:23: 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] ) ;
                 ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~