結果

問題 No.352 カード並べ
ユーザー convexineqconvexineq
提出日時 2021-01-18 05:17:11
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 76 ms / 2,000 ms
コード長 177 bytes
コンパイル時間 2,123 ms
コンパイル使用メモリ 86,736 KB
実行使用メモリ 71,492 KB
最終ジャッジ日時 2023-08-20 12:10:27
合計ジャッジ時間 1,591 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 63 ms
71,344 KB
testcase_01 AC 76 ms
71,296 KB
testcase_02 AC 66 ms
71,212 KB
testcase_03 AC 66 ms
71,344 KB
testcase_04 AC 64 ms
71,288 KB
testcase_05 AC 64 ms
71,196 KB
testcase_06 AC 64 ms
71,300 KB
testcase_07 AC 65 ms
71,492 KB
testcase_08 AC 66 ms
71,416 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

n = int(input())
ans = 2.0
for i in range(2,n):
    ans += 1*2/(i+1)
    ans += f(i)*(i-1)/(i+1)
print(ans)
0