結果
| 問題 |
No.548 国士無双
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2017-10-26 17:32:38 |
| 言語 | C#(csc) (csc 3.9.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 1,152 bytes |
| コンパイル時間 | 947 ms |
| コンパイル使用メモリ | 117,524 KB |
| 実行使用メモリ | 27,000 KB |
| 最終ジャッジ日時 | 2024-07-05 20:31:21 |
| 合計ジャッジ時間 | 2,480 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 22 WA * 2 |
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc) Copyright (C) Microsoft Corporation. All rights reserved.
ソースコード
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace YukiCoder
{
public class RisingSun
{
private static Dictionary<char, int> HoldingTiles = new Dictionary<char, int>()
{
{'a',0},
{'b',0},
{'c',0},
{'d',0},
{'e',0},
{'f',0},
{'g',0},
{'h',0},
{'i',0},
{'j',0},
{'k',0},
{'l',0},
{'m',0},
};
public static void Main()
{
List<char> NowHolding = Console.ReadLine().ToCharArray().ToList<char>();
foreach(var TargetHolding in NowHolding)
{
if (HoldingTiles.ContainsKey(TargetHolding) == false)
continue;
HoldingTiles[TargetHolding] = HoldingTiles[TargetHolding] + 1;
}
Possible();
}
public static void Possible()
{
if (HoldingTiles.Count(x => x.Value == 0) > 2)
{
Console.WriteLine("Impossible");
return;
}
var NotHaving = HoldingTiles.Where(x => x.Value == 0).FirstOrDefault();
if(NotHaving.Key != 0)
{
Console.WriteLine(NotHaving.Key);
return;
}
foreach(var Tile in HoldingTiles.Keys)
{
Console.WriteLine(Tile);
return;
}
}
}
}