제출 #1084418

#제출 시각아이디문제언어결과실행 시간메모리
1084418MMihalevGap (APIO16_gap)C++14
컴파일 에러
0 ms0 KiB
#include<iostream>
#include<algorithm>
#include "gap.h"
using namespace std;
long long mn,mx;
long long findGap(int T, int N)
{
    long long l=-1,r=1000000000000000001LL;
    int rem=N;
    __int64 ans=1;
    while(rem>0)
    {
        MinMax(l+1,r-1,&mn,&mx);
        if(rem==2)ans=max(ans,mx-mn);
        if(l!=-1)
        {
            ans=max(ans,mn-l);
            ans=max(ans,r-mx);
        }
        if(mn!=mx)rem-=2;
        else rem--;
        l=mn;
        r=mx;
    }
    return ans;
}

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

gap.cpp: In function 'long long int findGap(int, int)':
gap.cpp:10:5: error: '__int64' was not declared in this scope; did you mean '__int64_t'?
   10 |     __int64 ans=1;
      |     ^~~~~~~
      |     __int64_t
gap.cpp:14:19: error: 'ans' was not declared in this scope; did you mean 'abs'?
   14 |         if(rem==2)ans=max(ans,mx-mn);
      |                   ^~~
      |                   abs
gap.cpp:17:13: error: 'ans' was not declared in this scope; did you mean 'abs'?
   17 |             ans=max(ans,mn-l);
      |             ^~~
      |             abs
gap.cpp:25:12: error: 'ans' was not declared in this scope; did you mean 'abs'?
   25 |     return ans;
      |            ^~~
      |            abs