結果

問題 No.582 キャンディー・ボックス3
ユーザー NoNo
提出日時 2018-01-24 23:56:10
言語 C#(csc)
(csc 3.9.0)
結果
WA  
実行時間 -
コード長 556 bytes
コンパイル時間 2,967 ms
コンパイル使用メモリ 105,572 KB
実行使用メモリ 25,824 KB
最終ジャッジ日時 2023-08-27 02:30:43
合計ジャッジ時間 5,515 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 60 ms
21,700 KB
testcase_01 AC 60 ms
23,660 KB
testcase_02 AC 59 ms
19,576 KB
testcase_03 AC 60 ms
21,684 KB
testcase_04 AC 61 ms
21,508 KB
testcase_05 AC 61 ms
21,740 KB
testcase_06 WA -
testcase_07 AC 60 ms
21,624 KB
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 AC 61 ms
21,688 KB
testcase_12 AC 62 ms
23,748 KB
testcase_13 AC 60 ms
19,592 KB
testcase_14 AC 61 ms
21,688 KB
testcase_15 AC 68 ms
23,696 KB
testcase_16 WA -
testcase_17 AC 66 ms
21,792 KB
testcase_18 AC 65 ms
21,768 KB
testcase_19 AC 68 ms
21,740 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

using System;
using System.Linq;

namespace y
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());
            var c = Console.ReadLine().Split().Select(x => int.Parse(x)).ToArray();

            int o = c.Count(x => x == 1);
            int t = c.Count(x => x == 2);

            string a = "";
            if (o == n && n % 2 == 1) a = "A";
            if (o == n - 1 && t == 1 && n % 2 == 0) a = "A";
            else a = "B";

            Console.WriteLine(a);
        }
    }
}
0