Submission #560221

#TimeUsernameProblemLanguageResultExecution timeMemory
560221Trisanu_DasGap (APIO16_gap)C++17
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> #include "gap.h" #define int long long int int findGap(int type, int n){ int ma, mi, ans; MinMax(0, 2e18, &mi, &ma); if(type == 1){ for(int i = 1; i < (n + 1) / 2; ++i){ int currma, currmi; MinMax(mi + 1, ma - 1, &currmi, &currma); ans = max(ans, max(currmi - mi, ma - currma)); mi = currmi; ma = currma; } return ans = max(ans, mx - mn); } }

Compilation message (stderr)

gap.cpp: In function 'long long int findGap(long long int, long long int)':
gap.cpp:12:22: error: 'max' was not declared in this scope; did you mean 'std::max'?
   12 |       ans = max(ans, max(currmi - mi, ma - currma));
      |                      ^~~
      |                      std::max
In file included from /usr/include/c++/10/algorithm:62,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:65,
                 from gap.cpp:1:
/usr/include/c++/10/bits/stl_algo.h:3486:5: note: 'std::max' declared here
 3486 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
gap.cpp:12:13: error: 'max' was not declared in this scope; did you mean 'std::max'?
   12 |       ans = max(ans, max(currmi - mi, ma - currma));
      |             ^~~
      |             std::max
In file included from /usr/include/c++/10/algorithm:62,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:65,
                 from gap.cpp:1:
/usr/include/c++/10/bits/stl_algo.h:3486:5: note: 'std::max' declared here
 3486 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
gap.cpp:15:27: error: 'mx' was not declared in this scope; did you mean 'mi'?
   15 |     return ans = max(ans, mx - mn);
      |                           ^~
      |                           mi
gap.cpp:15:32: error: 'mn' was not declared in this scope; did you mean 'mi'?
   15 |     return ans = max(ans, mx - mn);
      |                                ^~
      |                                mi
gap.cpp:15:18: error: 'max' was not declared in this scope; did you mean 'std::max'?
   15 |     return ans = max(ans, mx - mn);
      |                  ^~~
      |                  std::max
In file included from /usr/include/c++/10/algorithm:62,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:65,
                 from gap.cpp:1:
/usr/include/c++/10/bits/stl_algo.h:3486:5: note: 'std::max' declared here
 3486 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~