結果

問題 No.1994 Confusing Name
ユーザー kokatsukokatsu
提出日時 2022-07-01 22:11:00
言語 D
(dmd 2.106.1)
結果
TLE  
(最新)
AC  
(最初)
実行時間 -
コード長 550 bytes
コンパイル時間 5,746 ms
コンパイル使用メモリ 196,924 KB
実行使用メモリ 23,760 KB
最終ジャッジ日時 2023-09-04 17:37:27
合計ジャッジ時間 33,297 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,356 KB
testcase_01 AC 2 ms
4,384 KB
testcase_02 AC 2 ms
4,384 KB
testcase_03 AC 1 ms
4,384 KB
testcase_04 AC 2 ms
4,384 KB
testcase_05 AC 13 ms
6,216 KB
testcase_06 AC 27 ms
5,980 KB
testcase_07 AC 7 ms
4,380 KB
testcase_08 AC 20 ms
5,228 KB
testcase_09 AC 28 ms
6,216 KB
testcase_10 AC 14 ms
4,704 KB
testcase_11 AC 12 ms
4,680 KB
testcase_12 AC 1,662 ms
21,996 KB
testcase_13 TLE -
testcase_14 AC 1,830 ms
21,976 KB
testcase_15 AC 1,748 ms
12,212 KB
testcase_16 AC 1,405 ms
11,212 KB
testcase_17 AC 1,630 ms
11,252 KB
testcase_18 AC 1,924 ms
23,760 KB
testcase_19 AC 1,939 ms
23,548 KB
testcase_20 AC 1,943 ms
22,048 KB
testcase_21 AC 350 ms
8,552 KB
testcase_22 AC 172 ms
8,088 KB
testcase_23 AC 1,670 ms
22,792 KB
testcase_24 AC 1,588 ms
23,032 KB
testcase_25 AC 1,069 ms
12,712 KB
testcase_26 AC 493 ms
8,548 KB
testcase_27 AC 1,489 ms
23,252 KB
testcase_28 AC 1,171 ms
12,240 KB
testcase_29 AC 138 ms
7,760 KB
testcase_30 AC 1,342 ms
11,468 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import std;

void main() {
    int N;
    readf("%d\n", N);

    auto S = new string[](N);
    bool[string] isRegistered;
    foreach (i; 0 .. N) {
        S[i] = readln.chomp;
        isRegistered[S[i]] = true;
    }

    foreach (s; S) {
        int res;
        auto len = s.length;
        foreach (i; 0 .. len) {
            foreach (l; lowercase) {
                if (l == s[i]) continue;
                string t = s[0..i] ~ l ~ s[i+1..len];

                if (t in isRegistered) ++res;
            }
        }

        res.writeln;
    }
}
0