Submission #39802

#TimeUsernameProblemLanguageResultExecution timeMemory
3980214kgGap (APIO16_gap)C++11
0 / 100
106 ms9052 KiB
#include "gap.h" #include <set> #define NUM_MAX 1000000000000000000 #define max2(x,y) (x>y?x:y) using namespace std; set<long long> S; long long f1() { long long l = 0, r = NUM_MAX; long long t1, t2, res = 0; while (l <= r) { MinMax(l, r, &t1, &t2); if (t1 < 0) break; S.insert(l = t1), S.insert(r = t2); l++, r--; } t1 = NUM_MAX; for (auto i : S) res = max2(res, i - t1), t1 = i; return res; } long long findGap(int T, int _n) { if (T == 1) return f1(); else; }

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]
 }
 ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...