Submission #877009

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
8770092023-11-22 17:01:07406Reconstruction Project (JOI22_reconstruction)C++17
Compilation error
0 ms0 KiB
#pragma GCC optimize ("O3,unroll-loops")
#pragma GCC target("avx2")
//besmellah
//accept sho :D
//de akhe mashti NM * DSU nabayad AC she?
//oon moghe NM log bood hichi
//alan vali NM DSU ee
//man ozrkhahi mikonam az tarah
//che bug sangini zadim
#include <bits/stdc++.h>
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
//#define int long long
using namespace std;
using ar = array<int, 2>;
using ar4 = array<int, 4>;
const int M = 1e5 + 5, N = 505, Q = 1e6 + 5;
const long long INF = 1ll << 30;
inline namespace dsu {
int dpr[N];
void init() {
memset(dpr, -1, sizeof dpr);
}
int gpr(int x) {
return dpr[x] < 0 ? x : dpr[x] = gpr(dpr[x]);
}
bool merge(int u, int v) {
u = gpr(u), v = gpr(v);
if (u == v) return false;
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

reconstruction.cpp:37:23: error: 'ar5' does not name a type; did you mean 'ar4'?
   37 | inline bool cmp(const ar5 &X, const ar5 &Y) {
      |                       ^~~
      |                       ar4
reconstruction.cpp:37:37: error: 'ar5' does not name a type; did you mean 'ar4'?
   37 | inline bool cmp(const ar5 &X, const ar5 &Y) {
      |                                     ^~~
      |                                     ar4
reconstruction.cpp: In function 'bool cmp(const int&, const int&)':
reconstruction.cpp:38:17: error: invalid types 'const int[int]' for array subscript
   38 |         return X[0] < Y[0];
      |                 ^
reconstruction.cpp:38:24: error: invalid types 'const int[int]' for array subscript
   38 |         return X[0] < Y[0];
      |                        ^
reconstruction.cpp: In function 'void dfs(int, int)':
reconstruction.cpp:47:9: error: 'seen' was not declared in this scope
   47 |         seen[v] = true;
      |         ^~~~
reconstruction.cpp: In function 'int main()':
reconstruction.cpp:97:62: error: expected primary-expression before ',' token
   97 |                         ar4 X = {-E[p][0], E[p][1], E[p][2], , 0};
      |                                                              ^
reconstruction.cpp:142:25: error: 'seen' was not declared in this scope
  142 |                         seen = 0;
      |                         ^~~~
reconstruction.cpp:150:46: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
  150 |                                 minl = min(W + w >> 1, minl);
      |                                            ~~^~~
In file included from /usr/include/c++/10/bits/stl_algobase.h:71,
                 from /usr/include/c++/10/bits/specfun.h:45,
                 from /usr/include/c++/10/cmath:1927,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:41,
                 from reconstruction.cpp:10:
/usr/include/c++/10/bits/predefined_ops.h: In instantiation of 'constexpr bool __gnu_cxx::__ops::_Iter_comp_iter<_Compare>::operator()(_Iterator1, _Iterator2) [with _Iterator1 = __gnu_cxx::__normal_iterator<std::array<int, 4>*, std::vector<std::array<int, 4> > >; _Iterator2 = __gnu_cxx::__normal_iterator<std::array<int, 4>*, std::vector<std::array<int, 4> > >; _Compare = bool (*)(const int&, const int&)]':
/usr/include/c++/10/bits/stl_algo.h:4905:14:   required from '_OutputIterator std::__merge(_InputIterator1, _InputIterator1, _InputIterator2, _InputIterator2, _OutputIterator, _Compare) [with _InputIterator1 = __gnu_cxx::__normal_iterator<std::array<int, 4>*, std::vector<std::array<int, 4> > >; _InputIterator2 = __gnu_cxx::__normal_iterator<std::array<int, 4>*, std::vector<std::array<int, 4> > >; _OutputIterator = __gnu_cxx::__normal_iterator<std::array<int, 4>*, std::vector<std::array<int, 4> > >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter<bool (*)(const int&, const int&)>]'
/usr/include/c++/10/bits/stl_algo.h:5014:37:   required from '_OIter std::merge(_IIter1, _IIter1, _IIter2, _IIter2, _OIter, _Compare) [with _IIter1 = __gnu_cxx::__normal_iterator<std::array<int, 4>*, std::vector<std::array<int, 4> > >; _IIter2 = __gnu_cxx::__normal_iterator<std::array<int, 4>*, std::vector<std::array<int, 4> > >; _OIter = __gnu_cxx::__normal_iterator<std::array<int, 4>*, std::vector<std::array<int, 4> > >; _Compare = bool (*)(const int&, const int&)]'
reconstruction.cpp:120:90:   required from here
/usr/include/c++/10/bits/predefined_ops.h:156:30: error: invalid initialization of reference of type 'const int&' from expression of type 'std::array<int, 4>'
  156 |         { return bool(_M_comp(*__it1, *__it2)); }
      |                       ~~~~~~~^~~~~~~~~~~~~~~~
/usr/include/c++/10/bits/predefined_ops.h: In instantiation of 'bool __gnu_cxx::__ops::_Iter_comp_val<_Compare>::operator()(_Iterator, _Value&) [with _Iterator = __gnu_cxx::__normal_iterator<std::array<int, 4>*, std::vector<std::array<int, 4> > >; _Value = const std::array<int, 4>; _Compare = bool (*)(const int&, const int&)]':
/usr/include/c++/10/bits/stl_algobase.h:1324:14:   required from '_ForwardIterator std::__lower_bound(_ForwardIterator, _ForwardIterator, const _Tp&, _Compare) [with _ForwardIterator = __gnu_cxx::__normal_iterator<std::array<int, 4>*, std::vector<std::array<int, 4> > >; _Tp = std::array<int, 4>; _Compare = __gnu_cxx::__ops::_Iter_comp_val<bool (*)(const int&, const int&)>]'
/usr/include/c++/10/bits/stl_algo.h:2041:32:   required from '_FIter std::lower_bound(_FIter, _FIter, const _Tp&, _Compare) [with _FIter = __gnu_cxx::__normal_iterator<std::array<int, 4>*, std::vector<std::array<int, 4> > >; _Tp = std::array<int, 4>; _Compare = bool (*)(const int&, const int&)]'
reconstruction.cpp:85:70:   required from here
/usr/include/c++/10/bits/predefined_ops.h:194:23: error: invalid initialization of reference of type 'const int&' from expression of type 'std::array<int, 4>'
  194 |  { return bool(_M_comp(*__it, __val)); }
      |                ~~~~~~~^~~~~~~~~~~~~~