結果

問題 No.2268 NGワード回避
ユーザー Moss_Local
提出日時 2023-03-08 00:12:58
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 139 ms / 2,000 ms
コード長 1,012 bytes
コンパイル時間 185 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 22,276 KB
最終ジャッジ日時 2024-09-18 02:18:47
合計ジャッジ時間 9,750 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 52
権限があれば一括ダウンロードができます

ソースコード

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