Submission #709232

#TimeUsernameProblemLanguageResultExecution timeMemory
709232lmqzzzGap (APIO16_gap)C++14
Compilation error
0 ms0 KiB
#include "gap.h" #include <bits/stdc++.h> using namespace std; long long findGap(int T, int N) { if (T == 1) { vector<int64_t> l, r; int times = N + 1 >> 1; int64_t ll = 0, rr = 1e18; while (times--) { int64_t a, b; MinMax(ll, rr, &a, &b); l.emplace_back(a); r.emplace_back(b); ll = a + 1, rr = b - 1; assert(ll <= rr); } if (l.back() == r.back()) l.pop_back(); reverse(r.begin(), r.end()); l.insert(l.end(), r.begin(), r.end()); int64_t res = 0; for (int i = 1; i < N; i++) res = max(res, l[i] - l[i - 1]); return res; } return 0; }

Compilation message (stderr)

gap.cpp: In function 'long long int findGap(int, int)':
gap.cpp:9:31: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
    9 |                 int times = N + 1 >> 1;
      |                             ~~^~~
gap.cpp:13:40: error: invalid conversion from 'int64_t*' {aka 'long int*'} to 'long long int*' [-fpermissive]
   13 |                         MinMax(ll, rr, &a, &b);
      |                                        ^~
      |                                        |
      |                                        int64_t* {aka long int*}
In file included from gap.cpp:1:
gap.h:1:35: note:   initializing argument 3 of 'void MinMax(long long int, long long int, long long int*, long long int*)'
    1 | void MinMax(long long, long long, long long*, long long*);
      |                                   ^~~~~~~~~~
gap.cpp:13:44: error: invalid conversion from 'int64_t*' {aka 'long int*'} to 'long long int*' [-fpermissive]
   13 |                         MinMax(ll, rr, &a, &b);
      |                                            ^~
      |                                            |
      |                                            int64_t* {aka long int*}
In file included from gap.cpp:1:
gap.h:1:47: note:   initializing argument 4 of 'void MinMax(long long int, long long int, long long int*, long long int*)'
    1 | void MinMax(long long, long long, long long*, long long*);
      |                                               ^~~~~~~~~~