#include
using namespace std;
int main() {
int b=0,k=0, t=0,p=0,f=0;
int a[t];
cin>>b;
cin>>t;
for(int i=0; i<=t;i++)
cin>>a[i];
for(int i=0;i<=t;i++)
{
for(int j=0;j<=t;j++)
{ if(a[i]==a[j])
{ p++; f=1;}
else
a[i]+=(i+1);
k++; }
if(f==1);
break;
}
if(k==0)
cout<<"0";
else
cout<<p+1;
return 0;
}
Can anyone point me out on how i can correct thi to get required output.