qqqer's blog

By qqqer, history, 4 years ago, In Russian

1436A - Перестановка

#include <iostream>
#include <vector>
#include <string>

using namespace std;

int t, a, m;
vector<string> v;

void test()
{
	cin >> n >> m;
	
	while(n--)
	{
		cin >> a;
		s += a;
	}
	
	if(s == m)
		v.push_back("YES");
	else
		v.push_back("NO")
}

void result()
{
	for (int i = 0; i < v.size(); i++)
		cout << v[i] << '\n';
}

int main()
{
	cin >> t;
	
	while(t--)
	{
		test();
	}
	
	result();
	
	return 0;	
}

  • Vote: I like it
  • +1
  • Vote: I do not like it