My issue
include <bits/stdc++.h>
using namespace std;
int main() {
// your code goes here
int t;
cin>>t;
while(t–)
{
long long int n,p;
cin>>n>>p;
long long int a[1000];
int count=0,i;
for( i=0;i<n;i++)
{
cin>>a[i];
if(a[i]>=p)
{
count += 1;
}
}
cout<<count<<endl;
}
return 0;
}
My code
#include <bits/stdc++.h>
using namespace std;
int main() {
// your code goes here
int t;
cin>>t;
while(t--)
{
long long int n,p;
cin>>n>>p;
long long int a[1000];
int count=0,i;
for( i=0;i<n;i++)
{
cin>>a[i];
if(a[i]>=p)
{
count += 1;
}
}
cout<<count<<endl;
}
return 0;
}
Problem Link: Mangalyaan-2 Practice Coding Problem - CodeChef