답안 #1092490

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
1092490 2024-09-24T08:21:40 Z alexander707070 Gap (APIO16_gap) C++14
70 / 100
46 ms 7256 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=(long long) (*r-*l)/(N-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 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 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 Incorrect 1 ms 560 KB Output isn't correct
16 Correct 4 ms 600 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 856 KB Output is correct
20 Correct 2 ms 600 KB Output is correct
21 Correct 28 ms 1712 KB Output is correct
22 Correct 19 ms 1856 KB Output is correct
23 Correct 18 ms 1620 KB Output is correct
24 Correct 17 ms 1880 KB Output is correct
25 Incorrect 37 ms 7256 KB Output isn't correct
26 Correct 17 ms 1700 KB Output is correct
27 Correct 25 ms 1616 KB Output is correct
28 Correct 18 ms 1880 KB Output is correct
29 Correct 18 ms 1880 KB Output is correct
30 Correct 10 ms 1368 KB Output is correct
31 Correct 0 ms 344 KB Output is correct
32 Correct 0 ms 344 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 1 ms 344 KB Output is correct
3 Correct 0 ms 344 KB Output is correct
4 Correct 0 ms 344 KB Output is correct
5 Correct 0 ms 344 KB Output is 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 Correct 0 ms 344 KB Output is correct
10 Correct 0 ms 340 KB Output is correct
11 Correct 1 ms 344 KB Output is correct
12 Correct 0 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 Correct 1 ms 344 KB Output is correct
16 Correct 7 ms 860 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 2 ms 572 KB Output is correct
21 Correct 17 ms 1624 KB Output is correct
22 Correct 26 ms 1872 KB Output is correct
23 Correct 17 ms 1624 KB Output is correct
24 Correct 26 ms 1676 KB Output is correct
25 Correct 46 ms 7248 KB Output is correct
26 Correct 18 ms 1880 KB Output is correct
27 Correct 20 ms 1880 KB Output is correct
28 Correct 18 ms 1880 KB Output is correct
29 Correct 17 ms 1624 KB Output is correct
30 Correct 9 ms 1368 KB Output is correct
31 Correct 0 ms 344 KB Output is correct
32 Correct 0 ms 344 KB Output is correct