Submission #242056

#TimeUsernameProblemLanguageResultExecution timeMemory
242056michaoGap (APIO16_gap)C++14
Compilation error
0 ms0 KiB
#include <bits/stdc++.h>
#include "gap.h"
#define int long long
#define vi vector<int>
#define pb push_back
#define sz(x) (int)x.size()
const int inf=1e18*2;
using namespace std;
vector<ll> 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:9:8: error: 'll' was not declared in this scope
 vector<ll> answer,pom;
        ^~
gap.cpp:9:10: error: template argument 1 is invalid
 vector<ll> answer,pom;
          ^
gap.cpp:9:10: error: template argument 2 is invalid
gap.cpp: In function 'long long int findGap(long long int, long long int)':
gap.cpp:6:22: error: request for member 'size' in 'answer', which is of non-class type 'int'
 #define sz(x) (int)x.size()
                      ^
gap.cpp:18:10: note: in expansion of macro 'sz'
   while (sz(answer)+sz(pom)<n)
          ^~
gap.cpp:6:22: error: request for member 'size' in 'pom', which is of non-class type 'int'
 #define sz(x) (int)x.size()
                      ^
gap.cpp:18:21: note: in expansion of macro 'sz'
   while (sz(answer)+sz(pom)<n)
                     ^~
gap.cpp:5:12: error: request for member 'push_back' in 'answer', which is of non-class type 'int'
 #define pb push_back
            ^
gap.cpp:22:11: note: in expansion of macro 'pb'
    answer.pb(ip);
           ^~
gap.cpp:5:12: error: request for member 'push_back' in 'pom', which is of non-class type 'int'
 #define pb push_back
            ^
gap.cpp:23:8: note: in expansion of macro 'pb'
    pom.pb(ik);
        ^~
gap.cpp:6:22: error: request for member 'size' in 'pom', which is of non-class type 'int'
 #define sz(x) (int)x.size()
                      ^
gap.cpp:30:9: note: in expansion of macro 'sz'
  while (sz(pom)>0)answer.pb(pom.back()),pom.pop_back();
         ^~
gap.cpp:5:12: error: request for member 'push_back' in 'answer', which is of non-class type 'int'
 #define pb push_back
            ^
gap.cpp:30:26: note: in expansion of macro 'pb'
  while (sz(pom)>0)answer.pb(pom.back()),pom.pop_back();
                          ^~
gap.cpp:30:33: error: request for member 'back' in 'pom', which is of non-class type 'int'
  while (sz(pom)>0)answer.pb(pom.back()),pom.pop_back();
                                 ^~~~
gap.cpp:30:45: error: request for member 'pop_back' in 'pom', which is of non-class type 'int'
  while (sz(pom)>0)answer.pb(pom.back()),pom.pop_back();
                                             ^~~~~~~~
gap.cpp:6:22: error: request for member 'size' in 'answer', which is of non-class type 'int'
 #define sz(x) (int)x.size()
                      ^
gap.cpp:31:17: note: in expansion of macro 'sz'
  for (int i=0;i<sz(answer)-1;i++)ans=max(ans,answer[i+1]-answer[i]);
                 ^~
gap.cpp:31:56: error: invalid types 'int[long long int]' for array subscript
  for (int i=0;i<sz(answer)-1;i++)ans=max(ans,answer[i+1]-answer[i]);
                                                        ^
gap.cpp:31:66: error: invalid types 'int[long long int]' for array subscript
  for (int i=0;i<sz(answer)-1;i++)ans=max(ans,answer[i+1]-answer[i]);
                                                                  ^