#include "gap.h"
#include<bits/stdc++.h>
#define ll long long
#define pb push_back
#define mp make_pair
#define fi first
#define se second
using namespace std;
ll ma,u1,u2,ce,L1,R1,L2,R2;
queue<pair<ll,ll> > q;
long long findGap(int T, int N)
{
ma=0;
q.push(mp(0,1e18));
while(!q.empty())
{
u1=q.front().fi;
u2=q.front().se;
q.pop();
ce=(u1+u2)/2;
MinMax(u1,ce,&L1,&R1);
MinMax(ce+1,u2,&L2,&R2);
ma=max(ma,L2-R1);
if(R1-L1>ma)
q.push(mp(L1,R1));
if(R2-L2>ma)
q.push(mp(L2,R2));
}
return ma;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
2 ms |
504 KB |
Output isn't correct |
2 |
Incorrect |
2 ms |
532 KB |
Output isn't correct |
3 |
Correct |
2 ms |
772 KB |
Output is correct |
4 |
Incorrect |
2 ms |
772 KB |
Output isn't correct |
5 |
Incorrect |
2 ms |
820 KB |
Output isn't correct |
6 |
Correct |
2 ms |
820 KB |
Output is correct |
7 |
Correct |
2 ms |
828 KB |
Output is correct |
8 |
Correct |
2 ms |
944 KB |
Output is correct |
9 |
Incorrect |
2 ms |
944 KB |
Output isn't correct |
10 |
Correct |
2 ms |
944 KB |
Output is correct |
11 |
Correct |
3 ms |
944 KB |
Output is correct |
12 |
Correct |
3 ms |
944 KB |
Output is correct |
13 |
Correct |
3 ms |
968 KB |
Output is correct |
14 |
Correct |
3 ms |
1012 KB |
Output is correct |
15 |
Incorrect |
3 ms |
1108 KB |
Output isn't correct |
16 |
Correct |
14 ms |
1640 KB |
Output is correct |
17 |
Correct |
12 ms |
2176 KB |
Output is correct |
18 |
Correct |
14 ms |
2644 KB |
Output is correct |
19 |
Correct |
13 ms |
3176 KB |
Output is correct |
20 |
Correct |
5 ms |
3204 KB |
Output is correct |
21 |
Correct |
48 ms |
5792 KB |
Output is correct |
22 |
Correct |
46 ms |
7712 KB |
Output is correct |
23 |
Correct |
47 ms |
9480 KB |
Output is correct |
24 |
Correct |
44 ms |
11444 KB |
Output is correct |
25 |
Incorrect |
102 ms |
12936 KB |
Output isn't correct |
26 |
Correct |
43 ms |
14400 KB |
Output is correct |
27 |
Correct |
45 ms |
16244 KB |
Output is correct |
28 |
Correct |
48 ms |
18088 KB |
Output is correct |
29 |
Correct |
43 ms |
19952 KB |
Output is correct |
30 |
Correct |
16 ms |
20512 KB |
Output is correct |
31 |
Correct |
2 ms |
20512 KB |
Output is correct |
32 |
Correct |
2 ms |
20512 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
2 ms |
20512 KB |
Output is correct |
2 |
Partially correct |
2 ms |
20512 KB |
Partially correct |
3 |
Correct |
2 ms |
20512 KB |
Output is correct |
4 |
Correct |
2 ms |
20512 KB |
Output is correct |
5 |
Partially correct |
2 ms |
20512 KB |
Partially correct |
6 |
Partially correct |
2 ms |
20512 KB |
Partially correct |
7 |
Partially correct |
2 ms |
20512 KB |
Partially correct |
8 |
Partially correct |
2 ms |
20512 KB |
Partially correct |
9 |
Partially correct |
2 ms |
20512 KB |
Partially correct |
10 |
Partially correct |
2 ms |
20512 KB |
Partially correct |
11 |
Partially correct |
3 ms |
20512 KB |
Partially correct |
12 |
Partially correct |
2 ms |
20512 KB |
Partially correct |
13 |
Partially correct |
3 ms |
20512 KB |
Partially correct |
14 |
Partially correct |
2 ms |
20512 KB |
Partially correct |
15 |
Partially correct |
3 ms |
20512 KB |
Partially correct |
16 |
Partially correct |
14 ms |
20612 KB |
Partially correct |
17 |
Partially correct |
15 ms |
21076 KB |
Partially correct |
18 |
Partially correct |
16 ms |
21488 KB |
Partially correct |
19 |
Partially correct |
13 ms |
22024 KB |
Partially correct |
20 |
Partially correct |
5 ms |
22084 KB |
Partially correct |
21 |
Partially correct |
42 ms |
24672 KB |
Partially correct |
22 |
Partially correct |
46 ms |
26752 KB |
Partially correct |
23 |
Partially correct |
47 ms |
28376 KB |
Partially correct |
24 |
Partially correct |
45 ms |
30220 KB |
Partially correct |
25 |
Partially correct |
106 ms |
31844 KB |
Partially correct |
26 |
Partially correct |
51 ms |
33280 KB |
Partially correct |
27 |
Partially correct |
44 ms |
35124 KB |
Partially correct |
28 |
Partially correct |
48 ms |
36952 KB |
Partially correct |
29 |
Partially correct |
46 ms |
38800 KB |
Partially correct |
30 |
Partially correct |
17 ms |
39476 KB |
Partially correct |
31 |
Correct |
2 ms |
39476 KB |
Output is correct |
32 |
Correct |
2 ms |
39476 KB |
Output is correct |