結果

問題 No.587 七対子
ユーザー bluemeganebluemegane
提出日時 2018-09-10 15:29:14
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 56 ms / 2,000 ms
コード長 688 bytes
コンパイル時間 2,700 ms
コンパイル使用メモリ 106,392 KB
実行使用メモリ 25,272 KB
最終ジャッジ日時 2023-09-27 02:25:13
合計ジャッジ時間 5,434 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 55 ms
21,128 KB
testcase_01 AC 56 ms
21,232 KB
testcase_02 AC 56 ms
21,316 KB
testcase_03 AC 56 ms
23,332 KB
testcase_04 AC 56 ms
21,320 KB
testcase_05 AC 55 ms
21,132 KB
testcase_06 AC 54 ms
19,420 KB
testcase_07 AC 54 ms
21,304 KB
testcase_08 AC 55 ms
21,320 KB
testcase_09 AC 55 ms
23,180 KB
testcase_10 AC 55 ms
21,108 KB
testcase_11 AC 55 ms
21,216 KB
testcase_12 AC 55 ms
21,412 KB
testcase_13 AC 55 ms
23,208 KB
testcase_14 AC 56 ms
21,212 KB
testcase_15 AC 54 ms
19,164 KB
testcase_16 AC 55 ms
21,124 KB
testcase_17 AC 55 ms
21,332 KB
testcase_18 AC 55 ms
21,332 KB
testcase_19 AC 55 ms
23,280 KB
testcase_20 AC 55 ms
21,312 KB
testcase_21 AC 55 ms
21,156 KB
testcase_22 AC 56 ms
25,272 KB
testcase_23 AC 54 ms
19,164 KB
testcase_24 AC 55 ms
21,404 KB
testcase_25 AC 55 ms
23,352 KB
testcase_26 AC 54 ms
21,120 KB
testcase_27 AC 56 ms
19,272 KB
testcase_28 AC 55 ms
21,320 KB
testcase_29 AC 56 ms
21,232 KB
testcase_30 AC 56 ms
21,212 KB
testcase_31 AC 55 ms
23,272 KB
testcase_32 AC 55 ms
21,220 KB
testcase_33 AC 55 ms
19,184 KB
testcase_34 AC 55 ms
21,212 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

using System.Linq;
using System.Collections.Generic;
using System;

public class Hello
{
    public static void Main()
    {
        var d = new Dictionary<char, int>();
        var s = Console.ReadLine().Trim();
        for (int i = 0; i < 13; i++)
            if (d.ContainsKey(s[i])) d[s[i]]++;
            else d[s[i]] = 1;
        Console.WriteLine(getAns(d));
    }
    public static string getAns (Dictionary<char,int> d)
    {
        var ng = "Impossible";
        if (d.Count() != 7) return ng;
        var a = d.Count(x => x.Value == 1);
        if (a == 1)
            foreach (var x in d)
                if (x.Value == 1) return x.Key.ToString();
        return ng;
    }
}
0