답안 #76383

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
76383 2018-09-13T09:01:33 Z vex Gap (APIO16_gap) C++14
30 / 100
61 ms 2172 KB
#include <bits/stdc++.h>
#include<gap.h>
#define maxn 100005
#define INF 1e18 + 1000
using namespace std;

int n;
long long a[maxn];

long long findGap(int t,int n)
{
    if(t==1)
    {
        int br=1;
        long long mn,mx;
        a[0]=0;
        a[n+1]=INF;
        while(br<=(n+1)/2)
        {
            MinMax(a[br-1]+1,a[n+2-br]-1,&mn,&mx);
            a[br]=mn;
            a[n+1-br]=mx;
            br++;
        }
        
        long long sol=0;
        for(int i=1;i<n;i++)
        {
            if(a[i+1]-a[i]>sol)sol=a[i+1]-a[i];
        }
        return sol;
    }
    
    long long mn,mx;
    int exp=INF/(n-1);
    long long last=0;
    long long sol=0;
    
    int d=0;
    while(d<INF)
    {
        MinMax(d+1,d+exp,&mn,&mx);
        if(mn!=-1)
        {
            if(mn-last>sol)sol=mn-last;
            last=mx;
        }
        d+=exp;
    }
    
    return sol;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 376 KB Output is correct
2 Correct 2 ms 476 KB Output is correct
3 Correct 2 ms 476 KB Output is correct
4 Correct 2 ms 476 KB Output is correct
5 Correct 2 ms 476 KB Output is correct
6 Correct 2 ms 520 KB Output is correct
7 Correct 2 ms 592 KB Output is correct
8 Correct 2 ms 592 KB Output is correct
9 Correct 2 ms 620 KB Output is correct
10 Correct 2 ms 728 KB Output is correct
11 Correct 3 ms 728 KB Output is correct
12 Correct 3 ms 728 KB Output is correct
13 Correct 3 ms 728 KB Output is correct
14 Correct 3 ms 728 KB Output is correct
15 Correct 3 ms 728 KB Output is correct
16 Correct 15 ms 1080 KB Output is correct
17 Correct 15 ms 1080 KB Output is correct
18 Correct 16 ms 1080 KB Output is correct
19 Correct 16 ms 1080 KB Output is correct
20 Correct 12 ms 1080 KB Output is correct
21 Correct 58 ms 2172 KB Output is correct
22 Correct 59 ms 2172 KB Output is correct
23 Correct 61 ms 2172 KB Output is correct
24 Correct 61 ms 2172 KB Output is correct
25 Correct 51 ms 2172 KB Output is correct
26 Correct 59 ms 2172 KB Output is correct
27 Correct 58 ms 2172 KB Output is correct
28 Correct 59 ms 2172 KB Output is correct
29 Correct 61 ms 2172 KB Output is correct
30 Correct 45 ms 2172 KB Output is correct
31 Correct 2 ms 2172 KB Output is correct
32 Correct 2 ms 2172 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Runtime error 2 ms 2172 KB Execution failed because the return code was nonzero
2 Runtime error 2 ms 2172 KB Execution failed because the return code was nonzero
3 Runtime error 2 ms 2172 KB Execution failed because the return code was nonzero
4 Runtime error 2 ms 2172 KB Execution failed because the return code was nonzero
5 Runtime error 2 ms 2172 KB Execution failed because the return code was nonzero
6 Runtime error 2 ms 2172 KB Execution failed because the return code was nonzero
7 Runtime error 2 ms 2172 KB Execution failed because the return code was nonzero
8 Runtime error 2 ms 2172 KB Execution failed because the return code was nonzero
9 Runtime error 3 ms 2172 KB Execution failed because the return code was nonzero
10 Runtime error 2 ms 2172 KB Execution failed because the return code was nonzero
11 Runtime error 2 ms 2172 KB Execution failed because the return code was nonzero
12 Runtime error 2 ms 2172 KB Execution failed because the return code was nonzero
13 Runtime error 2 ms 2172 KB Execution failed because the return code was nonzero
14 Runtime error 2 ms 2172 KB Execution failed because the return code was nonzero
15 Runtime error 2 ms 2172 KB Execution failed because the return code was nonzero
16 Runtime error 9 ms 2172 KB Execution failed because the return code was nonzero
17 Runtime error 9 ms 2172 KB Execution failed because the return code was nonzero
18 Runtime error 9 ms 2172 KB Execution failed because the return code was nonzero
19 Runtime error 10 ms 2172 KB Execution failed because the return code was nonzero
20 Runtime error 5 ms 2172 KB Execution failed because the return code was nonzero
21 Runtime error 31 ms 2172 KB Execution failed because the return code was nonzero
22 Runtime error 30 ms 2172 KB Execution failed because the return code was nonzero
23 Runtime error 31 ms 2172 KB Execution failed because the return code was nonzero
24 Runtime error 32 ms 2172 KB Execution failed because the return code was nonzero
25 Runtime error 21 ms 2172 KB Execution failed because the return code was nonzero
26 Runtime error 30 ms 2172 KB Execution failed because the return code was nonzero
27 Runtime error 44 ms 2172 KB Execution failed because the return code was nonzero
28 Runtime error 48 ms 2172 KB Execution failed because the return code was nonzero
29 Runtime error 29 ms 2172 KB Execution failed because the return code was nonzero
30 Runtime error 18 ms 2172 KB Execution failed because the return code was nonzero
31 Runtime error 2 ms 2172 KB Execution failed because the return code was nonzero
32 Runtime error 2 ms 2172 KB Execution failed because the return code was nonzero