Submission #242052

#TimeUsernameProblemLanguageResultExecution timeMemory
242052michaoGap (APIO16_gap)C++14
Compilation error
0 ms0 KiB
#include <bits/stdc++.h>
#include "gap.h"
#define pb push_back
#define sz(x) (int)x.size()
#define int long long
const int inf=1e18*2;
using namespace std;
vi answer,pom;
int n;
long long findGap(int t,int N)
{
	n=N;
	int ans=0;
	int ip=-1,ik=inf;
	if (t==1)
	{
		while (sz(answer)+sz(pom)<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;
}

Compilation message (stderr)

gap.cpp:8:1: error: 'vi' does not name a type
 vi answer,pom;
 ^~
gap.cpp: In function 'long long int findGap(long long int, long long int)':
gap.cpp:17:13: error: 'answer' was not declared in this scope
   while (sz(answer)+sz(pom)<n)
             ^
gap.cpp:4:20: note: in definition of macro 'sz'
 #define sz(x) (int)x.size()
                    ^
gap.cpp:17:13: note: suggested alternative: 'ans'
   while (sz(answer)+sz(pom)<n)
             ^
gap.cpp:4:20: note: in definition of macro 'sz'
 #define sz(x) (int)x.size()
                    ^
gap.cpp:17:24: error: 'pom' was not declared in this scope
   while (sz(answer)+sz(pom)<n)
                        ^
gap.cpp:4:20: note: in definition of macro 'sz'
 #define sz(x) (int)x.size()
                    ^
gap.cpp:17:24: note: suggested alternative: 'pow'
   while (sz(answer)+sz(pom)<n)
                        ^
gap.cpp:4:20: note: in definition of macro 'sz'
 #define sz(x) (int)x.size()
                    ^
gap.cpp:29:12: error: 'pom' was not declared in this scope
  while (sz(pom)>0)answer.pb(pom.back()),pom.pop_back();
            ^
gap.cpp:4:20: note: in definition of macro 'sz'
 #define sz(x) (int)x.size()
                    ^
gap.cpp:29:12: note: suggested alternative: 'pow'
  while (sz(pom)>0)answer.pb(pom.back()),pom.pop_back();
            ^
gap.cpp:4:20: note: in definition of macro 'sz'
 #define sz(x) (int)x.size()
                    ^
gap.cpp:29:19: error: 'answer' was not declared in this scope
  while (sz(pom)>0)answer.pb(pom.back()),pom.pop_back();
                   ^~~~~~
gap.cpp:29:19: note: suggested alternative: 'ans'
  while (sz(pom)>0)answer.pb(pom.back()),pom.pop_back();
                   ^~~~~~
                   ans
gap.cpp:30:20: error: 'answer' was not declared in this scope
  for (int i=0;i<sz(answer)-1;i++)ans=max(ans,answer[i+1]-answer[i]);
                    ^
gap.cpp:4:20: note: in definition of macro 'sz'
 #define sz(x) (int)x.size()
                    ^
gap.cpp:30:20: note: suggested alternative: 'ans'
  for (int i=0;i<sz(answer)-1;i++)ans=max(ans,answer[i+1]-answer[i]);
                    ^
gap.cpp:4:20: note: in definition of macro 'sz'
 #define sz(x) (int)x.size()
                    ^