#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);
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:24:16: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for(int i=1; i<v.size(); i++) {
~^~~~~~~~~
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
2 ms |
376 KB |
Output isn't correct |
2 |
Incorrect |
2 ms |
376 KB |
Output isn't correct |
3 |
Incorrect |
2 ms |
440 KB |
Output isn't correct |
4 |
Incorrect |
2 ms |
444 KB |
Output isn't correct |
5 |
Correct |
2 ms |
448 KB |
Output is correct |
6 |
Incorrect |
2 ms |
456 KB |
Output isn't correct |
7 |
Incorrect |
2 ms |
552 KB |
Output isn't correct |
8 |
Incorrect |
2 ms |
660 KB |
Output isn't correct |
9 |
Incorrect |
2 ms |
660 KB |
Output isn't correct |
10 |
Correct |
2 ms |
660 KB |
Output is correct |
11 |
Incorrect |
3 ms |
744 KB |
Output isn't correct |
12 |
Incorrect |
3 ms |
744 KB |
Output isn't correct |
13 |
Incorrect |
3 ms |
924 KB |
Output isn't correct |
14 |
Incorrect |
3 ms |
924 KB |
Output isn't correct |
15 |
Correct |
2 ms |
924 KB |
Output is correct |
16 |
Incorrect |
20 ms |
1964 KB |
Output isn't correct |
17 |
Incorrect |
17 ms |
2444 KB |
Output isn't correct |
18 |
Incorrect |
19 ms |
2908 KB |
Output isn't correct |
19 |
Incorrect |
27 ms |
3372 KB |
Output isn't correct |
20 |
Correct |
14 ms |
3580 KB |
Output is correct |
21 |
Incorrect |
69 ms |
6672 KB |
Output isn't correct |
22 |
Incorrect |
64 ms |
8516 KB |
Output isn't correct |
23 |
Incorrect |
63 ms |
10360 KB |
Output isn't correct |
24 |
Incorrect |
64 ms |
12200 KB |
Output isn't correct |
25 |
Correct |
54 ms |
13424 KB |
Output is correct |
26 |
Incorrect |
64 ms |
15464 KB |
Output isn't correct |
27 |
Incorrect |
67 ms |
17140 KB |
Output isn't correct |
28 |
Incorrect |
63 ms |
18984 KB |
Output isn't correct |
29 |
Incorrect |
65 ms |
20836 KB |
Output isn't correct |
30 |
Correct |
49 ms |
21516 KB |
Output is correct |
31 |
Incorrect |
2 ms |
21516 KB |
Output isn't correct |
32 |
Incorrect |
2 ms |
21516 KB |
Output isn't correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
2 ms |
21516 KB |
Output isn't correct |
2 |
Incorrect |
2 ms |
21516 KB |
Output isn't correct |
3 |
Incorrect |
2 ms |
21516 KB |
Output isn't correct |
4 |
Incorrect |
2 ms |
21516 KB |
Output isn't correct |
5 |
Incorrect |
3 ms |
21516 KB |
Output isn't correct |
6 |
Incorrect |
2 ms |
21516 KB |
Output isn't correct |
7 |
Incorrect |
2 ms |
21516 KB |
Output isn't correct |
8 |
Incorrect |
2 ms |
21516 KB |
Output isn't correct |
9 |
Incorrect |
2 ms |
21516 KB |
Output isn't correct |
10 |
Incorrect |
2 ms |
21516 KB |
Output isn't correct |
11 |
Incorrect |
2 ms |
21516 KB |
Output isn't correct |
12 |
Incorrect |
2 ms |
21516 KB |
Output isn't correct |
13 |
Incorrect |
3 ms |
21516 KB |
Output isn't correct |
14 |
Incorrect |
3 ms |
21516 KB |
Output isn't correct |
15 |
Incorrect |
3 ms |
21516 KB |
Output isn't correct |
16 |
Incorrect |
12 ms |
21516 KB |
Output isn't correct |
17 |
Incorrect |
9 ms |
21516 KB |
Output isn't correct |
18 |
Incorrect |
9 ms |
21516 KB |
Output isn't correct |
19 |
Incorrect |
13 ms |
21892 KB |
Output isn't correct |
20 |
Incorrect |
9 ms |
21972 KB |
Output isn't correct |
21 |
Incorrect |
39 ms |
24432 KB |
Output isn't correct |
22 |
Incorrect |
58 ms |
26336 KB |
Output isn't correct |
23 |
Incorrect |
32 ms |
28284 KB |
Output isn't correct |
24 |
Incorrect |
33 ms |
30012 KB |
Output isn't correct |
25 |
Incorrect |
23 ms |
31268 KB |
Output isn't correct |
26 |
Incorrect |
49 ms |
33040 KB |
Output isn't correct |
27 |
Incorrect |
54 ms |
34916 KB |
Output isn't correct |
28 |
Incorrect |
47 ms |
36760 KB |
Output isn't correct |
29 |
Incorrect |
51 ms |
38660 KB |
Output isn't correct |
30 |
Incorrect |
18 ms |
39312 KB |
Output isn't correct |
31 |
Incorrect |
2 ms |
39312 KB |
Output isn't correct |
32 |
Incorrect |
2 ms |
39312 KB |
Output isn't correct |