답안 #38743

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
38743 2018-01-06T11:42:33 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;

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 (mi1==-1 && mi2==-1) {
        ans=max(ans,R-L);
        return;
    }
    if (mi1==-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)
{
    long long Mn,Mx;
    long long S=0;
    long long TT=1000000000000000000;
    MinMax(S,TT,&Mn,&Mx);
    ans=0;
    func (Mn,Mx);
    return ans;
}
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 5140 KB Output isn't 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 29 ms 5140 KB Output isn't correct
17 Incorrect 33 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 133 ms 5140 KB Output isn't correct
22 Incorrect 126 ms 5140 KB Output isn't correct
23 Incorrect 133 ms 5140 KB Output isn't correct
24 Incorrect 129 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 146 ms 5140 KB Output isn't correct
28 Incorrect 126 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 999 ms 524288 KB Memory limit exceeded
32 Memory limit exceeded 1183 ms 524288 KB Memory limit exceeded
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 5140 KB Output isn't 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 993 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 33 ms 5140 KB Output isn't correct
17 Incorrect 33 ms 5140 KB Output isn't correct
18 Incorrect 29 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 136 ms 5140 KB Output isn't correct
22 Incorrect 116 ms 5140 KB Output isn't correct
23 Incorrect 129 ms 5140 KB Output isn't correct
24 Incorrect 123 ms 5140 KB Output isn't correct
25 Incorrect 133 ms 5140 KB Output isn't correct
26 Incorrect 146 ms 5140 KB Output isn't correct
27 Incorrect 126 ms 5140 KB Output isn't correct
28 Incorrect 136 ms 5140 KB Output isn't correct
29 Incorrect 133 ms 5140 KB Output isn't correct
30 Execution timed out 2000 ms 506044 KB Execution timed out
31 Memory limit exceeded 1083 ms 524288 KB Memory limit exceeded
32 Memory limit exceeded 1179 ms 524288 KB Memory limit exceeded