답안 #963628

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
963628 2024-04-15T12:04:39 Z Acanikolic Gap (APIO16_gap) C++14
0 / 100
37 ms 3024 KB
#include <bits/stdc++.h>

#include "gap.h"

#define F first

#define S second

using namespace std;

const int N = 2e5 + 10;

const long long inf = 1000000000000000000ll;

/*long long a[N];
int n;

void MinMax(long long s,long long t,long long &mn,long long &mx) {
    for(int i = 1; i <= n; i++) {
        if(a[i] >= s) {
            mn = a[i];
            break;
        }
    }
    for(int i = 1; i <= n; i++) {
        if(a[i] <= t) mx = a[i];
    }
}*/

long long findGap(int t,int n) {
    long long L,R,res = 1e18;
    MinMax(0,inf,&L,&R);
    for(int i = 1; i <= (n + 1) / 2; i++) {
        long long l = L,r = R;
        MinMax(l + 1,r - 1,&L,&R);
        if(L != -1) res = min(res,L - l);
        if(R != -1) res = min(res,r - R);
    }
    return res;
}

/*signed main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

    cin >> n;
    for(int i = 1; i <= n; i++) cin >> a[i];
    cout << findGap(1,n);
    return 0;
}
*/
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 344 KB Output isn't correct
2 Runtime error 0 ms 2392 KB Execution failed because the return code was nonzero
3 Runtime error 0 ms 2392 KB Execution failed because the return code was nonzero
4 Runtime error 2 ms 2392 KB Execution failed because the return code was nonzero
5 Runtime error 0 ms 2392 KB Execution failed because the return code was nonzero
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 2656 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 2584 KB Output isn't correct
17 Incorrect 7 ms 2584 KB Output isn't correct
18 Incorrect 7 ms 2588 KB Output isn't correct
19 Incorrect 7 ms 2580 KB Output isn't correct
20 Runtime error 6 ms 2572 KB Execution failed because the return code was nonzero
21 Incorrect 37 ms 2928 KB Output isn't correct
22 Incorrect 31 ms 2856 KB Output isn't correct
23 Incorrect 27 ms 3024 KB Output isn't correct
24 Incorrect 27 ms 2856 KB Output isn't correct
25 Incorrect 24 ms 2864 KB Output isn't correct
26 Incorrect 27 ms 2852 KB Output isn't correct
27 Incorrect 30 ms 2840 KB Output isn't correct
28 Incorrect 31 ms 2844 KB Output isn't correct
29 Incorrect 27 ms 2980 KB Output isn't correct
30 Runtime error 27 ms 2856 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 2644 KB Output isn't correct
2 Runtime error 0 ms 2392 KB Execution failed because the return code was nonzero
3 Runtime error 1 ms 2392 KB Execution failed because the return code was nonzero
4 Runtime error 1 ms 2392 KB Execution failed because the return code was nonzero
5 Runtime error 1 ms 2392 KB Execution failed because the return code was nonzero
6 Incorrect 1 ms 2392 KB Output isn't correct
7 Incorrect 1 ms 2480 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 2 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 Partially correct 1 ms 2392 KB Partially correct
16 Incorrect 8 ms 2568 KB Output isn't correct
17 Incorrect 7 ms 2584 KB Output isn't correct
18 Incorrect 7 ms 2588 KB Output isn't correct
19 Incorrect 10 ms 2580 KB Output isn't correct
20 Runtime error 6 ms 2572 KB Execution failed because the return code was nonzero
21 Incorrect 27 ms 2848 KB Expected int32, but "2500100001" found
22 Incorrect 30 ms 2856 KB Expected int32, but "2500100001" found
23 Incorrect 34 ms 2864 KB Expected int32, but "2500100001" found
24 Incorrect 29 ms 2860 KB Expected int32, but "2500100001" found
25 Incorrect 25 ms 2848 KB Expected int32, but "2500100001" found
26 Incorrect 27 ms 3020 KB Expected int32, but "2500100001" found
27 Incorrect 28 ms 2852 KB Expected int32, but "2500100001" found
28 Incorrect 27 ms 2856 KB Expected int32, but "2500100001" found
29 Incorrect 28 ms 2860 KB Expected int32, but "2500100001" found
30 Runtime error 24 ms 2852 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