結果

問題 No.1994 Confusing Name
ユーザー 👑 kakel-sankakel-san
提出日時 2023-09-27 21:53:43
言語 C#(csc)
(csc 3.9.0)
結果
TLE  
実行時間 -
コード長 1,062 bytes
コンパイル時間 1,633 ms
コンパイル使用メモリ 66,228 KB
実行使用メモリ 37,004 KB
最終ジャッジ日時 2023-09-27 21:53:55
合計ジャッジ時間 12,009 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 68 ms
20,728 KB
testcase_01 AC 70 ms
22,720 KB
testcase_02 AC 69 ms
22,684 KB
testcase_03 AC 67 ms
22,632 KB
testcase_04 AC 68 ms
22,704 KB
testcase_05 AC 91 ms
29,032 KB
testcase_06 AC 113 ms
28,804 KB
testcase_07 AC 78 ms
24,788 KB
testcase_08 AC 104 ms
28,908 KB
testcase_09 AC 119 ms
28,928 KB
testcase_10 AC 96 ms
28,852 KB
testcase_11 AC 90 ms
24,804 KB
testcase_12 TLE -
testcase_13 TLE -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
testcase_30 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

using System;
using static System.Console;
using System.Linq;
using System.Collections.Generic;
class Program
{
    static int NN => int.Parse(ReadLine());
    static int[] NList => ReadLine().Split().Select(int.Parse).ToArray();
    static string[] SList(long n) => Enumerable.Repeat(0, (int)n).Select(_ => ReadLine()).ToArray();
    public static void Main()
    {
        Solve();
    }
    static void Solve()
    {
        var n = NN;
        var s = SList(n);
        var set = new HashSet<string>(s);
        var ans = new int[n];
        for (var i = 0; i < n; ++i)
        {
            var ch = s[i].ToCharArray();
            for (var j = 0; j < ch.Length; ++j)
            {
                for (var c = 'a'; c <= 'z'; ++c)
                {
                    if (s[i][j] == c) continue;
                    ch[j] = c;
                    if (set.Contains(string.Concat(ch))) ++ans[i];
                }
                ch[j] = s[i][j];
            }
        }
        WriteLine(string.Join("\n", ans));
    }
}
0