Submission #68455

# Submission time Handle Problem Language Result Execution time Memory
68455 2018-08-17T07:24:54 Z KLPP Gap (APIO16_gap) C++14
70 / 100
112 ms 18036 KB
#include "gap.h"
#include<vector>
using namespace std;
typedef long long lld;
long long maximo(lld a, lld b){
if(a<b)return b;
return a;
}
long long minimo(lld a, lld b){
if(a<b)return a;
return b;
}
long long findGap(int T, int N)
{
	if(T==1){
		
		return 0;
	}
	lld min,max;
	MinMax(0,1000000000000000000,&min,&max);
	lld Maxlength=(max-min-1)/N;
	Maxlength++;
	vector<lld> candidates;
	candidates.push_back(min);
	for(lld i=min+1;i<max;i+=Maxlength){
		lld s=i;
		lld t=minimo(i+Maxlength-1,max);
		lld c1,c2;
		MinMax(s,t,&c1,&c2);
		if(c1!=-1){
			candidates.push_back(c1);
			candidates.push_back(c2);
		}
	}candidates.push_back(max);
	for(int i=0;i<candidates.size()-1;i++){
		Maxlength=maximo(Maxlength,candidates[i+1]-candidates[i]);
	}
	return Maxlength;
}

Compilation message

gap.cpp: In function 'long long int findGap(int, int)':
gap.cpp:35:15: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  for(int i=0;i<candidates.size()-1;i++){
              ~^~~~~~~~~~~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 376 KB Output isn't correct
2 Incorrect 2 ms 376 KB Output isn't correct
3 Incorrect 2 ms 376 KB Output isn't correct
4 Incorrect 2 ms 572 KB Output isn't correct
5 Incorrect 2 ms 572 KB Output isn't correct
6 Incorrect 2 ms 572 KB Output isn't correct
7 Incorrect 2 ms 572 KB Output isn't correct
8 Incorrect 2 ms 572 KB Output isn't correct
9 Incorrect 2 ms 572 KB Output isn't correct
10 Incorrect 2 ms 572 KB Output isn't correct
11 Incorrect 3 ms 580 KB Output isn't correct
12 Incorrect 4 ms 684 KB Output isn't correct
13 Incorrect 3 ms 712 KB Output isn't correct
14 Incorrect 3 ms 740 KB Output isn't correct
15 Incorrect 4 ms 784 KB Output isn't correct
16 Incorrect 12 ms 1420 KB Output isn't correct
17 Incorrect 13 ms 1872 KB Output isn't correct
18 Incorrect 11 ms 2368 KB Output isn't correct
19 Incorrect 11 ms 2832 KB Output isn't correct
20 Incorrect 8 ms 2920 KB Output isn't correct
21 Incorrect 34 ms 5516 KB Output isn't correct
22 Incorrect 31 ms 7240 KB Output isn't correct
23 Incorrect 35 ms 9152 KB Output isn't correct
24 Incorrect 44 ms 10940 KB Output isn't correct
25 Incorrect 32 ms 12268 KB Output isn't correct
26 Incorrect 49 ms 14000 KB Output isn't correct
27 Incorrect 37 ms 15912 KB Output isn't correct
28 Incorrect 49 ms 15912 KB Output isn't correct
29 Incorrect 32 ms 15912 KB Output isn't correct
30 Incorrect 30 ms 15912 KB Output isn't correct
31 Incorrect 2 ms 15912 KB Output isn't correct
32 Incorrect 2 ms 15912 KB Output isn't correct
# Verdict Execution time Memory Grader output
1 Correct 2 ms 15912 KB Output is correct
2 Correct 2 ms 15912 KB Output is correct
3 Correct 2 ms 15912 KB Output is correct
4 Correct 2 ms 15912 KB Output is correct
5 Correct 2 ms 15912 KB Output is correct
6 Correct 2 ms 15912 KB Output is correct
7 Correct 2 ms 15912 KB Output is correct
8 Correct 2 ms 15912 KB Output is correct
9 Correct 2 ms 15912 KB Output is correct
10 Correct 2 ms 15912 KB Output is correct
11 Correct 3 ms 15912 KB Output is correct
12 Correct 3 ms 15912 KB Output is correct
13 Correct 4 ms 15912 KB Output is correct
14 Correct 4 ms 15912 KB Output is correct
15 Correct 3 ms 15912 KB Output is correct
16 Correct 29 ms 15912 KB Output is correct
17 Correct 25 ms 15912 KB Output is correct
18 Correct 29 ms 15912 KB Output is correct
19 Correct 22 ms 15912 KB Output is correct
20 Correct 10 ms 15912 KB Output is correct
21 Correct 83 ms 17020 KB Output is correct
22 Correct 82 ms 17020 KB Output is correct
23 Correct 89 ms 17020 KB Output is correct
24 Correct 97 ms 17020 KB Output is correct
25 Correct 79 ms 18036 KB Output is correct
26 Correct 88 ms 18036 KB Output is correct
27 Correct 91 ms 18036 KB Output is correct
28 Correct 91 ms 18036 KB Output is correct
29 Correct 112 ms 18036 KB Output is correct
30 Correct 46 ms 18036 KB Output is correct
31 Correct 3 ms 18036 KB Output is correct
32 Correct 3 ms 18036 KB Output is correct