Submission #5016878


Source Code Expand

import java.util.*;
import java.util.stream.*;

public class Main {
    static Scanner scanner = new Scanner(System.in);

    public static void main(String[]$) {
        int n = scanner.nextInt(), p = scanner.nextInt();
        System.out.println(IntStream.range(0, n).allMatch(i -> scanner.nextInt() % 2 == 0) ? p == 1 ? 0 : 1L << n : 1L << n - 1);
    }
}

Submission Info

Submission Time
Task A - Biscuits
User Yu_212
Language Java8 (OpenJDK 1.8.0)
Score 200
Code Size 368 Byte
Status AC
Exec Time 208 ms
Memory 28624 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 200 / 200
Status
AC × 4
AC × 16
Set Name Test Cases
Sample sample1.txt, sample2.txt, sample3.txt, sample4.txt
All sample1.txt, sample2.txt, sample3.txt, sample4.txt, in1.txt, in2.txt, in3.txt, in4.txt, in5.txt, in6.txt, in7.txt, in8.txt, sample1.txt, sample2.txt, sample3.txt, sample4.txt
Case Name Status Exec Time Memory
in1.txt AC 208 ms 26708 KB
in2.txt AC 183 ms 26708 KB
in3.txt AC 172 ms 24916 KB
in4.txt AC 168 ms 26196 KB
in5.txt AC 182 ms 25044 KB
in6.txt AC 183 ms 28624 KB
in7.txt AC 195 ms 26696 KB
in8.txt AC 180 ms 26964 KB
sample1.txt AC 177 ms 26196 KB
sample2.txt AC 170 ms 26576 KB
sample3.txt AC 170 ms 26704 KB
sample4.txt AC 166 ms 24396 KB