Submission #106951

# Submission time Handle Problem Language Result Execution time Memory
106951 2019-04-21T10:06:13 Z golub Gap (APIO16_gap) C++14
0 / 100
71 ms 1272 KB
#include "gap.h"
#include<bits/stdc++.h>

using namespace std;

#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define F first
#define S second
#define pb push_back
#define pii pair<long long, long long>
#define len(x) (long long)x.size()

template<typename A, typename B>
bool cmax(A &a, const B &b) {
    if (a < b) {
        a = b;
        return true;
    }
    return false;
}

template<typename A, typename B>
bool cmin(A &a, const B &b) {
    if (a > b) {
        a = b;
        return true;
    }
    return false;
}

int askcount = 0;

pii ask(long long x) {
	askcount++;
	long long mn = 0, mx = 0;
	MinMax(x, x, &mn, &mx);
	return {mn, mx};
}

long long findGap(int T, int N) {
	long long best_dist = 0;
	long long cur_value = 0;
	while (true) {
		if (askcount >= (N + 1) / 2) break;
		pii res = ask(cur_value + best_dist + 1);
		if (res.S == cur_value) cmax(best_dist, res.F - res.S);
		cur_value = res.F;
		if (res.F == -1) return best_dist;
	}
	return best_dist;
}
# Verdict Execution time Memory Grader output
1 Incorrect 3 ms 384 KB Output isn't correct
2 Incorrect 2 ms 384 KB Output isn't correct
3 Incorrect 3 ms 384 KB Output isn't correct
4 Incorrect 2 ms 384 KB Output isn't correct
5 Incorrect 3 ms 384 KB Output isn't correct
6 Incorrect 2 ms 384 KB Output isn't correct
7 Incorrect 2 ms 384 KB Output isn't correct
8 Incorrect 3 ms 512 KB Output isn't correct
9 Incorrect 3 ms 384 KB Output isn't correct
10 Incorrect 2 ms 384 KB Output isn't correct
11 Incorrect 3 ms 384 KB Output isn't correct
12 Incorrect 3 ms 384 KB Output isn't correct
13 Incorrect 3 ms 384 KB Output isn't correct
14 Incorrect 3 ms 384 KB Output isn't correct
15 Incorrect 2 ms 384 KB Output isn't correct
16 Incorrect 10 ms 512 KB Output isn't correct
17 Incorrect 13 ms 512 KB Output isn't correct
18 Incorrect 8 ms 512 KB Output isn't correct
19 Incorrect 11 ms 512 KB Output isn't correct
20 Incorrect 8 ms 640 KB Output isn't correct
21 Incorrect 28 ms 1144 KB Output isn't correct
22 Incorrect 28 ms 1048 KB Output isn't correct
23 Incorrect 28 ms 1144 KB Output isn't correct
24 Incorrect 35 ms 1144 KB Output isn't correct
25 Incorrect 23 ms 1152 KB Output isn't correct
26 Incorrect 27 ms 1156 KB Output isn't correct
27 Incorrect 28 ms 1144 KB Output isn't correct
28 Incorrect 31 ms 1152 KB Output isn't correct
29 Incorrect 30 ms 1144 KB Output isn't correct
30 Incorrect 30 ms 1152 KB Output isn't correct
31 Incorrect 2 ms 384 KB Output isn't correct
32 Incorrect 2 ms 384 KB Output isn't correct
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 256 KB Output isn't correct
2 Incorrect 2 ms 384 KB Output isn't correct
3 Incorrect 2 ms 384 KB Output isn't correct
4 Incorrect 2 ms 384 KB Output isn't correct
5 Incorrect 2 ms 384 KB Output isn't correct
6 Incorrect 2 ms 384 KB Output isn't correct
7 Incorrect 2 ms 384 KB Output isn't correct
8 Incorrect 2 ms 384 KB Output isn't correct
9 Incorrect 2 ms 384 KB Output isn't correct
10 Incorrect 2 ms 384 KB Output isn't correct
11 Incorrect 2 ms 384 KB Output isn't correct
12 Incorrect 3 ms 384 KB Output isn't correct
13 Incorrect 2 ms 384 KB Output isn't correct
14 Incorrect 2 ms 384 KB Output isn't correct
15 Incorrect 3 ms 384 KB Output isn't correct
16 Incorrect 8 ms 512 KB Output isn't correct
17 Incorrect 8 ms 512 KB Output isn't correct
18 Incorrect 9 ms 512 KB Output isn't correct
19 Incorrect 8 ms 512 KB Output isn't correct
20 Incorrect 10 ms 512 KB Output isn't correct
21 Incorrect 31 ms 1272 KB Output isn't correct
22 Incorrect 27 ms 1144 KB Output isn't correct
23 Incorrect 27 ms 1144 KB Output isn't correct
24 Incorrect 38 ms 1160 KB Output isn't correct
25 Incorrect 21 ms 1152 KB Output isn't correct
26 Incorrect 28 ms 1144 KB Output isn't correct
27 Incorrect 30 ms 1144 KB Output isn't correct
28 Incorrect 25 ms 1144 KB Output isn't correct
29 Incorrect 71 ms 1144 KB Output isn't correct
30 Incorrect 45 ms 1144 KB Output isn't correct
31 Incorrect 2 ms 384 KB Output isn't correct
32 Incorrect 2 ms 384 KB Output isn't correct