답안 #38829

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
38829 2018-01-07T04:52:10 Z adamczh1 곤돌라 (IOI14_gondola) C++14
컴파일 오류
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;
         ^