Submission #1092485

# Submission time Handle Problem Language Result Execution time Memory
1092485 2024-09-24T08:13:17 Z alexander707070 Gap (APIO16_gap) C++14
34.6316 / 100
37 ms 7376 KB
#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,ll,rr);
			if((*ll)!=-1)break;
			d*=2;
		}

		ans=max(ans,*ll-*l);
		d=ans;

		l=rr;
	}

	return ans;
}
# Verdict Execution time Memory 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 Incorrect 0 ms 344 KB Output isn't correct
11 Correct 0 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 0 ms 344 KB Output is correct
15 Incorrect 1 ms 344 KB Output isn't correct
16 Correct 4 ms 796 KB Output is correct
17 Correct 7 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 5 ms 1112 KB Output is correct
21 Correct 17 ms 1820 KB Output is correct
22 Correct 17 ms 1852 KB Output is correct
23 Correct 17 ms 1624 KB Output is correct
24 Correct 17 ms 1872 KB Output is correct
25 Incorrect 36 ms 7312 KB Output isn't correct
26 Correct 17 ms 1624 KB Output is correct
27 Correct 16 ms 1624 KB Output is correct
28 Correct 28 ms 1880 KB Output is correct
29 Correct 17 ms 1880 KB Output is correct
30 Correct 17 ms 3160 KB Output is correct
31 Incorrect 0 ms 344 KB Output isn't correct
32 Incorrect 0 ms 344 KB Output isn't 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 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 0 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 1 ms 344 KB Output is correct
13 Correct 0 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 856 KB Output is correct
17 Correct 5 ms 600 KB Output is correct
18 Correct 5 ms 696 KB Output is correct
19 Correct 5 ms 600 KB Output is correct
20 Correct 4 ms 1132 KB Output is correct
21 Correct 23 ms 1664 KB Output is correct
22 Correct 28 ms 1856 KB Output is correct
23 Correct 17 ms 1880 KB Output is correct
24 Correct 28 ms 1624 KB Output is correct
25 Partially correct 37 ms 7376 KB Partially correct
26 Correct 17 ms 1880 KB Output is correct
27 Correct 17 ms 1880 KB Output is correct
28 Correct 17 ms 1880 KB Output is correct
29 Correct 17 ms 1624 KB Output is correct
30 Correct 18 ms 3156 KB Output is correct
31 Partially correct 0 ms 344 KB Partially correct
32 Correct 0 ms 344 KB Output is correct