Submission #38829

# Submission time Handle Problem Language Result Execution time Memory
38829 2018-01-07T04:52:10 Z adamczh1 Gondola (IOI14_gondola) C++14
Compilation error
0 ms 0 KB
#include "gondola.h"
#include <bits/stdc++.h>

int valid(int n, int inputSeq[])
{
	set<int> s;
	for(int i=0;i<n;i++){
		if(inputSeq[i]<=n){
			s.insert((i-inputSeq[i]+n)%n);
		}
	}
	return s.size()==1;
}

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

int replacement(int n, int gondolaSeq[], int replacementSeq[])
{
	return -2;
}

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

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

Compilation message

gondola.cpp: In function 'int valid(int, int*)':
gondola.cpp:6:2: error: 'set' was not declared in this scope
  set<int> s;
  ^
gondola.cpp:6:2: note: suggested alternative:
In file included from /usr/include/c++/5/set:61:0,
                 from /usr/include/x86_64-linux-gnu/c++/5/bits/stdc++.h:86,
                 from gondola.cpp:2:
/usr/include/c++/5/bits/stl_set.h:90:11: note:   'std::set'
     class set
           ^
gondola.cpp:6:6: error: expected primary-expression before 'int'
  set<int> s;
      ^
gondola.cpp:9:4: error: 's' was not declared in this scope
    s.insert((i-inputSeq[i]+n)%n);
    ^
gondola.cpp:12:9: error: 's' was not declared in this scope
  return s.size()==1;
         ^