結果

問題 No.548 国士無双
ユーザー 14番14番
提出日時 2017-07-28 22:34:39
言語 C#(csc)
(csc 3.9.0)
結果
WA  
(最新)
AC  
(最初)
実行時間 -
コード長 1,369 bytes
コンパイル時間 3,996 ms
コンパイル使用メモリ 112,132 KB
実行使用メモリ 24,908 KB
最終ジャッジ日時 2023-10-17 15:17:18
合計ジャッジ時間 3,309 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 26 ms
24,612 KB
testcase_01 AC 25 ms
24,612 KB
testcase_02 AC 25 ms
24,612 KB
testcase_03 AC 25 ms
24,612 KB
testcase_04 AC 25 ms
24,612 KB
testcase_05 AC 26 ms
24,612 KB
testcase_06 AC 25 ms
24,612 KB
testcase_07 AC 26 ms
24,612 KB
testcase_08 AC 26 ms
24,612 KB
testcase_09 AC 26 ms
24,612 KB
testcase_10 AC 26 ms
24,612 KB
testcase_11 AC 25 ms
24,612 KB
testcase_12 AC 25 ms
24,612 KB
testcase_13 AC 25 ms
24,612 KB
testcase_14 AC 26 ms
24,612 KB
testcase_15 AC 25 ms
24,612 KB
testcase_16 AC 26 ms
24,612 KB
testcase_17 AC 25 ms
24,612 KB
testcase_18 AC 25 ms
24,612 KB
testcase_19 AC 25 ms
24,612 KB
testcase_20 WA -
testcase_21 AC 26 ms
24,612 KB
testcase_22 AC 25 ms
24,496 KB
testcase_23 AC 30 ms
24,908 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.IO;
using System.Linq;
using System.Collections.Generic;
using System.Text;

public class Program
{

    public void Proc()
    {
        string target = "abcdefghijklm";
        string input = Reader.ReadLine();
        bool isPossible = true;
        if(input.Any(a=>!target.Contains(a))) {
            isPossible = false;
        }
        if(isPossible) {
            if(input.Any(a=>input.Count(b=>b==a)>2)) {
                isPossible = false;
            }
        }
        if(isPossible) {
            if(input.All(a=>input.Count(b=>b==a)==1)) {
                target.OrderBy(a => a).ToList().ForEach(a=>Console.WriteLine(a));
            } else {
                Console.WriteLine(target.First(a=>!input.Contains(a)));
            }
        } else {
            Console.WriteLine("Impossible");
        }
    }


    public class Reader
	{
		private static StringReader sr;
		public static bool IsDebug = false;
		public static string ReadLine()
		{
			if (IsDebug)
			{
				if (sr == null)
				{
					sr = new StringReader(InputText.Trim());
				}
				return sr.ReadLine();
			}
			else
			{
				return Console.ReadLine();
			}
		}
		private static string InputText = @"


cbmlieadfghjk

";
	}

	public static void Main(string[] args)
	{
#if DEBUG
		Reader.IsDebug = true;
#endif
		Program prg = new Program();
		prg.Proc();
	}
}
0