Submission #45031

# Submission time Handle Problem Language Result Execution time Memory
45031 2018-04-11T04:26:00 Z Mamnoon_Siam Gap (APIO16_gap) C++17
0 / 100
92 ms 2676 KB
#include <bits/stdc++.h>
using namespace std;

int n, type;

typedef long long ll;

void MinMax(ll, ll, ll*, ll*);

int solve_naive() {
	ll l = 0, r = 1000000000000000000LL;
	vector<ll> v;
	int lim = (n + 1) / 2;
	for(int i=1; i<=lim; i++) {
		ll x, y;
		MinMax(l, r, &x, &y);
		assert(x != -1);
		assert(y != -1);
		v.push_back(x);
		if(x != y) v.push_back(y);
		l = x + 1;
		r = y - 1;
	}
	sort(v.begin(), v.end());
	ll ret = 0;
	for(int i=1; i<v.size(); i++) {
		ret = max(ret, v[i] - v[i-1]);
	} return ret;
}

int solve_proway() {
	return 0;
}

long long findGap(int32_t T, int32_t N)
{
	n = N;
	if(T == 1) return solve_naive();
	else return solve_proway();
	return 0;
}

Compilation message

gap.cpp: In function 'int solve_naive()':
gap.cpp:26:16: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  for(int i=1; i<v.size(); i++) {
               ~^~~~~~~~~
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 248 KB Output isn't correct
2 Incorrect 2 ms 356 KB Output isn't correct
3 Incorrect 4 ms 436 KB Output isn't correct
4 Incorrect 2 ms 488 KB Output isn't correct
5 Correct 2 ms 488 KB Output is correct
6 Incorrect 2 ms 492 KB Output isn't correct
7 Incorrect 2 ms 492 KB Output isn't correct
8 Incorrect 2 ms 500 KB Output isn't correct
9 Incorrect 2 ms 572 KB Output isn't correct
10 Correct 2 ms 572 KB Output is correct
11 Incorrect 3 ms 620 KB Output isn't correct
12 Incorrect 3 ms 620 KB Output isn't correct
13 Incorrect 3 ms 748 KB Output isn't correct
14 Incorrect 4 ms 748 KB Output isn't correct
15 Correct 3 ms 748 KB Output is correct
16 Incorrect 16 ms 1220 KB Output isn't correct
17 Incorrect 17 ms 1220 KB Output isn't correct
18 Incorrect 16 ms 1220 KB Output isn't correct
19 Incorrect 24 ms 1220 KB Output isn't correct
20 Correct 13 ms 1220 KB Output is correct
21 Incorrect 89 ms 2548 KB Output isn't correct
22 Incorrect 92 ms 2548 KB Output isn't correct
23 Incorrect 76 ms 2560 KB Output isn't correct
24 Incorrect 92 ms 2560 KB Output isn't correct
25 Correct 73 ms 2600 KB Output is correct
26 Incorrect 62 ms 2600 KB Output isn't correct
27 Incorrect 61 ms 2600 KB Output isn't correct
28 Incorrect 64 ms 2600 KB Output isn't correct
29 Incorrect 64 ms 2600 KB Output isn't correct
30 Correct 47 ms 2676 KB Output is correct
31 Incorrect 2 ms 2676 KB Output isn't correct
32 Incorrect 2 ms 2676 KB Output isn't correct
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 2676 KB Output isn't correct
2 Incorrect 2 ms 2676 KB Output isn't correct
3 Incorrect 2 ms 2676 KB Output isn't correct
4 Incorrect 2 ms 2676 KB Output isn't correct
5 Incorrect 2 ms 2676 KB Output isn't correct
6 Incorrect 2 ms 2676 KB Output isn't correct
7 Incorrect 2 ms 2676 KB Output isn't correct
8 Incorrect 2 ms 2676 KB Output isn't correct
9 Incorrect 2 ms 2676 KB Output isn't correct
10 Incorrect 2 ms 2676 KB Output isn't correct
11 Incorrect 2 ms 2676 KB Output isn't correct
12 Incorrect 2 ms 2676 KB Output isn't correct
13 Incorrect 2 ms 2676 KB Output isn't correct
14 Incorrect 2 ms 2676 KB Output isn't correct
15 Incorrect 2 ms 2676 KB Output isn't correct
16 Incorrect 9 ms 2676 KB Output isn't correct
17 Incorrect 9 ms 2676 KB Output isn't correct
18 Incorrect 11 ms 2676 KB Output isn't correct
19 Incorrect 10 ms 2676 KB Output isn't correct
20 Incorrect 5 ms 2676 KB Output isn't correct
21 Incorrect 30 ms 2676 KB Output isn't correct
22 Incorrect 30 ms 2676 KB Output isn't correct
23 Incorrect 35 ms 2676 KB Output isn't correct
24 Incorrect 32 ms 2676 KB Output isn't correct
25 Incorrect 23 ms 2676 KB Output isn't correct
26 Incorrect 30 ms 2676 KB Output isn't correct
27 Incorrect 31 ms 2676 KB Output isn't correct
28 Incorrect 31 ms 2676 KB Output isn't correct
29 Incorrect 30 ms 2676 KB Output isn't correct
30 Incorrect 16 ms 2676 KB Output isn't correct
31 Incorrect 2 ms 2676 KB Output isn't correct
32 Incorrect 2 ms 2676 KB Output isn't correct