Chef in Fantasy League | CodeChef

whats wrong with this code
its getting write output
but when submitted its showing wrong answer

#include <stdio.h>
#include <stdlib.h>
int it,i,j,k,p[20],c[20],in,is,iv=0;
int main(void)
{
// printf(“no. of testcases: “);
scanf(”%d”,&it);
for(i=0;i<it;i++)
{
// printf(“enter no. of player available and total money used:\n”);
scanf(“%d%d”,&in,&is);
// printf(“enter the price of players:\n”);
for(j=0;j<in;j++)
{
scanf(“%d”,&p[j]);
}
// printf(“enter 0(defender) and 1(forward):\n”);
for(j=0;j<in;j++)
{
scanf(“%d”,&c[j]);
}
for(j=0;j<in;j++)
{
for(k=j+1;k<in;k++)
{
if(c[j]==0)
{
if(c[k]==1)
{
if(p[j]+p[k]<=(100-is))
{
iv=1;
break;
}
}
}
else
{
if(c[k]==0)
{
if(p[j]+p[k]<=(100-is))
{
iv=1;
break;
}
}
}
}
}
if(iv==1)
{
printf(“yes”);
}
else
{
printf(“no”);
}
printf(“\n”);
iv=0;
}
return 0;

}

Please try to provide the link to the solution.
Simply copy pasting the code makes it very messy.

this is the link of my solution:

https://www.codechef.com/viewsolution/32332385

You are missing the case when there will be no defender or no forward player and your code runs in O(n^2) though it is not an issue here try to solve this question in O(n).

Thanks man now it got submitted successfully