結果

問題 No.2268 NGワード回避
ユーザー ηλ-γμ
提出日時 2025-02-05 00:36:47
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 68 ms / 2,000 ms
コード長 380 bytes
コンパイル時間 1,698 ms
コンパイル使用メモリ 12,416 KB
実行使用メモリ 18,304 KB
最終ジャッジ日時 2025-02-05 00:36:55
合計ジャッジ時間 5,873 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 52
権限があれば一括ダウンロードができます

ソースコード

diff #

def bin_to_ab(decimal_num):
	a1_str=str(f"{decimal_num:b}").zfill(N).replace("0","a")
	ab_str=a1_str.replace("1","b")
	ab_str=list(ab_str)
	return ab_str

NG_words=[]
OKs=t=0

N=int(input())
for i in range(N):
	NG_words.append(list(input()))
while OKs!=N:
	for j in range(N):
		if bin_to_ab(t)==NG_words[j]:
			OKs=0
			t+=1
			break
		else:
			OKs+=1
print("".join(bin_to_ab(t)))
0