Submission #744464

# Submission time Handle Problem Language Result Execution time Memory
744464 2023-05-18T15:18:10 Z MODDI Gondola (IOI14_gondola) C++14
Compilation error
0 ms 0 KB
#include "gondola.h"

int valid(int n, int inputSeq[])
{
  return -1;
}

//----------------------

int replacement(int n, int gondolaSeq[], int replacementSeq[])
{
	vi initial(n), replace;
	for(int i = 0; i < n; i++){
		initial[i] = gondolaSeq[i];
	}
	sort(initial.begin(), initial.end());
	int j = 1;
	for(int i = 0; i < n; i++){
		if(initial[i]==j){
			j++;
			continue;
		}
		else{
			replace.pb(j);
			j++;
		}
	}
	int l = replace.size();
	for(int i = 0; i < l; i++)
		replacementSeq[i] = replace[i];
		
	return l;
}

//----------------------

int countReplacement(int n, int inputSeq[])
{
  return -3;
}

Compilation message

gondola.cpp: In function 'int replacement(int, int*, int*)':
gondola.cpp:12:2: error: 'vi' was not declared in this scope
   12 |  vi initial(n), replace;
      |  ^~
gondola.cpp:14:3: error: 'initial' was not declared in this scope
   14 |   initial[i] = gondolaSeq[i];
      |   ^~~~~~~
gondola.cpp:16:7: error: 'initial' was not declared in this scope
   16 |  sort(initial.begin(), initial.end());
      |       ^~~~~~~
gondola.cpp:16:2: error: 'sort' was not declared in this scope; did you mean 'short'?
   16 |  sort(initial.begin(), initial.end());
      |  ^~~~
      |  short
gondola.cpp:24:4: error: 'replace' was not declared in this scope; did you mean 'replacement'?
   24 |    replace.pb(j);
      |    ^~~~~~~
      |    replacement
gondola.cpp:28:10: error: 'replace' was not declared in this scope; did you mean 'replacement'?
   28 |  int l = replace.size();
      |          ^~~~~~~
      |          replacement