Submission #61080

# Submission time Handle Problem Language Result Execution time Memory
61080 2018-07-25T07:45:02 Z Flugan42 Gap (APIO16_gap) C++14
30 / 100
79 ms 2240 KB
#include "gap.h"
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<ll> vi;
typedef pair<ll,ll> ii;
typedef vector<ii> vii;
typedef long double lld;
#define rep(i,a,b) for(ll i = a; i < b; i++)
#define per(i,a,b) for(ll i = a; i >= b; i--)
#define inf 1000000000000000000
#define all(x) x.begin(),x.end()
#define sz(x) (ll)(x).size()
#define trav(a,x) for(auto a : x)

long long findGap(int T, int N)
{
	if (T == 1){
		vi a; a.assign(N,0);
		MinMax(0,inf,&a[0],&a[N-1]);
		ll f=1,l=N-2;
		while (f<=l){
			MinMax(a[f-1]+1,a[l+1]-1,&a[f],&a[l]);
			f++; l--;
		}
		ll best = 0;
		rep(i,1,N) if (a[i]-a[i-1] > best) best = a[i]-a[i-1];
		return best;
	} else {
		return 0;
	}
}
# Verdict Execution time Memory Grader output
1 Correct 2 ms 376 KB Output is correct
2 Correct 3 ms 376 KB Output is correct
3 Correct 3 ms 412 KB Output is correct
4 Correct 2 ms 412 KB Output is correct
5 Correct 3 ms 412 KB Output is correct
6 Correct 3 ms 588 KB Output is correct
7 Correct 2 ms 588 KB Output is correct
8 Correct 2 ms 592 KB Output is correct
9 Correct 2 ms 592 KB Output is correct
10 Correct 2 ms 596 KB Output is correct
11 Correct 4 ms 596 KB Output is correct
12 Correct 4 ms 596 KB Output is correct
13 Correct 4 ms 596 KB Output is correct
14 Correct 4 ms 596 KB Output is correct
15 Correct 4 ms 596 KB Output is correct
16 Correct 17 ms 976 KB Output is correct
17 Correct 24 ms 976 KB Output is correct
18 Correct 20 ms 980 KB Output is correct
19 Correct 17 ms 1004 KB Output is correct
20 Correct 12 ms 1004 KB Output is correct
21 Correct 67 ms 2156 KB Output is correct
22 Correct 63 ms 2156 KB Output is correct
23 Correct 71 ms 2160 KB Output is correct
24 Correct 65 ms 2160 KB Output is correct
25 Correct 53 ms 2160 KB Output is correct
26 Correct 62 ms 2160 KB Output is correct
27 Correct 71 ms 2240 KB Output is correct
28 Correct 79 ms 2240 KB Output is correct
29 Correct 70 ms 2240 KB Output is correct
30 Correct 67 ms 2240 KB Output is correct
31 Correct 2 ms 2240 KB Output is correct
32 Correct 3 ms 2240 KB Output is correct
# Verdict Execution time Memory Grader output
1 Incorrect 3 ms 2240 KB Output isn't correct
2 Incorrect 2 ms 2240 KB Output isn't correct
3 Incorrect 3 ms 2240 KB Output isn't correct
4 Incorrect 2 ms 2240 KB Output isn't correct
5 Incorrect 2 ms 2240 KB Output isn't correct
6 Incorrect 3 ms 2240 KB Output isn't correct
7 Incorrect 3 ms 2240 KB Output isn't correct
8 Incorrect 3 ms 2240 KB Output isn't correct
9 Incorrect 2 ms 2240 KB Output isn't correct
10 Incorrect 3 ms 2240 KB Output isn't correct
11 Incorrect 3 ms 2240 KB Output isn't correct
12 Incorrect 4 ms 2240 KB Output isn't correct
13 Incorrect 3 ms 2240 KB Output isn't correct
14 Incorrect 3 ms 2240 KB Output isn't correct
15 Incorrect 3 ms 2240 KB Output isn't correct
16 Incorrect 12 ms 2240 KB Output isn't correct
17 Incorrect 13 ms 2240 KB Output isn't correct
18 Incorrect 9 ms 2240 KB Output isn't correct
19 Incorrect 11 ms 2240 KB Output isn't correct
20 Incorrect 5 ms 2240 KB Output isn't correct
21 Incorrect 36 ms 2240 KB Output isn't correct
22 Incorrect 38 ms 2240 KB Output isn't correct
23 Incorrect 34 ms 2240 KB Output isn't correct
24 Incorrect 44 ms 2240 KB Output isn't correct
25 Incorrect 24 ms 2240 KB Output isn't correct
26 Incorrect 49 ms 2240 KB Output isn't correct
27 Incorrect 34 ms 2240 KB Output isn't correct
28 Incorrect 49 ms 2240 KB Output isn't correct
29 Incorrect 33 ms 2240 KB Output isn't correct
30 Incorrect 22 ms 2240 KB Output isn't correct
31 Incorrect 3 ms 2240 KB Output isn't correct
32 Incorrect 2 ms 2240 KB Output isn't correct