Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class BB {
- public static void main(String[] args) {
- Scanner scan = new Scanner(System.in);
- int n = scan.nextInt();
- int[] arr = new int[n];
- for(int i = 0 ; i < n ; ++i) {
- arr[i] = scan.nextInt();
- }
- for(int mask = 0 ; mask <= 1 << n ; ++mask) {
- int sum = 0;
- for(int i = 0 ; i < n ; ++i) {
- if(((mask >> i) & 1) == 0) {
- sum -= arr[i];
- }
- else sum += arr[i];
- }
- if((sum + 36000) % 360 == 0) {
- System.out.println("YES");
- return;
- }
- }
- System.out.println("NO");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement