結果
| 問題 |
No.582 キャンディー・ボックス3
|
| コンテスト | |
| ユーザー |
No
|
| 提出日時 | 2018-01-25 00:06:35 |
| 言語 | C#(csc) (csc 3.9.0) |
| 結果 |
AC
|
| 実行時間 | 34 ms / 2,000 ms |
| コード長 | 623 bytes |
| コンパイル時間 | 1,004 ms |
| コンパイル使用メモリ | 111,956 KB |
| 実行使用メモリ | 19,712 KB |
| 最終ジャッジ日時 | 2024-12-26 08:26:19 |
| 合計ジャッジ時間 | 2,306 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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