Submission #405708

# Submission time Handle Problem Language Result Execution time Memory
405708 2021-05-16T19:48:37 Z inluminas Gap (APIO16_gap) C++14
70 / 100
71 ms 2328 KB
#include "gap.h"
#include<bits/stdc++.h>

using namespace std;
#define ll long long
#define endl "\n"

vector<ll>a;

long long findGap(int T, int N)
{
	ll mn,mx;
	MinMax(0,1e18,&mn,&mx);
	ll len=(mx-mn-1)/(N-1);
	a.push_back(mn);
	for(int i=1;i<=N-1;i++){
		if(mn+1==mx-1){
			a.push_back(mn+1);
			break;
		}
		if(mn+1>mx-1) break;
		ll coto,boro;
		MinMax(mn+1,min(mx-1,mn+len+1),&coto,&boro);
		mn=mn+1+len;
		if(coto==-1){
			continue;
		}
		a.push_back(coto);
		if(coto!=boro) a.push_back(boro);
	}
	a.push_back(mx);
	ll ans=0;
	for(int i=1;i<a.size();i++){
		ans=max(ans,a[i]-a[i-1]);
	}
	return ans;
}

Compilation message

gap.cpp: In function 'long long int findGap(int, int)':
gap.cpp:33:15: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<long long int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   33 |  for(int i=1;i<a.size();i++){
      |              ~^~~~~~~~~
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 200 KB Output isn't correct
2 Incorrect 1 ms 200 KB Output isn't correct
3 Incorrect 1 ms 200 KB Output isn't correct
4 Incorrect 1 ms 200 KB Output isn't correct
5 Incorrect 1 ms 200 KB Output isn't correct
6 Incorrect 1 ms 200 KB Output isn't correct
7 Incorrect 1 ms 200 KB Output isn't correct
8 Incorrect 1 ms 200 KB Output isn't correct
9 Incorrect 1 ms 200 KB Output isn't correct
10 Incorrect 1 ms 200 KB Output isn't correct
11 Incorrect 2 ms 328 KB Output isn't correct
12 Incorrect 2 ms 328 KB Output isn't correct
13 Incorrect 2 ms 328 KB Output isn't correct
14 Incorrect 2 ms 328 KB Output isn't correct
15 Incorrect 2 ms 328 KB Output isn't correct
16 Incorrect 15 ms 900 KB Output isn't correct
17 Incorrect 15 ms 824 KB Output isn't correct
18 Incorrect 15 ms 840 KB Output isn't correct
19 Incorrect 15 ms 916 KB Output isn't correct
20 Incorrect 8 ms 524 KB Output isn't correct
21 Incorrect 62 ms 2116 KB Output isn't correct
22 Incorrect 60 ms 2128 KB Output isn't correct
23 Incorrect 63 ms 2260 KB Output isn't correct
24 Incorrect 63 ms 2184 KB Output isn't correct
25 Incorrect 68 ms 2196 KB Output isn't correct
26 Incorrect 63 ms 2228 KB Output isn't correct
27 Incorrect 62 ms 2188 KB Output isn't correct
28 Incorrect 65 ms 2192 KB Output isn't correct
29 Incorrect 62 ms 2232 KB Output isn't correct
30 Incorrect 32 ms 1472 KB Output isn't correct
31 Incorrect 1 ms 200 KB Output isn't correct
32 Incorrect 1 ms 200 KB Output isn't correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 200 KB Output is correct
2 Correct 1 ms 200 KB Output is correct
3 Correct 1 ms 200 KB Output is correct
4 Correct 1 ms 200 KB Output is correct
5 Correct 1 ms 200 KB Output is correct
6 Correct 1 ms 200 KB Output is correct
7 Correct 1 ms 200 KB Output is correct
8 Correct 1 ms 200 KB Output is correct
9 Correct 1 ms 200 KB Output is correct
10 Correct 1 ms 200 KB Output is correct
11 Correct 2 ms 328 KB Output is correct
12 Correct 2 ms 304 KB Output is correct
13 Correct 1 ms 328 KB Output is correct
14 Correct 2 ms 328 KB Output is correct
15 Correct 1 ms 328 KB Output is correct
16 Correct 16 ms 856 KB Output is correct
17 Correct 17 ms 832 KB Output is correct
18 Correct 19 ms 832 KB Output is correct
19 Correct 17 ms 840 KB Output is correct
20 Correct 8 ms 440 KB Output is correct
21 Correct 64 ms 2232 KB Output is correct
22 Correct 60 ms 2200 KB Output is correct
23 Correct 62 ms 2200 KB Output is correct
24 Correct 71 ms 2200 KB Output is correct
25 Correct 57 ms 2212 KB Output is correct
26 Correct 64 ms 2276 KB Output is correct
27 Correct 59 ms 2188 KB Output is correct
28 Correct 66 ms 2328 KB Output is correct
29 Correct 69 ms 2200 KB Output is correct
30 Correct 33 ms 1452 KB Output is correct
31 Correct 1 ms 200 KB Output is correct
32 Correct 1 ms 200 KB Output is correct