結果

問題 No.52 よくある文字列の問題
ユーザー bellangeldindonbellangeldindon
提出日時 2019-05-08 11:39:49
言語 Python2
(2.7.18)
結果
AC  
実行時間 25 ms / 5,000 ms
コード長 529 bytes
コンパイル時間 71 ms
コンパイル使用メモリ 6,740 KB
実行使用メモリ 6,168 KB
最終ジャッジ日時 2023-09-14 17:18:36
合計ジャッジ時間 1,072 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 11 ms
5,964 KB
testcase_01 AC 13 ms
5,944 KB
testcase_02 AC 18 ms
6,060 KB
testcase_03 AC 12 ms
5,860 KB
testcase_04 AC 25 ms
5,980 KB
testcase_05 AC 18 ms
5,964 KB
testcase_06 AC 23 ms
6,168 KB
testcase_07 AC 16 ms
6,012 KB
testcase_08 AC 12 ms
6,028 KB
testcase_09 AC 12 ms
5,948 KB
testcase_10 AC 11 ms
6,004 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

S = raw_input()
slist = []
for i in range(0, len(S)):
	slist.append(S[i])
stack = [[[], slist]]
memo = [slist]
while stack != []:
	now = stack.pop(-1)
	if now[1] != []:
		a = []
		b = []
		for i in range(0, len(now[0])):
			a.append(now[0][i])
			b.append(now[0][i])
		s1 = []
		s2 = []
		for i in range(0, len(now[1])):
			s1.append(now[1][i])
			s2.append(now[1][i])
		a.append(s1.pop(0))
		b.append(s2.pop(-1))
		stack.append([a, s1])
		stack.append([b, s2])
	else:
		if now[0] not in memo: memo.append(now[0])
print len(memo)
0