- 0
Notifications Mark All Read
- Login
- Get Prime
Problem 51
Access Denied!
To view this page you have to login first
Login here -
Trivia
Did you know 1 million people use PrepInsta everyday?
Notifications Mark All Read
To view this page you have to login first
Login here -
Did you know 1 million people use PrepInsta everyday?
#include
void swap(int *a,int *b)
{
int temp=*a;
*a=*b;
*b=temp;
}
int main()
{
int m;
scanf(“%d”,&m);
while(m!=0)
{
int n,j,i,count=0;
scanf(“%d”,&n);
int arr[n],freq[3];
for(i=0;i<n;i++)
scanf("%d",&arr[i]);
for(i=0;i<n;i++)
{
for(j=0;jarr[j+1])
{
swap(&arr[j],&arr[j+1]);
count++;
}
}
}
if(count%2==0)
printf(“Yes\n”);
else
printf(“No\n”);
m–;
}
return 0;
}