結果

問題 No.548 国士無双
ユーザー AreTrashAreTrash
提出日時 2018-04-22 10:22:42
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 33 ms / 2,000 ms
コード長 679 bytes
コンパイル時間 4,126 ms
コンパイル使用メモリ 109,644 KB
実行使用メモリ 25,128 KB
最終ジャッジ日時 2023-10-17 17:26:50
合計ジャッジ時間 5,828 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 32 ms
25,080 KB
testcase_01 AC 32 ms
25,080 KB
testcase_02 AC 32 ms
25,072 KB
testcase_03 AC 33 ms
25,080 KB
testcase_04 AC 33 ms
25,072 KB
testcase_05 AC 33 ms
25,080 KB
testcase_06 AC 32 ms
25,072 KB
testcase_07 AC 32 ms
25,080 KB
testcase_08 AC 32 ms
25,072 KB
testcase_09 AC 33 ms
25,072 KB
testcase_10 AC 33 ms
25,080 KB
testcase_11 AC 32 ms
25,080 KB
testcase_12 AC 32 ms
25,072 KB
testcase_13 AC 33 ms
25,080 KB
testcase_14 AC 33 ms
25,080 KB
testcase_15 AC 33 ms
25,080 KB
testcase_16 AC 32 ms
25,080 KB
testcase_17 AC 32 ms
25,072 KB
testcase_18 AC 32 ms
25,072 KB
testcase_19 AC 32 ms
25,072 KB
testcase_20 AC 31 ms
24,980 KB
testcase_21 AC 32 ms
25,072 KB
testcase_22 AC 32 ms
24,980 KB
testcase_23 AC 33 ms
25,128 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 No548
{
    public class Program
    {
        public static void Main(string[] args)
        {
            const string Tiles = "abcdefghijklm";
            var S = new string(Console.ReadLine().OrderBy(c => c).ToArray());

            if (S.Any(s => !Tiles.Contains(s)) || S.Distinct().Count() <= 11)
            {
                Console.WriteLine("Impossible");
                return;
            }

            if (S == Tiles)
            {
                Console.WriteLine(string.Join("\n", Tiles.ToCharArray()));
                return;
            }

            Console.WriteLine(Tiles.Except(S).Single());
        }
    }
}
0