# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
30765 |
2017-07-26T12:16:50 Z |
ozaslan |
Gap (APIO16_gap) |
C++14 |
|
49 ms |
4900 KB |
#include "gap.h"
#include <stdio.h>
#define maxN (1<<30)
using namespace std;
long long max(long long x, long long y) {return x > y ? x : y;}
long long findGap(int T, int N)
{
long long d[100000];
long long mn, mx, s, t;
long long sol = 0, sag = maxN;
int solIn = 0, sagIn = N-1;
while (solIn < sagIn) {
// printf("Sol: %lld, sag: %lld, ", sol, sag);
s = sol, t = sag;
MinMax(s, t, &mn, &mx);
//printf("mn: %lld, mx: %lld\n", mn, mx);
d[solIn++] = sol = mn;
d[sagIn--] = sag = mx;
sol++, sag--;
}
if (solIn == sagIn) {
MinMax(d[solIn-1]+1, t, &mn, &mx);
d[solIn] = mn;
}
long long fark = 0;
/* for (int i = 0; i < N; i++)
printf("%d ", d[i]);
printf("\n");
*/for (int i = 1; i < N; i++)
fark = max(fark, d[i] - d[i-1]);
return fark;
}
Compilation message
gap.cpp: In function 'long long int findGap(int, int)':
gap.cpp:26:42: warning: 't' may be used uninitialized in this function [-Wmaybe-uninitialized]
MinMax(d[solIn-1]+1, t, &mn, &mx);
^
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
4900 KB |
Output isn't correct |
2 |
Incorrect |
0 ms |
4896 KB |
Unexpected end of file - int64 expected |
3 |
Incorrect |
0 ms |
4900 KB |
Unexpected end of file - int64 expected |
4 |
Incorrect |
0 ms |
4896 KB |
Unexpected end of file - int64 expected |
5 |
Correct |
0 ms |
4900 KB |
Output is correct |
6 |
Incorrect |
0 ms |
4892 KB |
Unexpected end of file - int64 expected |
7 |
Incorrect |
0 ms |
4896 KB |
Unexpected end of file - int64 expected |
8 |
Incorrect |
0 ms |
4900 KB |
Unexpected end of file - int64 expected |
9 |
Incorrect |
0 ms |
4896 KB |
Unexpected end of file - int64 expected |
10 |
Correct |
0 ms |
4896 KB |
Output is correct |
11 |
Incorrect |
0 ms |
4896 KB |
Unexpected end of file - int64 expected |
12 |
Incorrect |
0 ms |
4896 KB |
Unexpected end of file - int64 expected |
13 |
Incorrect |
0 ms |
4896 KB |
Unexpected end of file - int64 expected |
14 |
Incorrect |
0 ms |
4896 KB |
Unexpected end of file - int64 expected |
15 |
Incorrect |
0 ms |
4900 KB |
Unexpected end of file - int64 expected |
16 |
Incorrect |
6 ms |
4900 KB |
Unexpected end of file - int64 expected |
17 |
Incorrect |
6 ms |
4896 KB |
Unexpected end of file - int64 expected |
18 |
Incorrect |
6 ms |
4896 KB |
Unexpected end of file - int64 expected |
19 |
Incorrect |
6 ms |
4896 KB |
Unexpected end of file - int64 expected |
20 |
Correct |
6 ms |
4892 KB |
Output is correct |
21 |
Incorrect |
23 ms |
4900 KB |
Unexpected end of file - int64 expected |
22 |
Incorrect |
26 ms |
4896 KB |
Unexpected end of file - int64 expected |
23 |
Incorrect |
36 ms |
4896 KB |
Unexpected end of file - int64 expected |
24 |
Incorrect |
29 ms |
4896 KB |
Unexpected end of file - int64 expected |
25 |
Incorrect |
19 ms |
4896 KB |
Unexpected end of file - int64 expected |
26 |
Incorrect |
43 ms |
4900 KB |
Unexpected end of file - int64 expected |
27 |
Incorrect |
33 ms |
4900 KB |
Unexpected end of file - int64 expected |
28 |
Incorrect |
33 ms |
4900 KB |
Unexpected end of file - int64 expected |
29 |
Incorrect |
33 ms |
4900 KB |
Unexpected end of file - int64 expected |
30 |
Correct |
39 ms |
4896 KB |
Output is correct |
31 |
Incorrect |
0 ms |
4892 KB |
Unexpected end of file - int64 expected |
32 |
Incorrect |
0 ms |
4900 KB |
Unexpected end of file - int64 expected |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
4900 KB |
Output isn't correct |
2 |
Incorrect |
0 ms |
4896 KB |
Unexpected end of file - int64 expected |
3 |
Incorrect |
0 ms |
4900 KB |
Unexpected end of file - int64 expected |
4 |
Incorrect |
0 ms |
4896 KB |
Unexpected end of file - int64 expected |
5 |
Partially correct |
0 ms |
4896 KB |
Partially correct |
6 |
Incorrect |
0 ms |
4892 KB |
Unexpected end of file - int64 expected |
7 |
Incorrect |
0 ms |
4896 KB |
Unexpected end of file - int64 expected |
8 |
Incorrect |
0 ms |
4896 KB |
Unexpected end of file - int64 expected |
9 |
Incorrect |
0 ms |
4896 KB |
Unexpected end of file - int64 expected |
10 |
Partially correct |
0 ms |
4896 KB |
Partially correct |
11 |
Incorrect |
0 ms |
4892 KB |
Unexpected end of file - int64 expected |
12 |
Incorrect |
0 ms |
4892 KB |
Unexpected end of file - int64 expected |
13 |
Incorrect |
0 ms |
4896 KB |
Unexpected end of file - int64 expected |
14 |
Incorrect |
0 ms |
4896 KB |
Unexpected end of file - int64 expected |
15 |
Incorrect |
0 ms |
4896 KB |
Unexpected end of file - int64 expected |
16 |
Incorrect |
6 ms |
4896 KB |
Unexpected end of file - int64 expected |
17 |
Incorrect |
3 ms |
4896 KB |
Unexpected end of file - int64 expected |
18 |
Incorrect |
6 ms |
4900 KB |
Unexpected end of file - int64 expected |
19 |
Incorrect |
6 ms |
4900 KB |
Unexpected end of file - int64 expected |
20 |
Partially correct |
9 ms |
4896 KB |
Partially correct |
21 |
Incorrect |
33 ms |
4896 KB |
Unexpected end of file - int64 expected |
22 |
Incorrect |
33 ms |
4896 KB |
Unexpected end of file - int64 expected |
23 |
Incorrect |
26 ms |
4896 KB |
Unexpected end of file - int64 expected |
24 |
Incorrect |
43 ms |
4896 KB |
Unexpected end of file - int64 expected |
25 |
Incorrect |
23 ms |
4896 KB |
Unexpected end of file - int64 expected |
26 |
Incorrect |
26 ms |
4892 KB |
Unexpected end of file - int64 expected |
27 |
Incorrect |
49 ms |
4900 KB |
Unexpected end of file - int64 expected |
28 |
Incorrect |
26 ms |
4896 KB |
Unexpected end of file - int64 expected |
29 |
Incorrect |
33 ms |
4892 KB |
Unexpected end of file - int64 expected |
30 |
Incorrect |
46 ms |
4896 KB |
Expected int32, but "2500100000" found |
31 |
Incorrect |
0 ms |
4896 KB |
Unexpected end of file - int64 expected |
32 |
Incorrect |
0 ms |
4892 KB |
Unexpected end of file - int64 expected |