結果

問題 No.233 めぐるはめぐる (3)
ユーザー TsubajiroTsubajiro
提出日時 2022-05-19 00:12:08
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 1,152 bytes
コンパイル時間 200 ms
コンパイル使用メモリ 11,928 KB
実行使用メモリ 27,048 KB
最終ジャッジ日時 2023-10-17 05:47:05
合計ジャッジ時間 5,539 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 299 ms
22,180 KB
testcase_01 AC 204 ms
21,112 KB
testcase_02 AC 116 ms
14,844 KB
testcase_03 AC 224 ms
21,112 KB
testcase_04 TLE -
testcase_05 -- -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

import copy
N = int(input())
S = []
candi = set()
for _ in range(N):
    s=input()
    candi.add(s)
s = ["n","b","m","g","r"]
b = ["i","a","a","e","u","u"]
#print(candi)
s5=[]
b6=[]

for i in range(6):
    if i<5:
        s5.append(i)
    b6.append(i)

import itertools
ss = list(itertools.permutations(s5,5))
bb = list(itertools.permutations(b6,6))
#print(ss)
flag=False
for i in ss:
    c = [[] for _ in range(16)]
    #print(c[0])
    #print(s[i[0]])
    for j in bb:
        c[1] = (s[i[0]])
        c[4] = (s[i[1]])
        c[7] = (s[i[2]])
        c[10] = (s[i[3]])
        c[13] = (s[i[4]])
        c[2] = (b[j[0]])
        c[5] = (b[j[1]])
        c[8] = (b[j[2]])
        c[11] = (b[j[3]])
        c[14] = (b[j[4]])
        #cc=c.copy()

        for k in range(0,16,3):
            cc = copy.deepcopy(c)
            cc[k]=b[j[5]]
            candidate = ""
            #print(cc)
            for ccc in cc:
                if not ccc==[]:
                    #print(ccc)
                    candidate+=ccc
            #print(candidate)
            if candidate not in candi:
                print(candidate)
                exit()

print("No")
0