結果

問題 No.52 よくある文字列の問題
ユーザー Konton7Konton7
提出日時 2019-05-22 10:33:30
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 28 ms / 5,000 ms
コード長 347 bytes
コンパイル時間 104 ms
コンパイル使用メモリ 11,936 KB
実行使用メモリ 10,096 KB
最終ジャッジ日時 2023-10-17 11:08:11
合計ジャッジ時間 1,381 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 27 ms
10,012 KB
testcase_01 AC 27 ms
10,012 KB
testcase_02 AC 28 ms
10,056 KB
testcase_03 AC 27 ms
10,012 KB
testcase_04 AC 28 ms
10,096 KB
testcase_05 AC 28 ms
10,056 KB
testcase_06 AC 28 ms
10,096 KB
testcase_07 AC 27 ms
10,032 KB
testcase_08 AC 27 ms
10,016 KB
testcase_09 AC 27 ms
10,012 KB
testcase_10 AC 27 ms
10,012 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

s = input()


def edge_swap(instr,n):
	if n == 1:
		outstr = instr
	elif  n == 2:
		outstr = [instr[0],instr[0][::-1]]
	else:
		a, b, c, d = instr[0][0], instr[0][-1], instr[0][1:], instr[0][:-1]
		outstr = [ a+i for i in edge_swap([c],n-1) ] + [ b+i for i in edge_swap([d],n-1) ]

	return outstr

	
	

print(len(list(set(edge_swap([s],len(s))))))
0