結果
| 問題 | No.582 キャンディー・ボックス3 | 
| コンテスト | |
| ユーザー |  | 
| 提出日時 | 2020-03-19 02:25:10 | 
| 言語 | Java (openjdk 23) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 143 ms / 2,000 ms | 
| コード長 | 588 bytes | 
| コンパイル時間 | 1,955 ms | 
| コンパイル使用メモリ | 74,992 KB | 
| 実行使用メモリ | 54,388 KB | 
| 最終ジャッジ日時 | 2024-12-14 02:55:40 | 
| 合計ジャッジ時間 | 5,378 ms | 
| ジャッジサーバーID (参考情報) | judge4 / judge5 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 17 | 
ソースコード
import java.util.ArrayDeque;
import java.util.Arrays;
import java.util.Scanner;
class Main {
	public static void main(String[] args) {
		new Main().run();
	}
	
	void run() {
		Scanner sc = new Scanner(System.in);
		int n=sc.nextInt();
		int[] C=new int[n];
		int c1=0,c2=0,c=0;
		for(int i=0;i<n;++i) {
			C[i]=sc.nextInt();
			if(C[i]==1)++c1;
			else if(C[i]==2)++c2;
			else c+=C[i];
		}
		if(c2<=1&&c==0&&(c1+2*c2)%2==1) {
			System.out.println("A");
		}else{
			System.out.println("B");
		}
	}
	void tr(Object... objects) {
		System.out.println(Arrays.deepToString(objects));
	}
}
            
            
            
        