Last active
October 24, 2017 23:59
-
-
Save mizushou/2af0bd4585486ec23916e8218cc1c79f to your computer and use it in GitHub Desktop.
# 171022 Code festival 予選 C * 問題 * http://code-festival-2017-qualc.contest.atcoder.jp/
* 解説 * https://img.atcoder.jp/code-festival-2017-qualc/editorial.pdf
* その他 * Javaのべき乗って演算子ないんだ、しかもMath.powはdoubleしかない。めんどう
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Scanner; | |
public class SimilarArrays { | |
public static void main(String[] args) { | |
Scanner sc = new Scanner(System.in); | |
int n = sc.nextInt(); | |
int[] A = new int[n]; | |
for(int i=0; i<n; i++){ | |
A[i] = sc.nextInt(); | |
}; | |
sc.close(); | |
int o=1; | |
for(int i=0; i<n; i++){ | |
if(A[i]%2 == 0) o *=2; | |
}; | |
System.out.println((int)Math.pow(3,n) - o); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment