답안 #39594

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
39594 2018-01-16T17:21:01 Z igzi Gap (APIO16_gap) C++11
컴파일 오류
0 ms 0 KB
#include <bits/stdc++.h>
#include "gap.h"

long long l=0,d=n-1,x=-1,y=1000000000000000005,a[100002],m=0;

long long findGap(int t,int n){
    for(int i=0;i<n;i++){
        a[i]=-5;
    }
    while(y!=-1){
        MinMax(a[l]+1,a[d]-1,&x,&y);
        a[l]=x;
        a[d]=y;
        l++; d++;
    }
    for(int i=1;i<n;i++){
        if(a[i]!=-5 && a[i-1]!=-5 && a[i]-a[i-1]>m) m=a[i]-a[i-1];
    }
    return m;
}

Compilation message

gap.cpp:4:17: error: 'n' was not declared in this scope
 long long l=0,d=n-1,x=-1,y=1000000000000000005,a[100002],m=0;
                 ^
gap.cpp: In function 'long long int findGap(int, int)':
gap.cpp:8:9: error: 'a' was not declared in this scope
         a[i]=-5;
         ^
gap.cpp:10:11: error: 'y' was not declared in this scope
     while(y!=-1){
           ^
gap.cpp:11:16: error: 'a' was not declared in this scope
         MinMax(a[l]+1,a[d]-1,&x,&y);
                ^
gap.cpp:11:31: error: 'x' was not declared in this scope
         MinMax(a[l]+1,a[d]-1,&x,&y);
                               ^
gap.cpp:17:12: error: 'a' was not declared in this scope
         if(a[i]!=-5 && a[i-1]!=-5 && a[i]-a[i-1]>m) m=a[i]-a[i-1];
            ^
gap.cpp:17:50: error: 'm' was not declared in this scope
         if(a[i]!=-5 && a[i-1]!=-5 && a[i]-a[i-1]>m) m=a[i]-a[i-1];
                                                  ^
gap.cpp:19:12: error: 'm' was not declared in this scope
     return m;
            ^