Submission #1532344


Source Code Expand

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {

    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int n = Integer.parseInt(br.readLine());
        String[] str = br.readLine().split(" ");

        int[] cnt = new int[3];
        for (int i = 0; i < n; i++) {
            long num = Long.parseLong(str[i]);
            if (num % 2 == 0) {
                if (num % 4 == 0) {
                    cnt[2]++;
                } else {
                    cnt[1]++;
                }
            } else {
                cnt[0]++;
            }
        }

        if (cnt[1] > 0) {
            cnt[0]++;
        }

        if (cnt[0] <= cnt[2] + 1) {
            System.out.println("Yes");
        } else {
            System.out.println("No");
        }
    }
}

Submission Info

Submission Time
Task C - 4-adjacent
User kengo0o0
Language Java8 (OpenJDK 1.8.0)
Score 400
Code Size 963 Byte
Status AC
Exec Time 180 ms
Memory 37716 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 400 / 400
Status
AC × 5
AC × 19
Set Name Test Cases
Sample 0_00.txt, 0_01.txt, 0_02.txt, 0_03.txt, 0_04.txt
All 0_00.txt, 0_01.txt, 0_02.txt, 0_03.txt, 0_04.txt, 1_00.txt, 1_01.txt, 1_02.txt, 1_03.txt, 1_04.txt, 1_05.txt, 1_06.txt, 1_07.txt, 1_08.txt, 1_09.txt, 1_10.txt, 1_11.txt, 1_12.txt, 1_13.txt
Case Name Status Exec Time Memory
0_00.txt AC 68 ms 20948 KB
0_01.txt AC 71 ms 19156 KB
0_02.txt AC 69 ms 21076 KB
0_03.txt AC 69 ms 23252 KB
0_04.txt AC 74 ms 20692 KB
1_00.txt AC 67 ms 21204 KB
1_01.txt AC 69 ms 23252 KB
1_02.txt AC 67 ms 19668 KB
1_03.txt AC 79 ms 23124 KB
1_04.txt AC 68 ms 20692 KB
1_05.txt AC 69 ms 18900 KB
1_06.txt AC 68 ms 21076 KB
1_07.txt AC 180 ms 37260 KB
1_08.txt AC 175 ms 35980 KB
1_09.txt AC 168 ms 37460 KB
1_10.txt AC 171 ms 35540 KB
1_11.txt AC 168 ms 36564 KB
1_12.txt AC 169 ms 37716 KB
1_13.txt AC 170 ms 36948 KB