№ |
Отправитель |
Задача |
Язык |
Вердикт |
Время |
Память |
Отослано |
Протест. |
|
120364190 |
Дорешивание:
codedsun |
433A
- 8
|
Java 8
|
Полное решение
|
140 мс
|
0 КБ
|
2021-06-23 14:59:40 |
2021-06-23 14:59:41 |
|
import java.util.Scanner;
public class Problem433A {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int hundred = 0;
int two = 0;int a;
while(n-->=1){
a = sc.nextInt();
if(a == 100){
hundred++;
}else{
two++;
}
}
//
if(hundred%2 == 0 && two % 2 ==0){
System.out.println("YES");
}else {
//odd odd
if(hundred%2!=0 && two%2 !=0) {
System.out.println("NO");
}else if(hundred%2 != 0) {
//100 odd 200even
System.out.println("NO");
}else {
//100 even 200 odd
if(hundred!=0 && two!=0 &&Math.abs(hundred-two)%2==1){
System.out.println("YES");
}else{
System.out.println("NO");
}
}
}
}
}
Время: ? ms, память: ? КБ