Submission #218709

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
2187092020-04-02 14:45:56VimmerMatching (COCI20_matching)C++14
Compilation error
0 ms0 KiB
#include <bits/stdc++.h>
//#pragma GCC optimize("unroll-loops")
//#pragma GCC optimize("-O3")
//#pragma GCC optimize("Ofast")
#define F first
#define S second
#define sz(x) int(x.size())
#define pb push_back
#define N 100001
using namespace std;
int x[N], y[N], a[N][2], n, xr[N], yr[N];
set <int> tx[N * 4], ty[N * 4];
set <pair <int, int> > tx_del[N * 4], ty_del[N * 4];
vector <int> pshx[N * 4], pshy[N * 4];
vector <pair <int, int> > pshx_del[N * 4], pshy_del[N * 4], pshx_add[N * 4], pshy_add[N * 4];
bool mk[N], mkr[N][2];
queue <int> alone;
vector <pair <int, int> > g, gr;
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

matching.cpp: In function 'void upd(int&, int&, int&, int&, int&, int&, bool&)':
matching.cpp:65:11: error: cannot bind non-const lvalue reference of type 'int&' to an rvalue of type 'int'
     upd(v + v, tl, md, l, r, val, f);
         ~~^~~
matching.cpp:55:13: note:   initializing argument 1 of 'void upd(int&, int&, int&, int&, int&, int&, bool&)'
 inline void upd(int &v, int &tl, int &tr, int &l, int &r, int &val, bool &f)
             ^~~
matching.cpp:67:15: error: cannot bind non-const lvalue reference of type 'int&' to an rvalue of type 'int'
     upd(v + v + 1, md + 1, tr, l, r, val, f);
         ~~~~~~^~~
matching.cpp:55:13: note:   initializing argument 1 of 'void upd(int&, int&, int&, int&, int&, int&, bool&)'
 inline void upd(int &v, int &tl, int &tr, int &l, int &r, int &val, bool &f)
             ^~~
matching.cpp: In function 'void upd_del(int&, int&, int&, int&, int&, std::pair<int, int>&, bool&)':
matching.cpp:127:15: error: cannot bind non-const lvalue reference of type 'int&' to an rvalue of type 'int'
     upd_del(v + v, tl, md, l, r, val, f);
             ~~^~~
matching.cpp:117:13: note:   initializing argument 1 of 'void upd_del(int&, int&, int&, int&, int&, std::pair<int, int>&, bool&)'
 inline void upd_del(int &v, int &tl, int &tr, int &l, int &r, pair <int, int> &val, bool &f)
             ^~~~~~~
matching.cpp:129:19: error: cannot bind non-const lvalue reference of type 'int&' to an rvalue of type 'int'
     upd_del(v + v + 1, md + 1, tr, l, r, val, f);
             ~~~~~~^~~
matching.cpp:117:13: note:   initializing argument 1 of 'void upd_del(int&, int&, int&, int&, int&, std::pair<int, int>&, bool&)'
 inline void upd_del(int &v, int &tl, int &tr, int &l, int &r, pair <int, int> &val, bool &f)
             ^~~~~~~
matching.cpp: In function 'void upd_remove(int&, int&, int&, int&, int&, std::pair<int, int>&, bool&)':
matching.cpp:142:18: error: cannot bind non-const lvalue reference of type 'int&' to an rvalue of type 'int'
     upd_remove(v + v, tl, md, l, r, val, f);
                ~~^~~
matching.cpp:132:13: note:   initializing argument 1 of 'void upd_remove(int&, int&, int&, int&, int&, std::pair<int, int>&, bool&)'
 inline void upd_remove(int &v, int &tl, int &tr, int &l, int &r, pair <int, int> &val, bool &f)
             ^~~~~~~~~~
matching.cpp:144:22: error: cannot bind non-const lvalue reference of type 'int&' to an rvalue of type 'int'
     upd_remove(v + v + 1, md + 1, tr, l, r, val, f);
                ~~~~~~^~~
matching.cpp:132:13: note:   initializing argument 1 of 'void upd_remove(int&, int&, int&, int&, int&, std::pair<int, int>&, bool&)'
 inline void upd_remove(int &v, int &tl, int &tr, int &l, int &r, pair <int, int> &val, bool &f)
             ^~~~~~~~~~
