Submission #81650

# Submission time Handle Problem Language Result Execution time Memory
81650 2018-10-26T00:48:24 Z xiaowuc1 Gap (APIO16_gap) C++14
0 / 100
2000 ms 10880 KB
#include <bits/stdc++.h>
#include "gap.h"

using namespace std;

typedef long long ll;

ll onesolve(int n) {
	return 0;
}

ll twosolve(int n) {
	ll lhs, rhs;
	MinMax(1, 1000000000000000000LL, &lhs, &rhs);
	ll ret = (rhs-lhs+n-2)/(n-1);
	set<ll> all;
	all.insert(lhs);
	all.insert(rhs);
	ll last = lhs+1;
	while(last <= rhs) {
		MinMax(last, last + ret, &lhs, &rhs);
		if(lhs >= 0) {
			all.insert(lhs);
			all.insert(rhs);
		}
	}
	ll lowest = *all.begin();
	for(ll out: all) {
		ret = max(ret, out - lowest);
		lowest = out;
	}
	return ret;
}

ll findGap(int t, int n) {
	if(t==1) return onesolve(n);
	else return twosolve(n);
}
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 376 KB Output isn't correct
2 Incorrect 2 ms 384 KB Output isn't correct
3 Incorrect 2 ms 504 KB Output isn't correct
4 Incorrect 2 ms 504 KB Output isn't correct
5 Incorrect 2 ms 616 KB Output isn't correct
6 Incorrect 2 ms 616 KB Output isn't correct
7 Incorrect 2 ms 616 KB Output isn't correct
8 Incorrect 2 ms 616 KB Output isn't correct
9 Incorrect 2 ms 616 KB Output isn't correct
10 Incorrect 2 ms 616 KB Output isn't correct
11 Incorrect 2 ms 616 KB Output isn't correct
12 Incorrect 3 ms 616 KB Output isn't correct
13 Incorrect 2 ms 616 KB Output isn't correct
14 Incorrect 2 ms 616 KB Output isn't correct
15 Incorrect 2 ms 628 KB Output isn't correct
16 Incorrect 9 ms 1280 KB Output isn't correct
17 Incorrect 10 ms 1756 KB Output isn't correct
18 Incorrect 11 ms 2320 KB Output isn't correct
19 Incorrect 9 ms 2684 KB Output isn't correct
20 Incorrect 5 ms 2764 KB Output isn't correct
21 Incorrect 29 ms 5224 KB Output isn't correct
22 Incorrect 29 ms 7068 KB Output isn't correct
23 Incorrect 32 ms 8908 KB Output isn't correct
24 Incorrect 30 ms 10744 KB Output isn't correct
25 Incorrect 21 ms 10744 KB Output isn't correct
26 Incorrect 33 ms 10760 KB Output isn't correct
27 Incorrect 29 ms 10760 KB Output isn't correct
28 Incorrect 29 ms 10760 KB Output isn't correct
29 Incorrect 29 ms 10760 KB Output isn't correct
30 Incorrect 15 ms 10764 KB Output isn't correct
31 Incorrect 2 ms 10764 KB Output isn't correct
32 Incorrect 2 ms 10764 KB Output isn't correct
# Verdict Execution time Memory Grader output
1 Execution timed out 2073 ms 10764 KB Time limit exceeded
2 Execution timed out 2050 ms 10764 KB Time limit exceeded
3 Incorrect 2 ms 10764 KB Output isn't correct
4 Execution timed out 2076 ms 10764 KB Time limit exceeded
5 Execution timed out 2051 ms 10764 KB Time limit exceeded
6 Incorrect 2 ms 10764 KB Output isn't correct
7 Execution timed out 2061 ms 10764 KB Time limit exceeded
8 Incorrect 2 ms 10764 KB Output isn't correct
9 Execution timed out 2059 ms 10764 KB Time limit exceeded
10 Execution timed out 2071 ms 10764 KB Time limit exceeded
11 Execution timed out 2060 ms 10764 KB Time limit exceeded
12 Incorrect 2 ms 10764 KB Output isn't correct
13 Incorrect 2 ms 10764 KB Output isn't correct
14 Execution timed out 2059 ms 10764 KB Time limit exceeded
15 Execution timed out 2061 ms 10764 KB Time limit exceeded
16 Execution timed out 2064 ms 10764 KB Time limit exceeded
17 Execution timed out 2067 ms 10764 KB Time limit exceeded
18 Incorrect 9 ms 10764 KB Output isn't correct
19 Execution timed out 2060 ms 10764 KB Time limit exceeded
20 Execution timed out 2056 ms 10764 KB Time limit exceeded
21 Execution timed out 2066 ms 10804 KB Time limit exceeded
22 Incorrect 32 ms 10816 KB Output isn't correct
23 Incorrect 29 ms 10880 KB Output isn't correct
24 Execution timed out 2064 ms 10880 KB Time limit exceeded
25 Execution timed out 2059 ms 10880 KB Time limit exceeded
26 Incorrect 32 ms 10880 KB Output isn't correct
27 Incorrect 32 ms 10880 KB Output isn't correct
28 Incorrect 30 ms 10880 KB Output isn't correct
29 Execution timed out 2049 ms 10880 KB Time limit exceeded
30 Execution timed out 2094 ms 10880 KB Time limit exceeded
31 Execution timed out 2024 ms 10880 KB Time limit exceeded
32 Incorrect 2 ms 10880 KB Output isn't correct