結果

問題 No.233 めぐるはめぐる (3)
ユーザー TsubajiroTsubajiro
提出日時 2022-05-19 00:07:09
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 1,147 bytes
コンパイル時間 95 ms
コンパイル使用メモリ 11,928 KB
実行使用メモリ 22,520 KB
最終ジャッジ日時 2023-10-17 05:41:25
合計ジャッジ時間 6,324 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 AC 98 ms
14,908 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 AC 26 ms
10,396 KB
testcase_10 AC 25 ms
10,396 KB
testcase_11 AC 24 ms
10,396 KB
testcase_12 AC 167 ms
21,176 KB
testcase_13 WA -
権限があれば一括ダウンロードができます

ソースコード

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()
        cc=copy.deepcopy(c)
        for k in range(0,16,3):
            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