제출 #1084412

#제출 시각아이디문제언어결과실행 시간메모리
1084412MMihalevGap (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) { __int32 l=-1,r=1000000000000000001LL; __int32 rem=N; long long ans=0; while(rem>0LL) { MinMax(l+1,r-1,&mn,&mx); if(rem==2LL)ans=max(ans,mx-mn); if(l!=-1LL) { ans=max(ans,mn-l); ans=max(ans,r-mx); } if(mn!=mx)rem-=2LL; else rem--; l=mn; r=mx; } return ans; }

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

gap.cpp: In function 'long long int findGap(int, int)':
gap.cpp:8:5: error: '__int32' was not declared in this scope; did you mean '__int32_t'?
    8 |     __int32 l=-1,r=1000000000000000001LL;
      |     ^~~~~~~
      |     __int32_t
gap.cpp:9:12: error: expected ';' before 'rem'
    9 |     __int32 rem=N;
      |            ^~~~
      |            ;
gap.cpp:11:11: error: 'rem' was not declared in this scope
   11 |     while(rem>0LL)
      |           ^~~
gap.cpp:13:16: error: 'l' was not declared in this scope
   13 |         MinMax(l+1,r-1,&mn,&mx);
      |                ^
gap.cpp:13:20: error: 'r' was not declared in this scope
   13 |         MinMax(l+1,r-1,&mn,&mx);
      |                    ^