Submission #1031744


Source Code Expand

Copy
N, *A = $stdin.read.split.map(&:to_i)
CT = Array.new(10**5, 0)

A.each do |a|
  CT[a] += 1
  if (N-a).even? || CT[a] > 2
    puts 0; exit
  end
end

if N.odd? && CT[0] != 1
  puts 0; exit
end
p((2**(N/2)) % (10**9+7))

Submission Info

Submission Time
Task C - Lining Up
User yhara
Language Ruby (2.3.3)
Score 300
Code Size 232 Byte
Status
Exec Time 67 ms
Memory 9852 KB

Test Cases

Set Name Score / Max Score Test Cases
Sample 0 / 0 sample_01.txt, sample_02.txt, sample_03.txt
All 300 / 300 subtask_1_invalid_01.txt, subtask_1_invalid_02.txt, subtask_1_max_01.txt, subtask_1_max_02.txt, subtask_1_max_valid_01.txt, subtask_1_max_valid_02.txt, subtask_1_min_valid_01.txt, subtask_1_rand_01.txt, subtask_1_rand_02.txt, subtask_1_valid_01.txt, subtask_1_valid_02.txt
Case Name Status Exec Time Memory
sample_01.txt 11 ms 2556 KB
sample_02.txt 11 ms 2556 KB
sample_03.txt 11 ms 2556 KB
subtask_1_invalid_01.txt 57 ms 8572 KB
subtask_1_invalid_02.txt 22 ms 3708 KB
subtask_1_max_01.txt 50 ms 9596 KB
subtask_1_max_02.txt 50 ms 9596 KB
subtask_1_max_valid_01.txt 67 ms 9852 KB
subtask_1_max_valid_02.txt 66 ms 9724 KB
subtask_1_min_valid_01.txt 11 ms 2556 KB
subtask_1_rand_01.txt 37 ms 6908 KB
subtask_1_rand_02.txt 48 ms 9084 KB
subtask_1_valid_01.txt 43 ms 6524 KB
subtask_1_valid_02.txt 23 ms 3836 KB