#include "gap.h"
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll,ll> ii;
ll NN,TT,maior;
void binary_search(ll ini,ll fim){
if(ini == fim) return;
ll copia1,copia2;
ll meio = ini + (fim - ini)/2;
MinMax(meio+1,meio,&copia1,&copia2);
maior = max(maior, abs(copia1 - copia2) );
if(fim - ini <= maior) return;
binary_search(ini,copia2);
binary_search(copia1,fim);
return;
}
ll findGap(int T,int N){
TT = T;
NN = N;
ll ini = 0,fim = (ll)1e18,copia1,copia2;
MinMax(ini,fim,&copia1,&copia2);
binary_search(copia1,copia2);
return maior;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
1 ms |
248 KB |
Execution failed because the return code was nonzero |
2 |
Runtime error |
1 ms |
352 KB |
Execution failed because the return code was nonzero |
3 |
Runtime error |
2 ms |
428 KB |
Execution failed because the return code was nonzero |
4 |
Runtime error |
1 ms |
496 KB |
Execution failed because the return code was nonzero |
5 |
Runtime error |
1 ms |
568 KB |
Execution failed because the return code was nonzero |
6 |
Runtime error |
2 ms |
568 KB |
Execution failed because the return code was nonzero |
7 |
Runtime error |
2 ms |
600 KB |
Execution failed because the return code was nonzero |
8 |
Runtime error |
2 ms |
616 KB |
Execution failed because the return code was nonzero |
9 |
Runtime error |
2 ms |
620 KB |
Execution failed because the return code was nonzero |
10 |
Runtime error |
2 ms |
620 KB |
Execution failed because the return code was nonzero |
11 |
Runtime error |
2 ms |
620 KB |
Execution failed because the return code was nonzero |
12 |
Runtime error |
2 ms |
624 KB |
Execution failed because the return code was nonzero |
13 |
Runtime error |
3 ms |
624 KB |
Execution failed because the return code was nonzero |
14 |
Runtime error |
2 ms |
624 KB |
Execution failed because the return code was nonzero |
15 |
Runtime error |
2 ms |
624 KB |
Execution failed because the return code was nonzero |
16 |
Runtime error |
8 ms |
748 KB |
Execution failed because the return code was nonzero |
17 |
Runtime error |
13 ms |
804 KB |
Execution failed because the return code was nonzero |
18 |
Runtime error |
8 ms |
804 KB |
Execution failed because the return code was nonzero |
19 |
Runtime error |
9 ms |
804 KB |
Execution failed because the return code was nonzero |
20 |
Runtime error |
5 ms |
804 KB |
Execution failed because the return code was nonzero |
21 |
Runtime error |
30 ms |
1516 KB |
Execution failed because the return code was nonzero |
22 |
Runtime error |
30 ms |
1516 KB |
Execution failed because the return code was nonzero |
23 |
Runtime error |
29 ms |
1516 KB |
Execution failed because the return code was nonzero |
24 |
Runtime error |
30 ms |
1516 KB |
Execution failed because the return code was nonzero |
25 |
Runtime error |
22 ms |
1516 KB |
Execution failed because the return code was nonzero |
26 |
Runtime error |
32 ms |
1516 KB |
Execution failed because the return code was nonzero |
27 |
Runtime error |
31 ms |
1516 KB |
Execution failed because the return code was nonzero |
28 |
Runtime error |
33 ms |
1516 KB |
Execution failed because the return code was nonzero |
29 |
Runtime error |
32 ms |
1516 KB |
Execution failed because the return code was nonzero |
30 |
Runtime error |
16 ms |
1516 KB |
Execution failed because the return code was nonzero |
31 |
Runtime error |
2 ms |
1516 KB |
Execution failed because the return code was nonzero |
32 |
Runtime error |
1 ms |
1516 KB |
Execution failed because the return code was nonzero |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
1 ms |
1516 KB |
Execution failed because the return code was nonzero |
2 |
Runtime error |
2 ms |
1516 KB |
Execution failed because the return code was nonzero |
3 |
Runtime error |
2 ms |
1516 KB |
Execution failed because the return code was nonzero |
4 |
Runtime error |
2 ms |
1516 KB |
Execution failed because the return code was nonzero |
5 |
Runtime error |
2 ms |
1516 KB |
Execution failed because the return code was nonzero |
6 |
Runtime error |
1 ms |
1516 KB |
Execution failed because the return code was nonzero |
7 |
Runtime error |
2 ms |
1516 KB |
Execution failed because the return code was nonzero |
8 |
Runtime error |
2 ms |
1516 KB |
Execution failed because the return code was nonzero |
9 |
Runtime error |
1 ms |
1516 KB |
Execution failed because the return code was nonzero |
10 |
Runtime error |
2 ms |
1516 KB |
Execution failed because the return code was nonzero |
11 |
Runtime error |
2 ms |
1516 KB |
Execution failed because the return code was nonzero |
12 |
Runtime error |
2 ms |
1516 KB |
Execution failed because the return code was nonzero |
13 |
Runtime error |
2 ms |
1516 KB |
Execution failed because the return code was nonzero |
14 |
Runtime error |
2 ms |
1516 KB |
Execution failed because the return code was nonzero |
15 |
Runtime error |
2 ms |
1516 KB |
Execution failed because the return code was nonzero |
16 |
Runtime error |
9 ms |
1516 KB |
Execution failed because the return code was nonzero |
17 |
Runtime error |
9 ms |
1516 KB |
Execution failed because the return code was nonzero |
18 |
Runtime error |
9 ms |
1516 KB |
Execution failed because the return code was nonzero |
19 |
Runtime error |
8 ms |
1516 KB |
Execution failed because the return code was nonzero |
20 |
Runtime error |
5 ms |
1516 KB |
Execution failed because the return code was nonzero |
21 |
Runtime error |
29 ms |
1516 KB |
Execution failed because the return code was nonzero |
22 |
Runtime error |
30 ms |
1516 KB |
Execution failed because the return code was nonzero |
23 |
Runtime error |
29 ms |
1516 KB |
Execution failed because the return code was nonzero |
24 |
Runtime error |
30 ms |
1516 KB |
Execution failed because the return code was nonzero |
25 |
Runtime error |
21 ms |
1516 KB |
Execution failed because the return code was nonzero |
26 |
Runtime error |
30 ms |
1516 KB |
Execution failed because the return code was nonzero |
27 |
Runtime error |
33 ms |
1516 KB |
Execution failed because the return code was nonzero |
28 |
Runtime error |
30 ms |
1516 KB |
Execution failed because the return code was nonzero |
29 |
Runtime error |
30 ms |
1516 KB |
Execution failed because the return code was nonzero |
30 |
Runtime error |
16 ms |
1516 KB |
Execution failed because the return code was nonzero |
31 |
Runtime error |
2 ms |
1516 KB |
Execution failed because the return code was nonzero |
32 |
Runtime error |
2 ms |
1516 KB |
Execution failed because the return code was nonzero |