Submission #709237

#TimeUsernameProblemLanguageResultExecution timeMemory
709237lmqzzzGap (APIO16_gap)C++14
30 / 100
43 ms2900 KiB
#include "gap.h" #include <bits/stdc++.h> using namespace std; #define int64_t long long 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; } 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:10:31: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
   10 |                 int times = N + 1 >> 1;
      |                             ~~^~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...