Submission #497193

#TimeUsernameProblemLanguageResultExecution timeMemory
497193ignaciocantaGap (APIO16_gap)C++14
30 / 100
46 ms1932 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:28:1: warning: control reaches end of non-void function [-Wreturn-type]
   28 | }
      | ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...