matching.cpp: In function 'bool good(int&, int&, int&, int&, int&, int&, bool&)':
matching.cpp:172:38: error: cannot bind non-const lvalue reference of type 'int&' to an rvalue of type 'int'
         if (pos <= md) return good(v + v, tl, md, pos, l, r, f);
                                    ~~^~~
matching.cpp:147:13: note:   initializing argument 1 of 'bool good(int&, int&, int&, int&, int&, int&, bool&)'
 inline bool good(int &v, int &tl, int &tr, int &pos, int &l, int &r, bool &f)
             ^~~~
matching.cpp:174:27: error: cannot bind non-const lvalue reference of type 'int&' to an rvalue of type 'int'
         return good(v + v + 1, md + 1, tr, pos, l, r, f);
                     ~~~~~~^~~
matching.cpp:147:13: note:   initializing argument 1 of 'bool good(int&, int&, int&, int&, int&, int&, bool&)'
 inline bool good(int &v, int &tl, int &tr, int &pos, int &l, int &r, bool &f)
             ^~~~
matching.cpp: In function 'int good_del(int&, int&, int&, int&, int&, int&, bool&)':
matching.cpp:207:42: error: cannot bind non-const lvalue reference of type 'int&' to an rvalue of type 'int'
         if (pos <= md) return good_del(v + v, tl, md, pos, l, r, f);
                                        ~~^~~
matching.cpp:178:12: note:   initializing argument 1 of 'int good_del(int&, int&, int&, int&, int&, int&, bool&)'
 inline int good_del(int &v, int &tl, int &tr, int &pos, int &l, int &r, bool &f)
            ^~~~~~~~
matching.cpp:209:31: error: cannot bind non-const lvalue reference of type 'int&' to an rvalue of type 'int'
         return good_del(v + v + 1, md + 1, tr, pos, l, r, f);
                         ~~~~~~^~~
matching.cpp:178:12: note:   initializing argument 1 of 'int good_del(int&, int&, int&, int&, int&, int&, bool&)'
 inline int good_del(int &v, int &tl, int &tr, int &pos, int &l, int &r, bool &f)
            ^~~~~~~~
matching.cpp: In function 'bool gd(int&, int&)':
matching.cpp:219:56: error: cannot bind non-const lvalue reference of type 'int&' to an rvalue of type 'int'
         return good(1, 1, N - 1, x[fr], y[fr], y[sc], 0);
                                                        ^
matching.cpp:147:13: note:   initializing argument 1 of 'bool good(int&, int&, int&, int&, int&, int&, bool&)'
 inline bool good(int &v, int &tl, int &tr, int &pos, int &l, int &r, bool &f)
             ^~~~
matching.cpp:225:56: error: cannot bind non-const lvalue reference of type 'int&' to an rvalue of type 'int'
         return good(1, 1, N - 1, y[fr], x[fr], x[sc], 1);
                                                        ^
matching.cpp:147:13: note:   initializing argument 1 of 'bool good(int&, int&, int&, int&, int&, int&, bool&)'
 inline bool good(int &v, int &tl, int &tr, int &pos, int &l, int &r, bool &f)
             ^~~~
matching.cpp: In function 'void add_remove(int&, int&, int&)':
matching.cpp:239:58: error: cannot bind non-const lvalue reference of type 'int&' to an rvalue of type 'int'
         upd_remove(1, 1, N, y[fr], y[sc], {x[fr], nm }, 1);
                                                          ^
matching.cpp:132:13: note:   initializing argument 1 of 'void upd_remove(int&, int&, int&, int&, int&, std::pair<int, int>&, bool&)'
 inline void upd_remove(int &v, int &tl, int &tr, int &l, int &r, pair <int, int> &val, bool &f)
             ^~~~~~~~~~
matching.cpp:245:58: error: cannot bind non-const lvalue reference of type 'int&' to an rvalue of type 'int'
         upd_remove(1, 1, N, x[fr], x[sc], {y[fr], nm }, 0);
                                                          ^
matching.cpp:132:13: note:   initializing argument 1 of 'void upd_remove(int&, int&, int&, int&, int&, std::pair<int, int>&, bool&)'
 inline void upd_remove(int &v, int &tl, int &tr, int &l, int &r, pair <int, int> &val, bool &f)
             ^~~~~~~~~~
