Submission #111475

#TimeUsernameProblemLanguageResultExecution timeMemory
111475ecasdqinaGap (APIO16_gap)C++14
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> using namespace std::literals::string_literals; using i64 = long long; using std::cout; using std::endl; using std::cin; template<typename T> std::vector<T> make_v(size_t a){return std::vector<T>(a);} template<typename T,typename... Ts> auto make_v(size_t a,Ts... ts){ return std::vector<decltype(make_v<T>(ts...))>(a,make_v<T>(ts...)); } i64 FindGap(int t, int n) { std::vector<i64> vec; i64 L = 0, R = 1e18; for(int i = 0; i < 1000; i++) { i64 A = -1, B = -1; MinMax(L, R, A, B); if(A == -1) break; vec.push_back(A); vec.push_back(B); R = B - 1; } sort(begin(vec), end(vec)); vec.erase(unique(begin(vec), end(vec)), end(vec)); i64 ans = 0; for(int i = 0; i < vec.size() - 1; i++) ans = std::max(ans, vec[i + 1] - vec[i]); return ans; };

Compilation message (stderr)

gap.cpp: In function 'i64 FindGap(int, int)':
gap.cpp:22:3: error: 'MinMax' was not declared in this scope
   MinMax(L, R, A, B);
   ^~~~~~
gap.cpp:22:3: note: suggested alternative: 'rindex'
   MinMax(L, R, A, B);
   ^~~~~~
   rindex
gap.cpp:33:19: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  for(int i = 0; i < vec.size() - 1; i++) ans = std::max(ans, vec[i + 1] - vec[i]);
                 ~~^~~~~~~~~~~~~~~~