# Why this solution passed ? [Codeforces Round #669 (Div. 2) , Problem A ]

Solution code(in short) -

``````while(t--) {
lli n;
cin>>n;
lli a[n];
scanarr(a,n);
lli cntone = 0 , cntzero= 0;
loop(i,n)
{
cntone += (a[i]==1);
cntzero += (a[i]==0);
}
if(cntone>(n/2))
{
cntone -= (cntone%2);
print(cntone);
loop(i,cntone)
cout<<1<<" ";

}
else
{
print(n/2);
loop(i,n/2)
cout<<0<<" ";
}
print("");
}
``````

on test case
1
4
0 1 1 0

It gives -

2
0 0

but isn’t this wrong , bcz in question , they said The elements that you remove don’t have to be consecutive.

@galencolin

This doesn’t mean they can’t be consecutive.

to fr likha kyu tha , very ambiguous , bcz in first attempt I thought above solution but as question says not to be consecutive then dropped this

This means they don’t necessarily have to continuous.

Google translate says a lot of other things as well
Never Trust!

2 Likes

Lol rofl lmao

Due to this , I got 2 penalty and submit after 1.5 hr , also I m pretty sure due to this the submission is only 8.5k warna 20k+ hote hai .

1 Like

It says-
`The elements that you remove don't have to be consecutive.`
It never said-
`The elements that you remove should not be consecutive.`

and the funny part is , If the above solution fails and I ask why this fails then all come and tell , ae english nhi aati kya , it is mentioned that not to be consecutive

Bro can u share resources to learn english , specially for CF problems

1 Like