제출 #242069

#제출 시각아이디문제언어결과실행 시간메모리
242069michaoGap (APIO16_gap)C++14
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h> #include "gap.h" using namespace std; typedef long long ll; #define pb push_back int n; ll mini,maxi; vector<ll>pom,answer; long long findGap(int t, int N) { n=N; ll ans=0; ll ip=-1,ik=1e19; if (t==1) { while ((int)answer.size()+(int)pom.size()<n) { ip++,ik--; MinMax(ip,ik,&ip,&ik); answer.pb(ip); pom.pb(ik); } } else { MinMax(ip,ik,&ip,&ik); answer.pb(l),pom.pb(ik); ll gap=(ik-ip+1)/n+1; for (ll i=ip;i+1<ik;i+=gap) { ll news=min(ik-1,i+gap); MinMax(i+1,news,&mini,&maxi); if (mini!=-1)answer.pb(mini); if (maxi!=-1)answer.pb(maxi); } } while ((int)pom.size()>0)answer.pb(pom.back()),pom.pop_back(); for (int i=0;i<(int)answer.size()-1;i++)ans=max(ans,answer[i+1]-answer[i]); return ans; }

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

gap.cpp: In function 'long long int findGap(int, int)':
gap.cpp:13:14: warning: overflow in implicit constant conversion [-Woverflow]
  ll ip=-1,ik=1e19;
              ^~~~
gap.cpp:27:13: error: 'l' was not declared in this scope
   answer.pb(l),pom.pb(ik);
             ^