← Back to List

15780번: 멀티탭 충분하니? ↗

Solutions

C++14
242 B | 242 chars
#include <iostream>
using namespace std;
int N,K,S;
int ar[110];
int main()
{
	cin>>N>>K;
	for(int x=0 ;x<K; x++) cin>>ar[x];
	for(int x=0; x<K; x++)
	{
		S+=ar[x]/2;
		if(ar[x]%2!=0) S++;
	}
	if(S>=N)
	{
		cout<<"YES";
	}
	else cout<<"NO";
}