What is wrong in my code

#include
using namespace std;

int main() {
// your code goes here
int t;
cin>>t;
while(t–){
int n,m,k,count=0;
cin>>n>>m>>k;
int arr[n];
for(int i=0;i<n;i++)
{
cin>>arr[i];
}
for(int i=0;i<n-1;i++)
{
if(arr[i]==arr[i+1] && arr[i]==1)
{
count++;
}
else
break;
}
if(count+1==n)
{
cout<<100<<endl;
}
else if(count+1>=m)
{
cout<<k<<endl;
}
else
{
cout<<0<<endl;
}

}
return 0;

}

Please either format your code or (better!) link to your submission - the forum software has mangled it and it won’t compile! :slight_smile:

Also: which Problem are you trying to solve?

Edit:

Guessing it’s this, in which case - consider the test input:

1
2 1 10
0 0
1 Like

Thanks! brother,
I have applied one more condition to get AC.

1 Like