Submission #62566

# Submission time Handle Problem Language Result Execution time Memory
62566 2018-07-29T06:18:19 Z zetapi Crayfish scrivener (IOI12_scrivener) C++14
Compilation error
0 ms 0 KB

const int MAX=1e6+99;

char X[MAX];

int ind,tot,arr[MAX],height[MAX],Parent[MAX][22];

Init()
{
  
}

void TypeLetter(char L) 
{
	X[++ind]=L;
	Parent[ind][0]=arr[tot++];
	height[ind]=height[Parent[ind][0]]+1;
	for(int A=1;A<21;A++)
		Parent[ind][A]=Parent[Parent[ind][A-1]][A-1];
	arr[tot]=ind;
	return ;
}

void UndoCommands(int U) 
{
    ++tot;
	arr[tot]=arr[tot-U-1];
	return ;
}

char GetLetter(int P) 
{
	int res=arr[tot];
	for(int A=20;A>=0;A--)
	{
		if(height[Parent[res][A]]>P)
			res=Parent[res][A];
	}
	return X[res];
}

Compilation message

scrivener.cpp:9:6: error: ISO C++ forbids declaration of 'Init' with no type [-fpermissive]
 Init()
      ^
scrivener.cpp: In function 'int Init()':
scrivener.cpp:12:1: warning: no return statement in function returning non-void [-Wreturn-type]
 }
 ^