#include<bits/stdc++.h>
#include "gap.h"
#define MAXN 600007
using namespace std;
const long long inf=1e18;
long long *l,*r,*ll,*rr;
long long d,ans;
long long findGap(int T, int N){
l=new long long();
r=new long long();
MinMax(1, inf, l,r);
if(N==2)return *r-*l;
d=ans=1;
while(*l!=*r){
while(true){
ll=new long long();
rr=new long long();
MinMax((*l)+1,(*l)+d+1,ll,rr);
if((*ll)!=-1)break;
d*=2;
}
ans=max(ans,*ll-*l);
d=ans;
l=rr;
}
return ans;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Output is correct |
2 |
Incorrect |
0 ms |
344 KB |
Output isn't correct |
3 |
Incorrect |
0 ms |
344 KB |
Output isn't correct |
4 |
Incorrect |
0 ms |
344 KB |
Output isn't correct |
5 |
Incorrect |
0 ms |
344 KB |
Output isn't correct |
6 |
Incorrect |
0 ms |
344 KB |
Output isn't correct |
7 |
Incorrect |
0 ms |
344 KB |
Output isn't correct |
8 |
Incorrect |
0 ms |
344 KB |
Output isn't correct |
9 |
Incorrect |
0 ms |
344 KB |
Output isn't correct |
10 |
Correct |
0 ms |
352 KB |
Output is correct |
11 |
Correct |
1 ms |
344 KB |
Output is correct |
12 |
Correct |
0 ms |
344 KB |
Output is correct |
13 |
Correct |
1 ms |
344 KB |
Output is correct |
14 |
Correct |
1 ms |
344 KB |
Output is correct |
15 |
Incorrect |
1 ms |
344 KB |
Output isn't correct |
16 |
Correct |
5 ms |
616 KB |
Output is correct |
17 |
Correct |
5 ms |
600 KB |
Output is correct |
18 |
Correct |
5 ms |
600 KB |
Output is correct |
19 |
Correct |
5 ms |
856 KB |
Output is correct |
20 |
Correct |
4 ms |
856 KB |
Output is correct |
21 |
Correct |
17 ms |
1880 KB |
Output is correct |
22 |
Correct |
18 ms |
1880 KB |
Output is correct |
23 |
Correct |
17 ms |
1716 KB |
Output is correct |
24 |
Correct |
25 ms |
1880 KB |
Output is correct |
25 |
Incorrect |
35 ms |
7248 KB |
Output isn't correct |
26 |
Correct |
27 ms |
1616 KB |
Output is correct |
27 |
Correct |
17 ms |
1624 KB |
Output is correct |
28 |
Correct |
19 ms |
1916 KB |
Output is correct |
29 |
Correct |
17 ms |
1876 KB |
Output is correct |
30 |
Correct |
13 ms |
2148 KB |
Output is correct |
31 |
Incorrect |
0 ms |
344 KB |
Output isn't correct |
32 |
Incorrect |
0 ms |
344 KB |
Output isn't correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Output is correct |
2 |
Partially correct |
1 ms |
344 KB |
Partially correct |
3 |
Partially correct |
0 ms |
344 KB |
Partially correct |
4 |
Partially correct |
1 ms |
344 KB |
Partially correct |
5 |
Partially correct |
1 ms |
344 KB |
Partially correct |
6 |
Correct |
0 ms |
344 KB |
Output is correct |
7 |
Correct |
0 ms |
344 KB |
Output is correct |
8 |
Correct |
1 ms |
344 KB |
Output is correct |
9 |
Correct |
1 ms |
344 KB |
Output is correct |
10 |
Correct |
0 ms |
344 KB |
Output is correct |
11 |
Correct |
1 ms |
344 KB |
Output is correct |
12 |
Correct |
0 ms |
344 KB |
Output is correct |
13 |
Correct |
1 ms |
344 KB |
Output is correct |
14 |
Correct |
1 ms |
344 KB |
Output is correct |
15 |
Partially correct |
1 ms |
344 KB |
Partially correct |
16 |
Correct |
5 ms |
692 KB |
Output is correct |
17 |
Correct |
5 ms |
600 KB |
Output is correct |
18 |
Correct |
5 ms |
600 KB |
Output is correct |
19 |
Correct |
5 ms |
600 KB |
Output is correct |
20 |
Correct |
3 ms |
856 KB |
Output is correct |
21 |
Correct |
18 ms |
1624 KB |
Output is correct |
22 |
Correct |
18 ms |
1880 KB |
Output is correct |
23 |
Correct |
29 ms |
1816 KB |
Output is correct |
24 |
Correct |
18 ms |
1624 KB |
Output is correct |
25 |
Partially correct |
46 ms |
7248 KB |
Partially correct |
26 |
Correct |
17 ms |
1880 KB |
Output is correct |
27 |
Correct |
18 ms |
1880 KB |
Output is correct |
28 |
Correct |
19 ms |
1880 KB |
Output is correct |
29 |
Correct |
30 ms |
1616 KB |
Output is correct |
30 |
Correct |
17 ms |
2036 KB |
Output is correct |
31 |
Partially correct |
0 ms |
344 KB |
Partially correct |
32 |
Correct |
0 ms |
344 KB |
Output is correct |