제출 #370651

#제출 시각아이디문제언어결과실행 시간메모리
370651Bill_00Gap (APIO16_gap)C++14
컴파일 에러
0 ms0 KiB
#include "gap.h"
#include <bits/stdc++.h>
#define N 100005
using namespace std;
ll a[N];
long long findGap(int T, int n)
{
	ll m1=0,m2=1e18,ans=0;
	if(T==1){
		for(int i=1;i<=(n+1)/2;i++){
			MinMax(m1,m2,&mn,&mx);
			a[i]=mn;
			a[n+1-i]=mx;
			m1=mn+1;
			m2=mx-1;
		}
		for(int i=1;i<n;i++){
			ans=max(ans,a[i+1]-a[i]);
		}
		return ans;
	}
	return 0;
}

컴파일 시 표준 에러 (stderr) 메시지

gap.cpp:5:1: error: 'll' does not name a type
    5 | ll a[N];
      | ^~
gap.cpp: In function 'long long int findGap(int, int)':
gap.cpp:8:2: error: 'll' was not declared in this scope
    8 |  ll m1=0,m2=1e18,ans=0;
      |  ^~
gap.cpp:11:11: error: 'm1' was not declared in this scope; did you mean 'y1'?
   11 |    MinMax(m1,m2,&mn,&mx);
      |           ^~
      |           y1
gap.cpp:11:14: error: 'm2' was not declared in this scope
   11 |    MinMax(m1,m2,&mn,&mx);
      |              ^~
gap.cpp:11:18: error: 'mn' was not declared in this scope; did you mean 'n'?
   11 |    MinMax(m1,m2,&mn,&mx);
      |                  ^~
      |                  n
gap.cpp:11:22: error: 'mx' was not declared in this scope
   11 |    MinMax(m1,m2,&mn,&mx);
      |                      ^~
gap.cpp:12:4: error: 'a' was not declared in this scope
   12 |    a[i]=mn;
      |    ^
gap.cpp:18:4: error: 'ans' was not declared in this scope; did you mean 'abs'?
   18 |    ans=max(ans,a[i+1]-a[i]);
      |    ^~~
      |    abs
gap.cpp:18:16: error: 'a' was not declared in this scope
   18 |    ans=max(ans,a[i+1]-a[i]);
      |                ^
gap.cpp:20:10: error: 'ans' was not declared in this scope; did you mean 'abs'?
   20 |   return ans;
      |          ^~~
      |          abs