답안 #38748

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
38748 2018-01-06T11:48:05 Z oTTo_22 Gap (APIO16_gap) C++14
0 / 100
2000 ms 524288 KB
#include <bits/stdc++.h>
#include "gap.h"
#define se second
#define fi first
using namespace std;

long long ans=0;

void func (long long L,long long R) {
    long long mi1,ma1,mi2,ma2;
    long long mid=(L+R)/2;
    MinMax(L,mid,&mi1,&ma1);
    MinMax(mid,R,&mi2,&ma2);
    if (ma1==-1 && mi2==-1) {
        ans=max(ans,R-L);
        return;
    }
    if (ma1==-1) {
        ans=max(ans,mi2-L);
        return;
    }
    if (mi2==-1) {
        ans=max(ans,R-ma1);
        return;
    }
    if (ma1-L>ans)
        func(L,ma1);
    if (R-mi2>ans)
        func(mi2,R);
}

long long findGap(int T, int N)
{
    int n=N;
    long long Mn,Mx;
    long long S=0;
    long long TT=1000000000000000000;
    MinMax(S,TT,&Mn,&Mx);
    if (n==2)
        return Mx-Mn;
    ans=0;
    func (Mn,Mx);
    return ans;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 5140 KB Output is correct
2 Incorrect 0 ms 5140 KB Output isn't correct
3 Incorrect 0 ms 5140 KB Output isn't correct
4 Incorrect 0 ms 5140 KB Output isn't correct
5 Incorrect 0 ms 5140 KB Output isn't correct
6 Incorrect 0 ms 5140 KB Output isn't correct
7 Incorrect 0 ms 5140 KB Output isn't correct
8 Incorrect 0 ms 5140 KB Output isn't correct
9 Incorrect 0 ms 5140 KB Output isn't correct
10 Memory limit exceeded 969 ms 524288 KB Memory limit exceeded
11 Incorrect 0 ms 5140 KB Output isn't correct
12 Incorrect 0 ms 5140 KB Output isn't correct
13 Incorrect 0 ms 5140 KB Output isn't correct
14 Incorrect 0 ms 5140 KB Output isn't correct
15 Incorrect 0 ms 5140 KB Output isn't correct
16 Incorrect 36 ms 5140 KB Output isn't correct
17 Incorrect 39 ms 5140 KB Output isn't correct
18 Incorrect 33 ms 5140 KB Output isn't correct
19 Incorrect 33 ms 5140 KB Output isn't correct
20 Execution timed out 2000 ms 524288 KB Execution timed out
21 Incorrect 123 ms 5140 KB Output isn't correct
22 Incorrect 129 ms 5140 KB Output isn't correct
23 Incorrect 143 ms 5140 KB Output isn't correct
24 Incorrect 126 ms 5140 KB Output isn't correct
25 Incorrect 133 ms 5140 KB Output isn't correct
26 Incorrect 126 ms 5140 KB Output isn't correct
27 Incorrect 139 ms 5140 KB Output isn't correct
28 Incorrect 129 ms 5140 KB Output isn't correct
29 Incorrect 126 ms 5140 KB Output isn't correct
30 Execution timed out 2000 ms 524288 KB Execution timed out
31 Memory limit exceeded 1006 ms 524288 KB Memory limit exceeded
32 Memory limit exceeded 1319 ms 524288 KB Memory limit exceeded
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 5140 KB Output is correct
2 Incorrect 0 ms 5140 KB Output isn't correct
3 Incorrect 0 ms 5140 KB Output isn't correct
4 Incorrect 0 ms 5140 KB Output isn't correct
5 Incorrect 0 ms 5140 KB Output isn't correct
6 Incorrect 0 ms 5140 KB Output isn't correct
7 Incorrect 0 ms 5140 KB Output isn't correct
8 Incorrect 0 ms 5140 KB Output isn't correct
9 Incorrect 0 ms 5140 KB Output isn't correct
10 Memory limit exceeded 979 ms 524288 KB Memory limit exceeded
11 Incorrect 0 ms 5140 KB Output isn't correct
12 Incorrect 3 ms 5140 KB Output isn't correct
13 Incorrect 0 ms 5140 KB Output isn't correct
14 Incorrect 0 ms 5140 KB Output isn't correct
15 Incorrect 0 ms 5140 KB Output isn't correct
16 Incorrect 29 ms 5140 KB Output isn't correct
17 Incorrect 29 ms 5140 KB Output isn't correct
18 Incorrect 33 ms 5140 KB Output isn't correct
19 Incorrect 33 ms 5140 KB Output isn't correct
20 Execution timed out 2000 ms 524288 KB Execution timed out
21 Incorrect 139 ms 5140 KB Output isn't correct
22 Incorrect 129 ms 5140 KB Output isn't correct
23 Incorrect 139 ms 5140 KB Output isn't correct
24 Incorrect 129 ms 5140 KB Output isn't correct
25 Incorrect 136 ms 5140 KB Output isn't correct
26 Incorrect 129 ms 5140 KB Output isn't correct
27 Incorrect 143 ms 5140 KB Output isn't correct
28 Incorrect 129 ms 5140 KB Output isn't correct
29 Incorrect 123 ms 5140 KB Output isn't correct
30 Execution timed out 2000 ms 524288 KB Execution timed out
31 Memory limit exceeded 989 ms 524288 KB Memory limit exceeded
32 Memory limit exceeded 1286 ms 524288 KB Memory limit exceeded