답안 #946422

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
946422 2024-03-14T16:17:55 Z n3rm1n Gap (APIO16_gap) C++17
0 / 100
34 ms 3608 KB
#include<bits/stdc++.h>
#include "gap.h"

using namespace std;
const int MAXN = 2e5 + 10;
long long a[MAXN];
long long findGap(int T, int N)
{
	long long s = 0, t = (long long)(1e18);
	long long mn, mx;
	int n = N;
	int filled0 = 0, filled1 = n+1;

	while(filled0 + 1 <= filled1 - 1)
	{
	    ///cout << mn << " " << mx << endl;
	    MinMax(s, t, &mn, &mx);

	    if(mn == mx)
        {
            filled0 ++;
            a[filled0] = mn;
            n --;
            break;
        }
        filled0 ++;
        filled1 --;
        n-= 2;
        a[filled0] = mn;
        a[filled1] = mx;

        s = mn + 1;
        t = mx - 1;
	}
	long long ans = 0;
	for (int i = 2; i <= n; ++ i)
    {
        ans = max(ans, a[i] - a[i-1]);
    }
    return ans;
}
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 344 KB Output isn't correct
2 Incorrect 0 ms 2392 KB Output isn't correct
3 Incorrect 0 ms 2392 KB Output isn't correct
4 Incorrect 0 ms 2392 KB Output isn't correct
5 Incorrect 1 ms 2392 KB Output isn't correct
6 Incorrect 0 ms 2392 KB Output isn't correct
7 Incorrect 1 ms 2392 KB Output isn't correct
8 Incorrect 1 ms 2392 KB Output isn't correct
9 Incorrect 0 ms 2392 KB Output isn't correct
10 Incorrect 0 ms 2392 KB Output isn't correct
11 Incorrect 1 ms 2392 KB Output isn't correct
12 Incorrect 1 ms 2392 KB Output isn't correct
13 Incorrect 1 ms 2392 KB Output isn't correct
14 Incorrect 1 ms 2388 KB Output isn't correct
15 Incorrect 1 ms 2392 KB Output isn't correct
16 Incorrect 7 ms 2544 KB Output isn't correct
17 Incorrect 8 ms 2892 KB Output isn't correct
18 Incorrect 7 ms 2536 KB Output isn't correct
19 Incorrect 7 ms 2540 KB Output isn't correct
20 Incorrect 6 ms 2644 KB Output isn't correct
21 Incorrect 29 ms 3240 KB Output isn't correct
22 Incorrect 29 ms 3428 KB Output isn't correct
23 Incorrect 27 ms 3452 KB Output isn't correct
24 Incorrect 29 ms 3456 KB Output isn't correct
25 Incorrect 25 ms 3448 KB Output isn't correct
26 Incorrect 28 ms 3440 KB Output isn't correct
27 Incorrect 28 ms 3440 KB Output isn't correct
28 Incorrect 29 ms 3424 KB Output isn't correct
29 Incorrect 34 ms 3452 KB Output isn't correct
30 Incorrect 23 ms 3244 KB Output isn't correct
31 Incorrect 1 ms 2392 KB Output isn't correct
32 Incorrect 1 ms 2492 KB Output isn't correct
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 2392 KB Output isn't correct
2 Incorrect 0 ms 2392 KB Output isn't correct
3 Incorrect 1 ms 2644 KB Output isn't correct
4 Incorrect 0 ms 2392 KB Output isn't correct
5 Incorrect 0 ms 2392 KB Output isn't correct
6 Incorrect 1 ms 2392 KB Output isn't correct
7 Incorrect 1 ms 2392 KB Output isn't correct
8 Incorrect 1 ms 2392 KB Output isn't correct
9 Incorrect 0 ms 2392 KB Output isn't correct
10 Incorrect 1 ms 2392 KB Output isn't correct
11 Incorrect 1 ms 2392 KB Output isn't correct
12 Incorrect 1 ms 2392 KB Output isn't correct
13 Incorrect 1 ms 2392 KB Output isn't correct
14 Incorrect 1 ms 2392 KB Output isn't correct
15 Incorrect 1 ms 2392 KB Output isn't correct
16 Incorrect 7 ms 2540 KB Output isn't correct
17 Incorrect 8 ms 2536 KB Output isn't correct
18 Incorrect 7 ms 2644 KB Output isn't correct
19 Incorrect 7 ms 2540 KB Output isn't correct
20 Incorrect 6 ms 2792 KB Output isn't correct
21 Incorrect 28 ms 3608 KB Expected int32, but "2500100000" found
22 Incorrect 28 ms 3464 KB Expected int32, but "2500100000" found
23 Incorrect 28 ms 3452 KB Expected int32, but "2500100000" found
24 Incorrect 28 ms 3452 KB Expected int32, but "2500100000" found
25 Incorrect 25 ms 3448 KB Expected int32, but "2500100000" found
26 Incorrect 28 ms 3324 KB Expected int32, but "2500100000" found
27 Incorrect 28 ms 3428 KB Expected int32, but "2500100000" found
28 Incorrect 29 ms 3448 KB Expected int32, but "2500100000" found
29 Incorrect 28 ms 3356 KB Expected int32, but "2500100000" found
30 Incorrect 24 ms 3400 KB Expected int32, but "2500100000" found
31 Incorrect 1 ms 2392 KB Output isn't correct
32 Incorrect 0 ms 2392 KB Output isn't correct