結果

問題 No.1385 Simple Geometry 2
ユーザー convexineq
提出日時 2021-02-07 23:23:38
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 290 ms / 500 ms
コード長 272 bytes
コンパイル時間 1,691 ms
コンパイル使用メモリ 82,080 KB
実行使用メモリ 174,944 KB
最終ジャッジ日時 2024-07-04 18:11:50
合計ジャッジ時間 20,451 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 65
権限があれば一括ダウンロードができます

ソースコード

diff #

from math import cos,sin,pi
n,L = map(int,input().split())
*a, = map(int,input().split())
w = 2*pi/L

ans = 0j
x = y = v = 0
for j in range(n):
    x += v
    y += (j-1)*v*2
    v = cos(-w*a[j]) + 1j*sin(-w*a[j])
    ans += (x*(n-2*j)+y)/v

print(ans.imag*3/n/(n-1)/(n-2))
0