Submission #497192

#TimeUsernameProblemLanguageResultExecution timeMemory
497192ignaciocantaGap (APIO16_gap)C++14
0 / 100
48 ms1936 KiB
#include "gap.h" #include <bits/stdc++.h> using namespace std; #define FOR(i, a, b) for(int i = (a); i < (b); ++i) #define F0R(i, a) FOR(i, 0, a) using vi = vector<int>; using tint = long long; using vl = vector<tint>; long long findGap(int T, int n) { if(T == 1){ vl a(n); int l = 0, r = n-1; tint L = 0, R = 1e18; while(l < r){ MinMax(L, R, &L, &R); a[l] = L; a[r] = R; ++L; --R; ++l; --r; } tint maxi = 0; F0R(i, n-1) maxi = max(maxi, a[i+1] - a[i]); return maxi; } }

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...