結果

問題 No.2268 NGワード回避
ユーザー 👑 kakel-sankakel-san
提出日時 2023-07-05 17:39:23
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 82 ms / 2,000 ms
コード長 761 bytes
コンパイル時間 2,243 ms
コンパイル使用メモリ 65,780 KB
実行使用メモリ 31,556 KB
最終ジャッジ日時 2023-09-26 17:55:39
合計ジャッジ時間 8,910 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 65 ms
25,800 KB
testcase_01 AC 66 ms
25,552 KB
testcase_02 AC 65 ms
25,612 KB
testcase_03 AC 65 ms
23,536 KB
testcase_04 AC 65 ms
25,744 KB
testcase_05 AC 65 ms
25,764 KB
testcase_06 AC 64 ms
23,828 KB
testcase_07 AC 66 ms
25,492 KB
testcase_08 AC 66 ms
23,708 KB
testcase_09 AC 66 ms
23,716 KB
testcase_10 AC 66 ms
25,568 KB
testcase_11 AC 66 ms
23,744 KB
testcase_12 AC 66 ms
23,452 KB
testcase_13 AC 66 ms
23,640 KB
testcase_14 AC 65 ms
23,496 KB
testcase_15 AC 66 ms
25,528 KB
testcase_16 AC 66 ms
23,572 KB
testcase_17 AC 66 ms
23,468 KB
testcase_18 AC 67 ms
23,728 KB
testcase_19 AC 66 ms
23,664 KB
testcase_20 AC 66 ms
23,444 KB
testcase_21 AC 67 ms
25,772 KB
testcase_22 AC 68 ms
23,572 KB
testcase_23 AC 68 ms
23,528 KB
testcase_24 AC 68 ms
25,436 KB
testcase_25 AC 67 ms
21,604 KB
testcase_26 AC 66 ms
23,700 KB
testcase_27 AC 66 ms
23,636 KB
testcase_28 AC 66 ms
23,748 KB
testcase_29 AC 66 ms
23,828 KB
testcase_30 AC 67 ms
23,700 KB
testcase_31 AC 67 ms
23,748 KB
testcase_32 AC 67 ms
23,752 KB
testcase_33 AC 66 ms
23,444 KB
testcase_34 AC 66 ms
23,460 KB
testcase_35 AC 66 ms
23,392 KB
testcase_36 AC 67 ms
23,576 KB
testcase_37 AC 67 ms
21,504 KB
testcase_38 AC 66 ms
23,824 KB
testcase_39 AC 66 ms
23,768 KB
testcase_40 AC 66 ms
23,588 KB
testcase_41 AC 66 ms
23,704 KB
testcase_42 AC 66 ms
25,556 KB
testcase_43 AC 67 ms
23,564 KB
testcase_44 AC 66 ms
25,568 KB
testcase_45 AC 66 ms
25,748 KB
testcase_46 AC 66 ms
25,612 KB
testcase_47 AC 82 ms
31,496 KB
testcase_48 AC 76 ms
29,368 KB
testcase_49 AC 76 ms
31,556 KB
testcase_50 AC 76 ms
31,344 KB
testcase_51 AC 75 ms
29,388 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

using System;
using static System.Console;
using System.Linq;
using System.Collections.Generic;
class Program
{
    static int NN => int.Parse(ReadLine());
    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 r = new Random();
        while (true)
        {
            var c = new char[n];
            for (var i = 0; i < n; ++i) c[i] = (char)(r.Next(2) + 'a');
            var cs = string.Concat(c);
            if (!s.Contains(cs))
            {
                WriteLine(cs);
                return;
            }
        }
    }
}
0