My issue
I am not sure where my logic is going wrong but the commands written in comments is working fine
My code
#include <iostream>
using namespace std;
int main()
{
int t;
cin>>t;
while(t--)
{
int c=0,n;
cin>>n;
string a;
cin>>a;
for(int i=0;i<n;i++)
{
if(a[i]=='1')
c++;}
if((c/120)*100>=75|| ((120-n)*100)/120+c/120>=75)
//int j=120-n+c;
//float per=(j*100)/120;
// if(per>=75)
cout<<"YES"<<endl;
else
cout<<"NO"<<endl;
}
return 0;
}
Problem Link: ATTENDU Problem - CodeChef