結果

問題 No.852 連続部分文字列
ユーザー kekurekekure
提出日時 2019-08-05 09:37:10
言語 PyPy3
(7.3.13)
結果
TLE  
実行時間 -
コード長 286 bytes
コンパイル時間 1,526 ms
コンパイル使用メモリ 86,856 KB
実行使用メモリ 80,548 KB
最終ジャッジ日時 2023-09-25 15:53:51
合計ジャッジ時間 9,410 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 70 ms
71,272 KB
testcase_01 AC 69 ms
71,208 KB
testcase_02 AC 70 ms
71,144 KB
testcase_03 AC 70 ms
71,444 KB
testcase_04 AC 69 ms
71,152 KB
testcase_05 AC 86 ms
75,732 KB
testcase_06 AC 75 ms
75,528 KB
testcase_07 AC 77 ms
75,648 KB
testcase_08 AC 71 ms
71,152 KB
testcase_09 AC 69 ms
70,900 KB
testcase_10 AC 76 ms
75,728 KB
testcase_11 AC 71 ms
71,232 KB
testcase_12 AC 75 ms
75,820 KB
testcase_13 TLE -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
testcase_30 -- -
testcase_31 -- -
testcase_32 -- -
testcase_33 -- -
testcase_34 -- -
testcase_35 -- -
testcase_36 -- -
testcase_37 -- -
testcase_38 -- -
testcase_39 -- -
testcase_40 -- -
testcase_41 -- -
testcase_42 -- -
testcase_43 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

s = input()
l = len(s)
k = 0  # 文字の種類
b = 0  # 部分文字列の数
for i in range(l):
    k += 1
    b += 1
    t = 1  # 直前の文字の種類数
    for j in range(i + 1, l):
        b += 1
        if not s[j] in s[i: j]:
            t += 1
        k += t

print(k / b)
0