Submission #849811

# Submission time Handle Problem Language Result Execution time Memory
849811 2023-09-15T12:01:04 Z nnin Gap (APIO16_gap) C++14
0 / 100
18 ms 3028 KB
#include "gap.h"
#define ll long long
#include<bits/stdc++.h>
using namespace std;

long long findGap(int T, int N) {
    ll mn, mx, curmn, curmx;
    MinMax((ll)1, (ll)1e18, &mn, &mx);
    ll ans = 0;
    while(N>2) {
        MinMax(mn+ans+1, mx-ans-1, &curmn, &curmx);
        ans = max(ans,  max(curmn-mn, mx-curmx));
        N -= 2;
        mx = curmx;
        mn = curmn;
    }
    ans = max(ans, mx-mn);
    return ans;
}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 596 KB Output is correct
2 Runtime error 1 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 0 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 Runtime error 0 ms 2392 KB Execution failed because the return code was nonzero
7 Runtime error 1 ms 2392 KB Execution failed because the return code was nonzero
8 Runtime error 1 ms 2400 KB Execution failed because the return code was nonzero
9 Runtime error 0 ms 2392 KB Execution failed because the return code was nonzero
10 Runtime error 0 ms 2392 KB Execution failed because the return code was nonzero
11 Runtime error 1 ms 2656 KB Execution failed because the return code was nonzero
12 Runtime error 1 ms 2392 KB Execution failed because the return code was nonzero
13 Runtime error 1 ms 2392 KB Execution failed because the return code was nonzero
14 Runtime error 1 ms 2392 KB Execution failed because the return code was nonzero
15 Runtime error 1 ms 2392 KB Execution failed because the return code was nonzero
16 Runtime error 5 ms 2696 KB Execution failed because the return code was nonzero
17 Runtime error 3 ms 2588 KB Execution failed because the return code was nonzero
18 Runtime error 3 ms 2584 KB Execution failed because the return code was nonzero
19 Runtime error 5 ms 2500 KB Execution failed because the return code was nonzero
20 Runtime error 2 ms 2740 KB Execution failed because the return code was nonzero
21 Runtime error 12 ms 2860 KB Execution failed because the return code was nonzero
22 Runtime error 12 ms 2996 KB Execution failed because the return code was nonzero
23 Runtime error 13 ms 2848 KB Execution failed because the return code was nonzero
24 Runtime error 18 ms 2928 KB Execution failed because the return code was nonzero
25 Runtime error 9 ms 3016 KB Execution failed because the return code was nonzero
26 Runtime error 12 ms 2856 KB Execution failed because the return code was nonzero
27 Runtime error 12 ms 2856 KB Execution failed because the return code was nonzero
28 Runtime error 12 ms 3020 KB Execution failed because the return code was nonzero
29 Runtime error 14 ms 3008 KB Execution failed because the return code was nonzero
30 Runtime error 7 ms 2852 KB Execution failed because the return code was nonzero
31 Runtime error 0 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
# Verdict Execution time Memory Grader output
1 Correct 1 ms 2392 KB Output is 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 0 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 Runtime error 0 ms 2392 KB Execution failed because the return code was nonzero
7 Runtime error 0 ms 2392 KB Execution failed because the return code was nonzero
8 Runtime error 0 ms 2392 KB Execution failed because the return code was nonzero
9 Runtime error 0 ms 2392 KB Execution failed because the return code was nonzero
10 Runtime error 1 ms 2392 KB Execution failed because the return code was nonzero
11 Runtime error 1 ms 2392 KB Execution failed because the return code was nonzero
12 Runtime error 1 ms 2392 KB Execution failed because the return code was nonzero
13 Runtime error 1 ms 2392 KB Execution failed because the return code was nonzero
14 Runtime error 1 ms 2392 KB Execution failed because the return code was nonzero
15 Runtime error 1 ms 2396 KB Execution failed because the return code was nonzero
16 Runtime error 4 ms 2580 KB Execution failed because the return code was nonzero
17 Runtime error 4 ms 2580 KB Execution failed because the return code was nonzero
18 Runtime error 3 ms 2596 KB Execution failed because the return code was nonzero
19 Runtime error 3 ms 2596 KB Execution failed because the return code was nonzero
20 Runtime error 2 ms 2780 KB Execution failed because the return code was nonzero
21 Runtime error 12 ms 3028 KB Execution failed because the return code was nonzero
22 Runtime error 12 ms 2868 KB Execution failed because the return code was nonzero
23 Runtime error 12 ms 3012 KB Execution failed because the return code was nonzero
24 Runtime error 12 ms 2860 KB Execution failed because the return code was nonzero
25 Runtime error 10 ms 2852 KB Execution failed because the return code was nonzero
26 Runtime error 12 ms 2860 KB Execution failed because the return code was nonzero
27 Runtime error 12 ms 2860 KB Execution failed because the return code was nonzero
28 Runtime error 12 ms 2856 KB Execution failed because the return code was nonzero
29 Runtime error 12 ms 2832 KB Execution failed because the return code was nonzero
30 Runtime error 8 ms 2844 KB Execution failed because the return code was nonzero
31 Runtime error 0 ms 2392 KB Execution failed because the return code was nonzero
32 Runtime error 0 ms 2392 KB Execution failed because the return code was nonzero