#include<bits/stdc++.h>
#include "gap.h"
#define MAXN 600007
using namespace std;
struct interval{
long long from,to;
inline friend bool operator < (interval fr,interval sc){
return fr.to-fr.from<sc.to-sc.from;
}
};
priority_queue<interval> q;
interval check(long long l,long long r){
if(l+1==r)return {-1,-1};
long long *ll,*rr;
ll=new long long();
rr=new long long();
MinMax(l+1,r-1, ll,rr);
return {*ll,*rr};
}
const long long inf=1e18;
long long *l,*r;
long long findGap(int T, int N){
l=new long long();
r=new long long();
MinMax(1, inf, l,r);
q.push({l[0],r[0]});
while(true){
interval s=check(q.top().from,q.top().to);
if(s.from==-1)return q.top().to-q.top().from;
interval z=q.top();
q.pop();
q.push({z.from,s.from});
if(s.from!=s.to)q.push(s);
q.push({s.to,z.to});
}
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
344 KB |
Output isn't correct |
2 |
Correct |
0 ms |
344 KB |
Output is correct |
3 |
Incorrect |
1 ms |
344 KB |
Output isn't correct |
4 |
Correct |
0 ms |
344 KB |
Output is correct |
5 |
Incorrect |
0 ms |
344 KB |
Output isn't correct |
6 |
Correct |
0 ms |
344 KB |
Output is correct |
7 |
Correct |
0 ms |
344 KB |
Output is correct |
8 |
Correct |
0 ms |
344 KB |
Output is correct |
9 |
Incorrect |
1 ms |
344 KB |
Output isn't correct |
10 |
Correct |
0 ms |
344 KB |
Output is correct |
11 |
Correct |
1 ms |
344 KB |
Output is correct |
12 |
Correct |
1 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 |
9 ms |
1744 KB |
Output is correct |
17 |
Correct |
10 ms |
1744 KB |
Output is correct |
18 |
Correct |
13 ms |
1744 KB |
Output is correct |
19 |
Correct |
9 ms |
1744 KB |
Output is correct |
20 |
Correct |
7 ms |
1492 KB |
Output is correct |
21 |
Correct |
36 ms |
5824 KB |
Output is correct |
22 |
Correct |
37 ms |
5792 KB |
Output is correct |
23 |
Correct |
37 ms |
5824 KB |
Output is correct |
24 |
Correct |
35 ms |
5824 KB |
Output is correct |
25 |
Incorrect |
31 ms |
5824 KB |
Output isn't correct |
26 |
Correct |
40 ms |
5824 KB |
Output is correct |
27 |
Correct |
36 ms |
5824 KB |
Output is correct |
28 |
Correct |
37 ms |
5824 KB |
Output is correct |
29 |
Correct |
42 ms |
5832 KB |
Output is correct |
30 |
Correct |
26 ms |
5144 KB |
Output is correct |
31 |
Correct |
0 ms |
344 KB |
Output is correct |
32 |
Correct |
0 ms |
344 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Output is correct |
2 |
Partially correct |
0 ms |
344 KB |
Partially correct |
3 |
Partially correct |
0 ms |
344 KB |
Partially correct |
4 |
Partially correct |
0 ms |
344 KB |
Partially correct |
5 |
Partially correct |
0 ms |
344 KB |
Partially correct |
6 |
Partially correct |
0 ms |
344 KB |
Partially correct |
7 |
Partially correct |
0 ms |
344 KB |
Partially correct |
8 |
Partially correct |
0 ms |
344 KB |
Partially correct |
9 |
Partially correct |
0 ms |
344 KB |
Partially correct |
10 |
Partially correct |
0 ms |
344 KB |
Partially correct |
11 |
Partially correct |
1 ms |
344 KB |
Partially correct |
12 |
Partially correct |
1 ms |
344 KB |
Partially correct |
13 |
Partially correct |
1 ms |
344 KB |
Partially correct |
14 |
Partially correct |
1 ms |
344 KB |
Partially correct |
15 |
Partially correct |
1 ms |
344 KB |
Partially correct |
16 |
Partially correct |
9 ms |
1612 KB |
Partially correct |
17 |
Partially correct |
9 ms |
1744 KB |
Partially correct |
18 |
Partially correct |
10 ms |
1744 KB |
Partially correct |
19 |
Partially correct |
9 ms |
1744 KB |
Partially correct |
20 |
Partially correct |
6 ms |
1492 KB |
Partially correct |
21 |
Incorrect |
36 ms |
5860 KB |
Expected int32, but "2500099921" found |
22 |
Incorrect |
35 ms |
5828 KB |
Expected int32, but "2500099921" found |
23 |
Incorrect |
40 ms |
5688 KB |
Expected int32, but "2500099953" found |
24 |
Incorrect |
35 ms |
5824 KB |
Expected int32, but "2500099921" found |
25 |
Incorrect |
30 ms |
5824 KB |
Expected int32, but "2500100001" found |
26 |
Incorrect |
35 ms |
5824 KB |
Expected int32, but "2500099902" found |
27 |
Incorrect |
35 ms |
5824 KB |
Expected int32, but "2500099953" found |
28 |
Incorrect |
36 ms |
5824 KB |
Expected int32, but "2500099921" found |
29 |
Incorrect |
37 ms |
5776 KB |
Expected int32, but "2500099902" found |
30 |
Incorrect |
27 ms |
5324 KB |
Expected int32, but "2449091838" found |
31 |
Correct |
0 ms |
344 KB |
Output is correct |
32 |
Correct |
0 ms |
344 KB |
Output is correct |