답안 #138564

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
138564 2019-07-30T06:59:19 Z Mahmoud_Adel 곤돌라 (IOI14_gondola) C++14
컴파일 오류
0 ms 0 KB
#include "gondola.h"
#include <bits/stdc++.h>
const int N = 1e6+5;
int valid(int n, int inputSeq[])
{
	memset(mark, 0, sizeof mark);
	for(int i=0; i<n; i++)
	{
		if(mark[inputSeq[i]]) return 0;
		mark[inputSeq[i]] = 1;
	}
	int j = -1;
	for(int i=0; i<n; i++) if(inputSeq[i] > 0 && inputSeq[i] <= n) j = i;
	id(j == -1) return 1;
	for(int i=0; i<n; i++)
	{
		int id = (i+j)%n, jd = (i+j+1)%n;
		if(inputSeq[jd] > n) inputSeq[jd] = inputSeq[id]%n + 1;
		if(inputSeq[jd] != inputSeq[id]%n + 1) return 0;
	}
	return 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:9: error: 'mark' was not declared in this scope
  memset(mark, 0, sizeof mark);
         ^~~~
gondola.cpp:14:2: error: 'id' was not declared in this scope
  id(j == -1) return 1;
  ^~