結果
| 問題 | No.582 キャンディー・ボックス3 |
| コンテスト | |
| ユーザー |
No
|
| 提出日時 | 2018-01-25 00:06:35 |
| 言語 | C#(csc) (csc 3.9.0) |
| 結果 |
AC
|
| 実行時間 | 22 ms / 2,000 ms |
| コード長 | 623 bytes |
| 記録 | |
| コンパイル時間 | 805 ms |
| コンパイル使用メモリ | 106,880 KB |
| 実行使用メモリ | 20,096 KB |
| 最終ジャッジ日時 | 2026-06-01 05:47:30 |
| 合計ジャッジ時間 | 1,967 ms |
|
ジャッジサーバーID (参考情報) |
judge1_1 / judge2_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 17 |
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc) Copyright (C) Microsoft Corporation. All rights reserved.
ソースコード
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);
}
}
}
No