#include "gap.h"
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll,ll> ii;
const ll MINV = 0;
const ll MAXV = (ll)1e18;
ll NN,TT,maior;
ll findGap(int T,int N){
TT = T;
NN = N;
ll ini,fim;
MinMax(MINV,MAXV,&ini,&fim);
ll gap = (ll)ceil(double(fim - ini)/double(NN - 1));
vector<ll> diferencas;
for(ll i = 0;i<N;i++){
ll lo = ini + i*gap;
ll hi = min(lo+gap,fim);
if(i != 0) lo++;
ll copia1,copia2;
MinMax(lo,hi,&copia1,&copia2);
maior = max(copia2 - copia1,maior);
}
return maior;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
9 ms |
248 KB |
Execution failed because the return code was nonzero |
2 |
Incorrect |
1 ms |
352 KB |
Output isn't correct |
3 |
Incorrect |
2 ms |
400 KB |
Output isn't correct |
4 |
Incorrect |
2 ms |
476 KB |
Output isn't correct |
5 |
Runtime error |
2 ms |
528 KB |
Execution failed because the return code was nonzero |
6 |
Runtime error |
2 ms |
532 KB |
Execution failed because the return code was nonzero |
7 |
Runtime error |
2 ms |
604 KB |
Execution failed because the return code was nonzero |
8 |
Incorrect |
2 ms |
604 KB |
Output isn't correct |
9 |
Incorrect |
2 ms |
604 KB |
Output isn't correct |
10 |
Runtime error |
2 ms |
604 KB |
Execution failed because the return code was nonzero |
11 |
Runtime error |
3 ms |
620 KB |
Execution failed because the return code was nonzero |
12 |
Runtime error |
2 ms |
728 KB |
Execution failed because the return code was nonzero |
13 |
Runtime error |
3 ms |
728 KB |
Execution failed because the return code was nonzero |
14 |
Runtime error |
2 ms |
728 KB |
Execution failed because the return code was nonzero |
15 |
Runtime error |
2 ms |
728 KB |
Execution failed because the return code was nonzero |
16 |
Runtime error |
20 ms |
748 KB |
Execution failed because the return code was nonzero |
17 |
Runtime error |
22 ms |
748 KB |
Execution failed because the return code was nonzero |
18 |
Runtime error |
31 ms |
876 KB |
Execution failed because the return code was nonzero |
19 |
Runtime error |
20 ms |
876 KB |
Execution failed because the return code was nonzero |
20 |
Runtime error |
10 ms |
876 KB |
Execution failed because the return code was nonzero |
21 |
Runtime error |
75 ms |
1408 KB |
Execution failed because the return code was nonzero |
22 |
Runtime error |
72 ms |
1408 KB |
Execution failed because the return code was nonzero |
23 |
Runtime error |
73 ms |
1408 KB |
Execution failed because the return code was nonzero |
24 |
Runtime error |
78 ms |
1424 KB |
Execution failed because the return code was nonzero |
25 |
Runtime error |
72 ms |
1516 KB |
Execution failed because the return code was nonzero |
26 |
Runtime error |
71 ms |
1516 KB |
Execution failed because the return code was nonzero |
27 |
Runtime error |
78 ms |
1516 KB |
Execution failed because the return code was nonzero |
28 |
Runtime error |
74 ms |
1516 KB |
Execution failed because the return code was nonzero |
29 |
Runtime error |
72 ms |
1516 KB |
Execution failed because the return code was nonzero |
30 |
Runtime error |
43 ms |
1528 KB |
Execution failed because the return code was nonzero |
31 |
Runtime error |
2 ms |
1528 KB |
Execution failed because the return code was nonzero |
32 |
Runtime error |
2 ms |
1528 KB |
Execution failed because the return code was nonzero |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
1 ms |
1528 KB |
Execution failed because the return code was nonzero |
2 |
Runtime error |
2 ms |
1528 KB |
Execution failed because the return code was nonzero |
3 |
Incorrect |
2 ms |
1528 KB |
Output isn't correct |
4 |
Incorrect |
2 ms |
1528 KB |
Output isn't correct |
5 |
Runtime error |
2 ms |
1528 KB |
Execution failed because the return code was nonzero |
6 |
Incorrect |
2 ms |
1528 KB |
Output isn't correct |
7 |
Runtime error |
2 ms |
1528 KB |
Execution failed because the return code was nonzero |
8 |
Incorrect |
2 ms |
1528 KB |
Output isn't correct |
9 |
Runtime error |
2 ms |
1528 KB |
Execution failed because the return code was nonzero |
10 |
Runtime error |
2 ms |
1528 KB |
Execution failed because the return code was nonzero |
11 |
Runtime error |
3 ms |
1528 KB |
Execution failed because the return code was nonzero |
12 |
Runtime error |
2 ms |
1528 KB |
Execution failed because the return code was nonzero |
13 |
Runtime error |
2 ms |
1528 KB |
Execution failed because the return code was nonzero |
14 |
Runtime error |
3 ms |
1528 KB |
Execution failed because the return code was nonzero |
15 |
Runtime error |
2 ms |
1528 KB |
Execution failed because the return code was nonzero |
16 |
Runtime error |
19 ms |
1528 KB |
Execution failed because the return code was nonzero |
17 |
Runtime error |
21 ms |
1528 KB |
Execution failed because the return code was nonzero |
18 |
Runtime error |
19 ms |
1528 KB |
Execution failed because the return code was nonzero |
19 |
Runtime error |
19 ms |
1528 KB |
Execution failed because the return code was nonzero |
20 |
Runtime error |
10 ms |
1528 KB |
Execution failed because the return code was nonzero |
21 |
Runtime error |
78 ms |
1528 KB |
Execution failed because the return code was nonzero |
22 |
Runtime error |
74 ms |
1528 KB |
Execution failed because the return code was nonzero |
23 |
Runtime error |
76 ms |
1528 KB |
Execution failed because the return code was nonzero |
24 |
Runtime error |
72 ms |
1528 KB |
Execution failed because the return code was nonzero |
25 |
Runtime error |
73 ms |
1528 KB |
Execution failed because the return code was nonzero |
26 |
Runtime error |
75 ms |
1612 KB |
Execution failed because the return code was nonzero |
27 |
Runtime error |
80 ms |
1612 KB |
Execution failed because the return code was nonzero |
28 |
Runtime error |
73 ms |
1612 KB |
Execution failed because the return code was nonzero |
29 |
Runtime error |
87 ms |
1612 KB |
Execution failed because the return code was nonzero |
30 |
Runtime error |
40 ms |
1612 KB |
Execution failed because the return code was nonzero |
31 |
Runtime error |
3 ms |
1612 KB |
Execution failed because the return code was nonzero |
32 |
Runtime error |
2 ms |
1612 KB |
Execution failed because the return code was nonzero |