結果
問題 |
No.852 連続部分文字列
|
ユーザー |
![]() |
提出日時 | 2019-08-05 10:14:41 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 250 bytes |
コンパイル時間 | 254 ms |
コンパイル使用メモリ | 82,560 KB |
実行使用メモリ | 263,448 KB |
最終ジャッジ日時 | 2024-07-18 13:12:53 |
合計ジャッジ時間 | 7,546 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | WA * 30 TLE * 1 -- * 10 |
ソースコード
s = input() l = len(s) m = [0] * l m[-1] = 1 t = 1 # 直前の文字の種類数 for i in range(l - 2, -1, -1): if not s[i] in s[i + 1: l]: t += 1 m[i] = t x = 0 for i in range(l): x += m[i] * (i + 1) print(2 * x / (l + l * l))