| Task: | Gap |
| Sender: | henrikaalto |
| Submission time: | 2019-04-14 17:16:06 +0300 |
| Language: | C++ |
| Status: | COMPILE ERROR |
Compiler report
input/code.cpp: In function 'll findGap(ll, ll)':
input/code.cpp:7:6: warning: unused variable 'start' [-Wunused-variable]
ll start = 0;
^~~~~
output/ccVesMtm.o: In function `main':
code.cpp:(.text.startup+0xbd): undefined reference to `findGap(int, int)'
collect2: error: ld returned 1 exit statusCode
#include <bits/stdc++.h>
#include "gap.h"
typedef long long ll;
#define MAX (1e18)
ll findGap(ll t,ll n) {
ll res = 0;
ll start = 0;
ll min = 0, max = 0;
(void) MinMax(0,MAX,&min, &max);
ll a = min;
ll b = max;
for (;;) {
ll o = b-1;
(void) MinMax(0,MAX,&a, &o);
if (a == o) {
break;
}
res = std:: max(res, b-o);
b = o;
}
return res;
}
