Submission #540516

#TimeUsernameProblemLanguageResultExecution timeMemory
540516dutinmeowGap (APIO16_gap)C++17
0 / 100
55 ms2272 KiB
#include <bits/stdc++.h> using namespace std; #include "gap.h" const long long MAX_A = 1e18; long long findGap(int T, int N) { if (T == 1) { long long l = 1, r = MAX_A; vector<long long> A; for (int i = 0; i < (N + 1) / 2; i++) { long long nl, nr; MinMax(l, r, &nl, &nr); A.push_back(l); A.push_back(r); l = ++nl, r = --nr; } sort(A.begin(), A.end()); long long ans = 0; for (int i = 1; i < N; i++) ans = max(ans, A[i] - A[i - 1]); return ans; } else { } }

Compilation message (stderr)

gap.cpp: In function 'long long int findGap(int, int)':
gap.cpp:27:1: warning: control reaches end of non-void function [-Wreturn-type]
   27 | }
      | ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...