結果

問題 No.852 連続部分文字列
ユーザー 👑 KazunKazun
提出日時 2021-03-09 04:48:48
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 124 ms / 3,153 ms
コード長 177 bytes
コンパイル時間 342 ms
コンパイル使用メモリ 81,964 KB
実行使用メモリ 77,440 KB
最終ジャッジ日時 2024-04-19 01:37:50
合計ジャッジ時間 4,635 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 42 ms
53,632 KB
testcase_01 AC 43 ms
54,016 KB
testcase_02 AC 42 ms
53,248 KB
testcase_03 AC 42 ms
54,140 KB
testcase_04 AC 41 ms
53,504 KB
testcase_05 AC 42 ms
54,016 KB
testcase_06 AC 43 ms
53,888 KB
testcase_07 AC 41 ms
53,760 KB
testcase_08 AC 42 ms
53,504 KB
testcase_09 AC 42 ms
53,504 KB
testcase_10 AC 43 ms
53,504 KB
testcase_11 AC 43 ms
53,504 KB
testcase_12 AC 42 ms
53,504 KB
testcase_13 AC 48 ms
61,312 KB
testcase_14 AC 52 ms
60,416 KB
testcase_15 AC 49 ms
62,080 KB
testcase_16 AC 48 ms
61,312 KB
testcase_17 AC 49 ms
61,696 KB
testcase_18 AC 49 ms
62,336 KB
testcase_19 AC 47 ms
60,160 KB
testcase_20 AC 49 ms
60,928 KB
testcase_21 AC 49 ms
62,464 KB
testcase_22 AC 47 ms
61,056 KB
testcase_23 AC 48 ms
61,568 KB
testcase_24 AC 48 ms
60,800 KB
testcase_25 AC 48 ms
61,568 KB
testcase_26 AC 48 ms
62,208 KB
testcase_27 AC 48 ms
61,312 KB
testcase_28 AC 48 ms
62,080 KB
testcase_29 AC 49 ms
62,464 KB
testcase_30 AC 47 ms
60,288 KB
testcase_31 AC 49 ms
62,848 KB
testcase_32 AC 49 ms
62,592 KB
testcase_33 AC 112 ms
77,312 KB
testcase_34 AC 112 ms
77,440 KB
testcase_35 AC 113 ms
77,184 KB
testcase_36 AC 124 ms
77,440 KB
testcase_37 AC 116 ms
77,404 KB
testcase_38 AC 113 ms
77,440 KB
testcase_39 AC 111 ms
77,252 KB
testcase_40 AC 113 ms
77,252 KB
testcase_41 AC 114 ms
77,312 KB
testcase_42 AC 110 ms
77,312 KB
testcase_43 AC 111 ms
77,440 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import defaultdict
S=input()

N=len(S)
R=defaultdict(int)
R_sum=0
X=0
for i,s in enumerate(S,1):
    R_sum+=i-R[s]
    R[s]=i
    X+=R_sum
print(X/(N*(N+1)//2))
0