結果

問題 No.2268 NGワード回避
ユーザー Moss_LocalMoss_Local
提出日時 2023-03-08 00:12:58
言語 Python3
(3.11.2 + numpy 1.24.2 + scipy 1.10.1)
結果
AC  
実行時間 82 ms / 2,000 ms
コード長 1,012 bytes
コンパイル時間 503 ms
コンパイル使用メモリ 10,864 KB
実行使用メモリ 15,552 KB
最終ジャッジ日時 2023-07-18 02:32:56
合計ジャッジ時間 7,212 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 73 ms
14,464 KB
testcase_01 AC 73 ms
14,388 KB
testcase_02 AC 74 ms
14,560 KB
testcase_03 AC 73 ms
14,424 KB
testcase_04 AC 74 ms
14,344 KB
testcase_05 AC 72 ms
14,380 KB
testcase_06 AC 75 ms
14,412 KB
testcase_07 AC 73 ms
14,544 KB
testcase_08 AC 73 ms
14,396 KB
testcase_09 AC 74 ms
14,344 KB
testcase_10 AC 73 ms
14,504 KB
testcase_11 AC 74 ms
14,384 KB
testcase_12 AC 75 ms
14,352 KB
testcase_13 AC 73 ms
14,424 KB
testcase_14 AC 72 ms
14,432 KB
testcase_15 AC 72 ms
14,356 KB
testcase_16 AC 73 ms
14,428 KB
testcase_17 AC 73 ms
14,424 KB
testcase_18 AC 72 ms
14,436 KB
testcase_19 AC 73 ms
14,428 KB
testcase_20 AC 72 ms
14,424 KB
testcase_21 AC 73 ms
14,392 KB
testcase_22 AC 72 ms
14,536 KB
testcase_23 AC 73 ms
14,428 KB
testcase_24 AC 71 ms
14,452 KB
testcase_25 AC 72 ms
14,452 KB
testcase_26 AC 72 ms
14,356 KB
testcase_27 AC 72 ms
14,516 KB
testcase_28 AC 74 ms
14,352 KB
testcase_29 AC 73 ms
14,432 KB
testcase_30 AC 75 ms
14,436 KB
testcase_31 AC 76 ms
14,556 KB
testcase_32 AC 74 ms
14,556 KB
testcase_33 AC 75 ms
14,504 KB
testcase_34 AC 77 ms
14,384 KB
testcase_35 AC 77 ms
14,424 KB
testcase_36 AC 76 ms
14,532 KB
testcase_37 AC 82 ms
14,436 KB
testcase_38 AC 77 ms
14,532 KB
testcase_39 AC 72 ms
14,500 KB
testcase_40 AC 73 ms
14,352 KB
testcase_41 AC 73 ms
14,508 KB
testcase_42 AC 73 ms
14,400 KB
testcase_43 AC 74 ms
14,500 KB
testcase_44 AC 72 ms
14,412 KB
testcase_45 AC 73 ms
14,396 KB
testcase_46 AC 75 ms
14,388 KB
testcase_47 AC 76 ms
15,464 KB
testcase_48 AC 75 ms
15,552 KB
testcase_49 AC 75 ms
15,408 KB
testcase_50 AC 75 ms
15,452 KB
testcase_51 AC 74 ms
15,452 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