結果

問題 No.852 連続部分文字列
ユーザー NagisaNagisa
提出日時 2019-07-27 07:33:56
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 338 ms / 3,153 ms
コード長 255 bytes
コンパイル時間 479 ms
コンパイル使用メモリ 87,152 KB
実行使用メモリ 78,264 KB
最終ジャッジ日時 2023-09-15 05:48:14
合計ジャッジ時間 8,176 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 77 ms
71,232 KB
testcase_01 AC 76 ms
71,392 KB
testcase_02 AC 74 ms
71,352 KB
testcase_03 AC 74 ms
71,140 KB
testcase_04 AC 75 ms
71,280 KB
testcase_05 AC 79 ms
76,032 KB
testcase_06 AC 79 ms
75,812 KB
testcase_07 AC 79 ms
75,924 KB
testcase_08 AC 76 ms
71,180 KB
testcase_09 AC 74 ms
71,572 KB
testcase_10 AC 77 ms
75,920 KB
testcase_11 AC 71 ms
71,372 KB
testcase_12 AC 78 ms
75,896 KB
testcase_13 AC 84 ms
76,208 KB
testcase_14 AC 82 ms
75,884 KB
testcase_15 AC 87 ms
76,252 KB
testcase_16 AC 83 ms
75,884 KB
testcase_17 AC 85 ms
76,248 KB
testcase_18 AC 84 ms
76,276 KB
testcase_19 AC 79 ms
75,872 KB
testcase_20 AC 85 ms
76,116 KB
testcase_21 AC 85 ms
76,160 KB
testcase_22 AC 82 ms
76,264 KB
testcase_23 AC 86 ms
76,296 KB
testcase_24 AC 84 ms
76,276 KB
testcase_25 AC 84 ms
76,232 KB
testcase_26 AC 84 ms
76,244 KB
testcase_27 AC 83 ms
75,836 KB
testcase_28 AC 84 ms
76,120 KB
testcase_29 AC 86 ms
75,880 KB
testcase_30 AC 81 ms
76,116 KB
testcase_31 AC 87 ms
76,256 KB
testcase_32 AC 87 ms
76,152 KB
testcase_33 AC 241 ms
78,216 KB
testcase_34 AC 241 ms
77,972 KB
testcase_35 AC 242 ms
77,940 KB
testcase_36 AC 242 ms
78,132 KB
testcase_37 AC 242 ms
78,264 KB
testcase_38 AC 241 ms
78,036 KB
testcase_39 AC 327 ms
78,108 KB
testcase_40 AC 241 ms
78,108 KB
testcase_41 AC 241 ms
78,256 KB
testcase_42 AC 338 ms
78,248 KB
testcase_43 AC 245 ms
78,184 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

A = "abcdefghijklmnopqrstuvwxyz"
S = input()
l = len(S)

def f(n):
    return (n*(n+1))//2

ans = 26*f(l)

for e in A:
    t = 0
    for k in range(l):
        if S[k] == e:
            ans -= f(k-t)
            t = k+1
    ans -= f(l-t)

print(ans/f(l))
0