#include <gondola.h>
#include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define mp make_pair
#define ll long long
#define itr ::iterator
typedef pair<int,int> pii;
const int MAX=5e5;
int arr[MAX],fre[MAX];
int valid(int n=5,vector<int> inputSeq={10, 4, 3, 11, 12})
{
int N=n,ok=1;
for(int A=0;A<N;A++)
{
fre[inputSeq[A]]++;
if(fre[inputSeq[A]]>1)
return 0;
}
for(int A=0;A<N;A++)
{
if(inputSeq[A]<=N)
{
ok=0;
inputSeq[A]--;
for(int B=A;B>=0;B--)
{
arr[B]=inputSeq[A];
inputSeq[A]--;
if(inputSeq[A]<0)
inputSeq[A]+=N;
}
inputSeq[A]=arr[A];
for(int B=A+1;B<N;B++)
{
inputSeq[A]++;
if(inputSeq[A]>=N)
inputSeq[A]=0;
arr[B]=inputSeq[A];
}
inputSeq[A]=arr[A]+1;
break;
}
}
if(ok)
return 1;
for(int A=0;A<N;A++)
arr[A]++;
// for(int A=0;A<N;A++)
/// cout<<arr[A]<<" ";
for(int A=0;A<N;A++)
{
// cout<<arr[A]<<" "<<inputSeq[A]<<"\n";
if(inputSeq[A]<=N and arr[A]!=inputSeq[A])
return 0;
}
return 1;
}
/*int main()
{
ios_base::sync_with_stdio(false);
cout<<"hp ";
cout<<valid()<<"\n";
return 0;
}*/
Compilation message
/tmp/ccKiU39e.o: In function `main':
grader.cpp:(.text.startup+0xc3): undefined reference to `countReplacement'
grader.cpp:(.text.startup+0xe2): undefined reference to `valid'
grader.cpp:(.text.startup+0x106): undefined reference to `replacement'
collect2: error: ld returned 1 exit status