結果

問題 No.582 キャンディー・ボックス3
ユーザー NoNo
提出日時 2018-01-25 00:06:35
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 64 ms / 2,000 ms
コード長 623 bytes
コンパイル時間 2,258 ms
コンパイル使用メモリ 105,900 KB
実行使用メモリ 23,760 KB
最終ジャッジ日時 2023-08-27 02:31:06
合計ジャッジ時間 4,054 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 56 ms
21,632 KB
testcase_01 AC 56 ms
23,684 KB
testcase_02 AC 58 ms
23,608 KB
testcase_03 AC 56 ms
23,660 KB
testcase_04 AC 55 ms
21,672 KB
testcase_05 AC 58 ms
23,672 KB
testcase_06 AC 56 ms
21,640 KB
testcase_07 AC 59 ms
21,636 KB
testcase_08 AC 56 ms
19,584 KB
testcase_09 AC 55 ms
23,676 KB
testcase_10 AC 58 ms
21,616 KB
testcase_11 AC 56 ms
19,556 KB
testcase_12 AC 56 ms
23,664 KB
testcase_13 AC 55 ms
23,688 KB
testcase_14 AC 54 ms
21,672 KB
testcase_15 AC 62 ms
21,940 KB
testcase_16 AC 61 ms
23,760 KB
testcase_17 AC 63 ms
21,720 KB
testcase_18 AC 64 ms
21,744 KB
testcase_19 AC 63 ms
21,756 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 z = c.Count(x => x == 0);
            int o = c.Count(x => x == 1);
            int t = c.Count(x => x == 2);
            n -= z;

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

            Console.WriteLine(a);
        }
    }
}
0