結果

問題 No.582 キャンディー・ボックス3
ユーザー takeya_okinotakeya_okino
提出日時 2017-10-27 22:41:26
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 465 bytes
コンパイル時間 2,201 ms
コンパイル使用メモリ 74,280 KB
実行使用メモリ 41,900 KB
最終ジャッジ日時 2024-05-01 16:40:16
合計ジャッジ時間 5,524 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 107 ms
41,588 KB
testcase_01 AC 117 ms
41,292 KB
testcase_02 AC 107 ms
41,436 KB
testcase_03 WA -
testcase_04 AC 121 ms
41,588 KB
testcase_05 AC 115 ms
41,112 KB
testcase_06 AC 109 ms
41,220 KB
testcase_07 AC 136 ms
41,760 KB
testcase_08 AC 137 ms
41,120 KB
testcase_09 WA -
testcase_10 AC 109 ms
41,180 KB
testcase_11 AC 112 ms
41,516 KB
testcase_12 AC 117 ms
40,188 KB
testcase_13 WA -
testcase_14 AC 120 ms
41,900 KB
testcase_15 AC 125 ms
41,832 KB
testcase_16 AC 123 ms
41,804 KB
testcase_17 AC 127 ms
41,572 KB
testcase_18 AC 130 ms
41,832 KB
testcase_19 AC 126 ms
41,288 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int count = 0;
    int one = 0;
    int two = 0;
    for(int i = 0; i < n; i++) {
      int c = sc.nextInt();
      if(c > 2) count++;
      if(c == 1) one++;
      if(c == 2) two++;
    }
    String ans = "B";
    if((count == 0) && (two == 0) && (one % 2 == 1)) ans = "A"; 
    System.out.println(ans);
  }
}
0