Skip to content

Instantly share code, notes, and snippets.

@omerjerk
Created January 2, 2015 17:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save omerjerk/0676b682cfb3ec6c28d2 to your computer and use it in GitHub Desktop.
Save omerjerk/0676b682cfb3ec6c28d2 to your computer and use it in GitHub Desktop.
int T;
T = s_d();
while (T--) {
int N;
N = s_d();
int a[N];
llu sum = 0;
bool flag = false;
for (int i = 0; i < N; ++i) {
a[i] = s_d();
if (a[i] > 100) {
flag = true;
}
sum += a[i];
}
if (sum < 100 || flag) {
cout<<"NO"<<endl;
} else if (sum >= 100 && sum < (100 + N)) {
cout<<"YES"<<endl;
} else {
cout<<"NO"<<endl;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment