結果
| 問題 | No.582 キャンディー・ボックス3 | 
| コンテスト | |
| ユーザー |  takeya_okino | 
| 提出日時 | 2017-10-27 22:41:26 | 
| 言語 | Java (openjdk 23) | 
| 結果 | 
                                WA
                                 
                             | 
| 実行時間 | - | 
| コード長 | 465 bytes | 
| コンパイル時間 | 2,100 ms | 
| コンパイル使用メモリ | 74,968 KB | 
| 実行使用メモリ | 56,052 KB | 
| 最終ジャッジ日時 | 2024-11-21 21:54:28 | 
| 合計ジャッジ時間 | 5,356 ms | 
| ジャッジサーバーID (参考情報) | judge5 / judge3 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 2 WA * 1 | 
| other | AC * 15 WA * 2 | 
ソースコード
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);
  }
}
            
            
            
        