matching.cpp: In function 'void seacrh(int&, int&)':
matching.cpp:255:58: error: cannot bind non-const lvalue reference of type 'int&' to an rvalue of type 'int'
         int pt = good_del(1, 1, N, x[fr], y[fr], y[sc], 0);
                                                          ^
matching.cpp:178:12: note:   initializing argument 1 of 'int good_del(int&, int&, int&, int&, int&, int&, bool&)'
 inline int good_del(int &v, int &tl, int &tr, int &pos, int &l, int &r, bool &f)
            ^~~~~~~~
matching.cpp:261:58: error: cannot bind non-const lvalue reference of type 'int&' to an rvalue of type 'int'
             pt = good_del(1, 1, N, x[fr], y[fr], y[sc], 0);
                                                          ^
matching.cpp:178:12: note:   initializing argument 1 of 'int good_del(int&, int&, int&, int&, int&, int&, bool&)'
 inline int good_del(int &v, int &tl, int &tr, int &pos, int &l, int &r, bool &f)
            ^~~~~~~~
matching.cpp:268:58: error: cannot bind non-const lvalue reference of type 'int&' to an rvalue of type 'int'
         int pt = good_del(1, 1, N, y[fr], x[fr], x[sc], 1);
                                                          ^
matching.cpp:178:12: note:   initializing argument 1 of 'int good_del(int&, int&, int&, int&, int&, int&, bool&)'
 inline int good_del(int &v, int &tl, int &tr, int &pos, int &l, int &r, bool &f)
            ^~~~~~~~
matching.cpp:274:58: error: cannot bind non-const lvalue reference of type 'int&' to an rvalue of type 'int'
             pt = good_del(1, 1, N, y[fr], x[fr], x[sc], 1);
                                                          ^
matching.cpp:178:12: note:   initializing argument 1 of 'int good_del(int&, int&, int&, int&, int&, int&, bool&)'
 inline int good_del(int &v, int &tl, int &tr, int &pos, int &l, int &r, bool &f)
            ^~~~~~~~
matching.cpp: In function 'void add(int&, int&)':
matching.cpp:287:48: error: cannot bind non-const lvalue reference of type 'int&' to an rvalue of type 'int'
         upd(1, 1, N - 1, y[fr], y[sc], x[fr], 1);
                                                ^
matching.cpp:55:13: note:   initializing argument 1 of 'void upd(int&, int&, int&, int&, int&, int&, bool&)'
 inline void upd(int &v, int &tl, int &tr, int &l, int &r, int &val, bool &f)
             ^~~
matching.cpp:297:48: error: cannot bind non-const lvalue reference of type 'int&' to an rvalue of type 'int'
         upd(1, 1, N - 1, x[fr], x[sc], y[fr], 0);
                                                ^
matching.cpp:55:13: note:   initializing argument 1 of 'void upd(int&, int&, int&, int&, int&, int&, bool&)'
 inline void upd(int &v, int &tl, int &tr, int &l, int &r, int &val, bool &f)
             ^~~
matching.cpp: In function 'void add_del(int&, int&)':
matching.cpp:356:59: error: cannot bind non-const lvalue reference of type 'int&' to an rvalue of type 'int'
         upd_del(1, 1, N, y[fr], y[sc], {x[fr], sz(gr) }, 1);
                                                           ^
matching.cpp:117:13: note:   initializing argument 1 of 'void upd_del(int&, int&, int&, int&, int&, std::pair<int, int>&, bool&)'
 inline void upd_del(int &v, int &tl, int &tr, int &l, int &r, pair <int, int> &val, bool &f)
             ^~~~~~~
matching.cpp:370:59: error: cannot bind non-const lvalue reference of type 'int&' to an rvalue of type 'int'
         upd_del(1, 1, N, x[fr], x[sc], {y[fr], sz(gr) }, 0);
                                                           ^
matching.cpp:117:13: note:   initializing argument 1 of 'void upd_del(int&, int&, int&, int&, int&, std::pair<int, int>&, bool&)'
 inline void upd_del(int &v, int &tl, int &tr, int &l, int &r, pair <int, int> &val, bool &f)
             ^~~~~~~