結果
| 問題 | No.852 連続部分文字列 |
| コンテスト | |
| ユーザー |
convexineq
|
| 提出日時 | 2021-03-26 05:06:29 |
| 言語 | PyPy3 (7.3.23 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 105 ms / 3,153 ms |
| + 318µs | |
| コード長 | 241 bytes |
| 記録 | |
| コンパイル時間 | 82 ms |
| コンパイル使用メモリ | 80,896 KB |
| 実行使用メモリ | 182,060 KB |
| 最終ジャッジ日時 | 2026-09-30 22:00:25 |
| 合計ジャッジ時間 | 5,125 ms |
|
ジャッジサーバーID (参考情報) |
judge4_0 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 41 |
ソースコード
*s, = map(ord,input())
n = len(s)
cnt = 26*n*(n+1)//2
res = [-1]*26
for i,si in enumerate(s):
si -= 97
cnt -= (i-res[si])*(i-res[si]-1)//2
res[si] = i
for i in range(26):
cnt -= (n-res[i])*(n-res[i]-1)//2
print(cnt*2/n/(n+1))
convexineq