

Time Limit: 2 sec / Memory Limit: 1024 MB
配点 : 点
問題文
個の長さ の数列 があります。 番目の数列は 個の整数 で表されます。
それぞれの長さが の数列 について、 となるような の個数が奇数であるときに、 と は似ていると言います。
を満たす整数の組 のうち、 と が似ているものの個数を求めてください。
制約
- 入力は全て整数である。
入力
入力は以下の形式で標準入力から与えられる。
出力
答えを整数として出力せよ。
入力例 1Copy
3 3 1 2 3 1 3 4 2 3 4
出力例 1Copy
1
は条件を満たします。なぜならば、 となるような は の 個だけだからです。
は条件を満たさないため、条件を満たす の組は だけです。
入力例 2Copy
6 5 8 27 27 10 24 27 8 2 4 5 15 27 26 17 24 27 27 27 27 27 27 7 22 11 27 19 27 27 27 27
出力例 2Copy
5
Score: points
Problem Statement
There are sequences of length , denoted as . The -th sequence is represented by integers .
Two sequences and of length are said to be similar if and only if the number of indices such that is odd.
Find the number of pairs of integers satisfying such that and are similar.
Constraints
- All input values are integers.
Input
The input is given from Standard Input in the following format:
Output
Print the answer as an integer.
Sample Input 1Copy
3 3 1 2 3 1 3 4 2 3 4
Sample Output 1Copy
1
The pair satisfies the condition because there is only one index such that , which is .
The pairs do not satisfy the condition, making the only pair that does.
Sample Input 2Copy
6 5 8 27 27 10 24 27 8 2 4 5 15 27 26 17 24 27 27 27 27 27 27 7 22 11 27 19 27 27 27 27
Sample Output 2Copy
5