Submission #138581

# Submission time Handle Problem Language Result Execution time Memory
138581 2019-07-30T07:10:17 Z MohamedAhmed04 Gondola (IOI14_gondola) C++14
Compilation error
0 ms 0 KB
#include "gondola.h"
#include <bits/stdc++.h>
#include "grader.cpp"
using namespace std ;

int valid(int n, int arr[])
{
	int st = -1 ;
	for(int i = 0 ; i < n ; ++i)
	{
		if(arr[i] <= n)
		{
			st = i ;
			break ;
		}
	}
	if(st == -1)
		return 1 ;
	int idx = st , cnt = 0;
	while(true)
	{
		idx++ ;
		idx %= n ;
		cnt++ ;
		if(idx == st)
			break ;
		if(arr[idx] <= n)
			continue ;
		arr[idx] = (arr[st] + cnt) % n ;
		if(arr[idx] == 0)
			arr[idx] = n ;
	}
	idx = st , cnt = 0 ;
	while(true)
	{
		idx++ ;
		idx %= n ;
		cnt++ ;
		if(idx == st)
			break ;
		int x = (arr[st] + cnt) % n ;
		if(x == 0)
			x = n ;
		if(x != arr[idx] && arr[idx] <= n)
			return 0 ;
	}
    return 1;
}

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

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

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

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

Compilation message

/tmp/ccbOa4Xu.o: In function `main':
grader.cpp:(.text.startup+0x0): multiple definition of `main'
/tmp/ccfdlJCJ.o:gondola.cpp:(.text.startup+0x0): first defined here
/tmp/ccbOa4Xu.o:(.bss+0xf4260): multiple definition of `gondolaSequence'
/tmp/ccfdlJCJ.o:(.bss+0xf4260): first defined here
/tmp/ccbOa4Xu.o:(.bss+0x0): multiple definition of `replacementSequence'
/tmp/ccfdlJCJ.o:(.bss+0x0): first defined here
collect2: error: ld returned 1 exit status