제출 #1227831

#제출 시각아이디문제언어결과실행 시간메모리
1227831PlayVoltz곤돌라 (IOI14_gondola)C++20
컴파일 에러
0 ms0 KiB
#include "gondola.h"
#include <bits/stdc++.h>
using namespace std;

int ooga[100005];

void init(int n, int vect[]){
	int a=0;
	for (int i=0; i<n; ++i)if (vect[i]<=n){
		a=(vect[i]-1-i+n)%n;
		break;
	}
	for (int i=0; i<n; ++i)ooga[(i+a)%n]=vect[i];
	for (int i=0; i<n; ++i)vect[i]=ooga[i];
}

int valid(int n, int vect[]){
	set<int> s;
	for (int i=0; i<n; ++i)s.insert(vect[i]);
	if (a.size()!=n)return 0;
	init(n, vect);
	for (int i=0; i<n; ++i)if (vect[i]<n&&vect[i]-1!=i)return 0;
	return 1;
}

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

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

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

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

컴파일 시 표준 에러 (stderr) 메시지

gondola.cpp: In function 'int valid(int, int*)':
gondola.cpp:20:13: error: 'a' was not declared in this scope
   20 |         if (a.size()!=n)return 0;
      |             ^