結果

問題 No.582 キャンディー・ボックス3
ユーザー 37zigen37zigen
提出日時 2020-03-19 02:25:10
言語 Java21
(openjdk 21)
結果
AC  
実行時間 116 ms / 2,000 ms
コード長 588 bytes
コンパイル時間 2,020 ms
コンパイル使用メモリ 72,356 KB
実行使用メモリ 55,896 KB
最終ジャッジ日時 2023-08-20 20:34:12
合計ジャッジ時間 5,785 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 102 ms
55,560 KB
testcase_01 AC 101 ms
55,896 KB
testcase_02 AC 100 ms
55,664 KB
testcase_03 AC 101 ms
53,432 KB
testcase_04 AC 106 ms
55,608 KB
testcase_05 AC 111 ms
55,688 KB
testcase_06 AC 101 ms
55,684 KB
testcase_07 AC 101 ms
55,680 KB
testcase_08 AC 100 ms
55,696 KB
testcase_09 AC 101 ms
55,612 KB
testcase_10 AC 100 ms
55,772 KB
testcase_11 AC 104 ms
55,708 KB
testcase_12 AC 105 ms
55,556 KB
testcase_13 AC 109 ms
55,712 KB
testcase_14 AC 109 ms
55,484 KB
testcase_15 AC 110 ms
55,740 KB
testcase_16 AC 114 ms
55,712 KB
testcase_17 AC 111 ms
55,672 KB
testcase_18 AC 113 ms
55,736 KB
testcase_19 AC 116 ms
55,772 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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));
	}
}
0