結果

問題 No.2715 Unique Chimatagram
ユーザー bluemeganebluemegane
提出日時 2024-04-06 09:49:39
言語 C#
(.NET 8.0.203)
結果
AC  
実行時間 302 ms / 2,000 ms
コード長 854 bytes
コンパイル時間 9,923 ms
コンパイル使用メモリ 158,628 KB
実行使用メモリ 183,640 KB
最終ジャッジ日時 2024-04-06 09:49:58
合計ジャッジ時間 19,055 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 64 ms
31,652 KB
testcase_01 AC 64 ms
31,524 KB
testcase_02 AC 63 ms
31,652 KB
testcase_03 AC 64 ms
31,652 KB
testcase_04 AC 64 ms
31,652 KB
testcase_05 AC 63 ms
31,652 KB
testcase_06 AC 63 ms
31,652 KB
testcase_07 AC 64 ms
31,652 KB
testcase_08 AC 185 ms
36,900 KB
testcase_09 AC 175 ms
37,156 KB
testcase_10 AC 165 ms
37,156 KB
testcase_11 AC 167 ms
37,156 KB
testcase_12 AC 159 ms
37,028 KB
testcase_13 AC 164 ms
37,156 KB
testcase_14 AC 158 ms
36,900 KB
testcase_15 AC 162 ms
37,028 KB
testcase_16 AC 164 ms
36,900 KB
testcase_17 AC 166 ms
37,028 KB
testcase_18 AC 289 ms
38,052 KB
testcase_19 AC 288 ms
38,052 KB
testcase_20 AC 297 ms
38,052 KB
testcase_21 AC 286 ms
38,052 KB
testcase_22 AC 288 ms
38,052 KB
testcase_23 AC 288 ms
38,052 KB
testcase_24 AC 299 ms
38,052 KB
testcase_25 AC 302 ms
38,052 KB
testcase_26 AC 291 ms
38,052 KB
testcase_27 AC 302 ms
38,052 KB
testcase_28 AC 155 ms
35,748 KB
testcase_29 AC 157 ms
35,748 KB
testcase_30 AC 155 ms
35,748 KB
testcase_31 AC 155 ms
35,748 KB
testcase_32 AC 156 ms
35,748 KB
testcase_33 AC 62 ms
31,524 KB
testcase_34 AC 62 ms
31,524 KB
testcase_35 AC 61 ms
31,652 KB
testcase_36 AC 64 ms
31,524 KB
testcase_37 AC 62 ms
31,652 KB
testcase_38 AC 62 ms
31,780 KB
testcase_39 AC 83 ms
34,340 KB
testcase_40 AC 80 ms
34,212 KB
testcase_41 AC 166 ms
36,388 KB
testcase_42 AC 189 ms
183,640 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
  復元対象のプロジェクトを決定しています...
  /home/judge/data/code/main.csproj を復元しました (106 ms)。
MSBuild のバージョン 17.7.3+8ec440e68 (.NET)
  main -> /home/judge/data/code/bin/Release/net7.0/main.dll
  main -> /home/judge/data/code/bin/Release/net7.0/publish/

ソースコード

diff #

using System.Collections.Generic;
using System;

public class Hello
{
    static void Main()
    {
        var n = int.Parse(Console.ReadLine().Trim());
        getAns(n);
    }
    static string getT(string s, char c)
    {
        s += c;
        var s2 = s.ToCharArray();
        Array.Sort(s2);
        return new string(s2);
    }
    static void getAns(int n)
    {
        var d = new Dictionary<string, int>();
        for (int i = 0; i < n; i++)
        {
            var s = Console.ReadLine().Trim();
            for (int j = 0; j < 26; j++)
            {
                var t = getT(s, (char)(j + 'a'));
                if (d.ContainsKey(t)) d[t]++;
                else d[t] = 1;
            }
        }
        foreach (var x in d)
            if (x.Value == 1) { Console.WriteLine(x.Key); return; }
        Console.WriteLine(-1);
    }
}
0