結果

問題 No.233 めぐるはめぐる (3)
ユーザー titiatitia
提出日時 2022-10-30 01:09:57
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 580 ms / 1,000 ms
コード長 518 bytes
コンパイル時間 300 ms
コンパイル使用メモリ 87,048 KB
実行使用メモリ 105,736 KB
最終ジャッジ日時 2023-09-21 02:22:14
合計ジャッジ時間 10,954 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 551 ms
105,484 KB
testcase_01 AC 527 ms
99,756 KB
testcase_02 AC 499 ms
94,440 KB
testcase_03 AC 532 ms
100,800 KB
testcase_04 AC 580 ms
105,564 KB
testcase_05 AC 571 ms
105,736 KB
testcase_06 AC 575 ms
105,588 KB
testcase_07 AC 558 ms
105,576 KB
testcase_08 AC 553 ms
105,376 KB
testcase_09 AC 465 ms
91,976 KB
testcase_10 AC 464 ms
91,904 KB
testcase_11 AC 464 ms
91,912 KB
testcase_12 AC 526 ms
100,612 KB
testcase_13 AC 557 ms
105,512 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from itertools import permutations

X=list(permutations("nbmgr"))
Y=list(permutations("iaaeuu"))


S=set()

for x in X:
    for y in Y:
        A=[]

        for i in range(5):
            A.append(x[i])
            A.append(y[i])

        for i in range(len(A)):
            S.add("".join(A[:i]+[y[-1]]+A[i:]))

N=int(input())
LIST=set([input() for i in range(N)])

if len(LIST)==len(S):
    print("NO")
else:
    for s in S:
        if s in LIST:
            pass
        else:
            print(s)
            break
0