結果

問題 No.52 よくある文字列の問題
ユーザー syunsukesyunsuke
提出日時 2020-09-19 11:48:32
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 17 ms / 5,000 ms
コード長 290 bytes
コンパイル時間 73 ms
コンパイル使用メモリ 10,712 KB
実行使用メモリ 8,156 KB
最終ジャッジ日時 2023-09-05 14:05:45
合計ジャッジ時間 921 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 17 ms
7,876 KB
testcase_01 AC 17 ms
7,756 KB
testcase_02 AC 15 ms
7,804 KB
testcase_03 AC 16 ms
7,948 KB
testcase_04 AC 17 ms
8,156 KB
testcase_05 AC 16 ms
7,728 KB
testcase_06 AC 17 ms
8,108 KB
testcase_07 AC 16 ms
7,820 KB
testcase_08 AC 16 ms
7,876 KB
testcase_09 AC 15 ms
7,944 KB
testcase_10 AC 15 ms
7,804 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

S=input()
D=[{}for i in range(len(S)+1)]
D[0][("",S)]=1
#print(D)
for i in range(1,len(S)+1):
    for k,v in D[i-1].items():
        K,V=k
        #D[i][v[0]+k]=v[1:]
        D[i][(K+V[0],V[1:])]=1
        #D[i][v[-1]+k]=v[:len(v)-1]
        D[i][(K+V[-1],V[:len(V)-1])]=1
print(len(D[-1]))
0