Submission #367729

#TimeUsernameProblemLanguageResultExecution timeMemory
367729abra_stoneGap (APIO16_gap)C++14
30 / 100
59 ms2468 KiB
#include "gap.h" #include <vector> #include <algorithm> using namespace std; typedef long long ll; ll ans; vector<ll> a; ll findGap(int T, int n) { ll i, mn = 0, mx = 2e18; for (i = 0; i < n; i += 2) { MinMax(mn, mx, &mn, &mx); a.push_back(mn); a.push_back(mx); mn++; mx--; } sort(a.begin(), a.end()); for (i = 1; i < a.size(); i++) { ans = max(ans, a[i] - a[i - 1]); } return ans; }

Compilation message (stderr)

gap.cpp: In function 'll findGap(int, int)':
gap.cpp:20:19: warning: comparison of integer expressions of different signedness: 'll' {aka 'long long int'} and 'std::vector<long long int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   20 |     for (i = 1; i < a.size(); i++) {
      |                 ~~^~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...