Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CPP

Problems in your to-do list codechef solution in c++

#include<iostream>
#define ll long long
#include<vector>
#include<stack>
#include<string>
#include<algorithm>
using namespace std;

void solve()
{
	ll n;
	cin >> n;
	vector<ll> v(n);
	for (ll i = 0; i < n; i++)
	{
		cin >> v[i];
	}
	ll count = 0;
	for (ll i = 0; i < n; i++)
	{
		if (v[i] >= 1000)
			count++;
	}
	cout << count << "
";
}

int main()
{
	int t;
	cin >> t;
	while (t--)
	{
		solve();
	}
	return 0;
}
Source by www.codegrepper.com #
 
PREVIOUS NEXT
Tagged: #Problems #list #codechef #solution
ADD COMMENT
Topic
Name
2+6 =