結果
問題 | No.548 国士無双 |
ユーザー |
|
提出日時 | 2017-10-26 17:34:26 |
言語 | C#(csc) (csc 3.9.0) |
結果 |
WA
(最新)
AC
(最初)
|
実行時間 | - |
コード長 | 1,140 bytes |
コンパイル時間 | 892 ms |
コンパイル使用メモリ | 115,076 KB |
実行使用メモリ | 24,436 KB |
最終ジャッジ日時 | 2024-09-17 13:48:16 |
合計ジャッジ時間 | 2,449 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 23 WA * 1 |
コンパイルメッセージ
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); } } } }