답안 #946420

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
946420 2024-03-14T16:16:41 Z n3rm1n Gap (APIO16_gap) C++17
0 / 100
37 ms 3456 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 < filled1)
	{
	    ///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 1 ms 344 KB Output isn't correct
2 Incorrect 1 ms 2392 KB Output isn't correct
3 Incorrect 1 ms 2392 KB Output isn't correct
4 Incorrect 1 ms 2392 KB Output isn't correct
5 Incorrect 1 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 0 ms 2392 KB Output isn't correct
9 Incorrect 1 ms 2392 KB Output isn't correct
10 Runtime error 1 ms 2392 KB Execution failed because the return code was nonzero
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 2536 KB Output isn't correct
17 Incorrect 9 ms 2648 KB Output isn't correct
18 Incorrect 11 ms 2532 KB Output isn't correct
19 Incorrect 7 ms 2532 KB Output isn't correct
20 Runtime error 6 ms 2536 KB Execution failed because the return code was nonzero
21 Incorrect 31 ms 3456 KB Output isn't correct
22 Incorrect 30 ms 3280 KB Output isn't correct
23 Incorrect 33 ms 3392 KB Output isn't correct
24 Incorrect 28 ms 3320 KB Output isn't correct
25 Incorrect 26 ms 3452 KB Output isn't correct
26 Incorrect 30 ms 3440 KB Output isn't correct
27 Incorrect 31 ms 3400 KB Output isn't correct
28 Incorrect 32 ms 3436 KB Output isn't correct
29 Incorrect 29 ms 3448 KB Output isn't correct
30 Runtime error 24 ms 3240 KB Execution failed because the return code was nonzero
31 Runtime error 1 ms 2392 KB Execution failed because the return code was nonzero
32 Runtime error 1 ms 2392 KB Execution failed because the return code was nonzero
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 2548 KB Output isn't correct
2 Incorrect 1 ms 2392 KB Output isn't correct
3 Incorrect 1 ms 2392 KB Output isn't correct
4 Incorrect 1 ms 2392 KB Output isn't correct
5 Incorrect 1 ms 2392 KB Output isn't correct
6 Incorrect 1 ms 2392 KB Output isn't correct
7 Incorrect 0 ms 2392 KB Output isn't correct
8 Incorrect 1 ms 2392 KB Output isn't correct
9 Incorrect 1 ms 2388 KB Output isn't correct
10 Runtime error 1 ms 2392 KB Execution failed because the return code was nonzero
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 8 ms 2524 KB Output isn't correct
17 Incorrect 7 ms 2536 KB Output isn't correct
18 Incorrect 8 ms 2512 KB Output isn't correct
19 Incorrect 7 ms 2708 KB Output isn't correct
20 Runtime error 7 ms 2784 KB Execution failed because the return code was nonzero
21 Incorrect 32 ms 3448 KB Expected int32, but "2500100001" found
22 Incorrect 28 ms 3432 KB Expected int32, but "2500100001" found
23 Incorrect 36 ms 3428 KB Expected int32, but "2500100001" found
24 Incorrect 33 ms 3380 KB Expected int32, but "2500100001" found
25 Incorrect 28 ms 3384 KB Expected int32, but "2500100001" found
26 Incorrect 30 ms 3456 KB Expected int32, but "2500100001" found
27 Incorrect 37 ms 3408 KB Expected int32, but "2500100001" found
28 Incorrect 32 ms 3444 KB Expected int32, but "2500100001" found
29 Incorrect 30 ms 3440 KB Expected int32, but "2500100001" found
30 Runtime error 28 ms 3344 KB Execution failed because the return code was nonzero
31 Runtime error 1 ms 2392 KB Execution failed because the return code was nonzero
32 Runtime error 1 ms 2392 KB Execution failed because the return code was nonzero