제출 #242040

#제출 시각아이디문제언어결과실행 시간메모리
242040michaoGap (APIO16_gap)C++14
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h> #include "gap.h" #define int long long #define mp make_pair #define pb push_back #define ld long double #define pii pair<int,int> #define sz(x) (int)x.size() #define piii pair<pii,pii> #define precise cout<<fixed<<setprecision(10) #define st first #define nd second #define ins insert #define vi vector<int> #define BOOST ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0) using namespace std; const int inf=1e18*2; vi answer,pom; int find_gap(int t,int n) { int ans=0; int ip=-1,ik=inf; if (t==1) { while (sz(x)+sz(y)<n) { ip++,ik--; MinMax(ip,ik,&ip,&ik); answer.pb(ip); pom.pb(ik); } } else { assert(false); } while (sz(pom)>0)answer.pb(pom.back()),pom.pop_back(); for (int i=0;i<sz(answer)-1;i++)ans=max(ans,answer[i+1]-answer[i]); return ans; }

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

gap.cpp: In function 'long long int find_gap(long long int, long long int)':
gap.cpp:25:13: error: 'x' was not declared in this scope
   while (sz(x)+sz(y)<n)
             ^
gap.cpp:8:20: note: in definition of macro 'sz'
 #define sz(x) (int)x.size()
                    ^
gap.cpp:25:19: error: 'y' was not declared in this scope
   while (sz(x)+sz(y)<n)
                   ^
gap.cpp:8:20: note: in definition of macro 'sz'
 #define sz(x) (int)x.size()
                    ^