結果

問題 No.2268 NGワード回避
ユーザー Moss_LocalMoss_Local
提出日時 2023-03-08 00:12:58
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 124 ms / 2,000 ms
コード長 1,012 bytes
コンパイル時間 179 ms
コンパイル使用メモリ 11,944 KB
実行使用メモリ 18,716 KB
最終ジャッジ日時 2023-10-18 05:40:57
合計ジャッジ時間 9,158 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 117 ms
18,716 KB
testcase_01 AC 116 ms
18,716 KB
testcase_02 AC 119 ms
18,716 KB
testcase_03 AC 119 ms
18,716 KB
testcase_04 AC 117 ms
18,716 KB
testcase_05 AC 116 ms
18,716 KB
testcase_06 AC 112 ms
18,716 KB
testcase_07 AC 116 ms
18,716 KB
testcase_08 AC 114 ms
18,716 KB
testcase_09 AC 116 ms
18,716 KB
testcase_10 AC 118 ms
18,716 KB
testcase_11 AC 116 ms
18,716 KB
testcase_12 AC 117 ms
18,716 KB
testcase_13 AC 118 ms
18,716 KB
testcase_14 AC 117 ms
18,716 KB
testcase_15 AC 119 ms
18,716 KB
testcase_16 AC 117 ms
18,716 KB
testcase_17 AC 119 ms
18,716 KB
testcase_18 AC 116 ms
18,716 KB
testcase_19 AC 116 ms
18,716 KB
testcase_20 AC 118 ms
18,716 KB
testcase_21 AC 118 ms
18,716 KB
testcase_22 AC 120 ms
18,716 KB
testcase_23 AC 117 ms
18,716 KB
testcase_24 AC 119 ms
18,716 KB
testcase_25 AC 119 ms
18,716 KB
testcase_26 AC 120 ms
18,716 KB
testcase_27 AC 119 ms
18,716 KB
testcase_28 AC 120 ms
18,716 KB
testcase_29 AC 119 ms
18,716 KB
testcase_30 AC 124 ms
18,716 KB
testcase_31 AC 120 ms
18,716 KB
testcase_32 AC 119 ms
18,716 KB
testcase_33 AC 121 ms
18,716 KB
testcase_34 AC 121 ms
18,716 KB
testcase_35 AC 118 ms
18,716 KB
testcase_36 AC 119 ms
18,716 KB
testcase_37 AC 119 ms
18,716 KB
testcase_38 AC 122 ms
18,716 KB
testcase_39 AC 117 ms
18,716 KB
testcase_40 AC 118 ms
18,716 KB
testcase_41 AC 117 ms
18,716 KB
testcase_42 AC 118 ms
18,716 KB
testcase_43 AC 118 ms
18,716 KB
testcase_44 AC 116 ms
18,716 KB
testcase_45 AC 117 ms
18,716 KB
testcase_46 AC 118 ms
18,716 KB
testcase_47 AC 120 ms
18,716 KB
testcase_48 AC 118 ms
18,716 KB
testcase_49 AC 119 ms
18,716 KB
testcase_50 AC 121 ms
18,716 KB
testcase_51 AC 121 ms
18,716 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from itertools import combinations
from cgitb import reset
from collections import defaultdict
from functools import lru_cache
from sys import flags, stdin
import math
import re
import queue
from tokenize import String
import typing
import itertools
import bisect
import statistics
# import numpy as np
# from numpy.core.function_base import _needs_add_docstring
# from numpy.core.numeric import outer
input = stdin.readline
MOD = 1000000007
INF = 122337203685477580


def solve():
    n = int(input())
    # set
    st = set()
    for _ in range(n):
        # read string remove line break
        s = input().rstrip()
        st.add((s))

    # print(st)

    nn = min(10, n)
    for i in range(2**nn):
        s = ""
        for j in range(0, nn):
            if (i >> j) & 1:
                s += "a"
            else:
                s += "b"
        while len(s) < n:
            s += "a"
        if s not in st:
            print(s)
            return

    return


if __name__ == '__main__':
    solve()
0