結果

問題 No.1385 Simple Geometry 2
ユーザー MitarushiMitarushi
提出日時 2021-02-03 19:00:06
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 220 ms / 500 ms
コード長 484 bytes
コンパイル時間 426 ms
コンパイル使用メモリ 86,752 KB
実行使用メモリ 150,568 KB
最終ジャッジ日時 2023-09-17 18:31:43
合計ジャッジ時間 18,134 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
71,760 KB
testcase_01 AC 74 ms
71,756 KB
testcase_02 AC 78 ms
71,736 KB
testcase_03 AC 74 ms
71,944 KB
testcase_04 AC 74 ms
71,920 KB
testcase_05 AC 73 ms
71,716 KB
testcase_06 AC 75 ms
71,828 KB
testcase_07 AC 73 ms
71,688 KB
testcase_08 AC 86 ms
76,976 KB
testcase_09 AC 85 ms
77,008 KB
testcase_10 AC 84 ms
77,512 KB
testcase_11 AC 85 ms
77,004 KB
testcase_12 AC 83 ms
77,276 KB
testcase_13 AC 213 ms
139,036 KB
testcase_14 AC 212 ms
140,392 KB
testcase_15 AC 209 ms
140,540 KB
testcase_16 AC 209 ms
140,612 KB
testcase_17 AC 210 ms
140,428 KB
testcase_18 AC 211 ms
140,688 KB
testcase_19 AC 213 ms
140,568 KB
testcase_20 AC 213 ms
140,360 KB
testcase_21 AC 213 ms
140,020 KB
testcase_22 AC 207 ms
143,804 KB
testcase_23 AC 212 ms
140,472 KB
testcase_24 AC 212 ms
144,464 KB
testcase_25 AC 210 ms
144,588 KB
testcase_26 AC 211 ms
140,408 KB
testcase_27 AC 210 ms
140,244 KB
testcase_28 AC 207 ms
144,452 KB
testcase_29 AC 217 ms
140,712 KB
testcase_30 AC 213 ms
140,360 KB
testcase_31 AC 209 ms
140,120 KB
testcase_32 AC 220 ms
140,432 KB
testcase_33 AC 213 ms
140,564 KB
testcase_34 AC 216 ms
140,272 KB
testcase_35 AC 214 ms
140,496 KB
testcase_36 AC 218 ms
140,300 KB
testcase_37 AC 210 ms
140,556 KB
testcase_38 AC 211 ms
140,496 KB
testcase_39 AC 209 ms
140,496 KB
testcase_40 AC 212 ms
140,496 KB
testcase_41 AC 209 ms
140,496 KB
testcase_42 AC 210 ms
140,688 KB
testcase_43 AC 211 ms
140,008 KB
testcase_44 AC 211 ms
140,372 KB
testcase_45 AC 211 ms
140,448 KB
testcase_46 AC 213 ms
140,244 KB
testcase_47 AC 216 ms
140,208 KB
testcase_48 AC 212 ms
140,268 KB
testcase_49 AC 211 ms
140,708 KB
testcase_50 AC 210 ms
140,004 KB
testcase_51 AC 210 ms
140,296 KB
testcase_52 AC 210 ms
140,524 KB
testcase_53 AC 211 ms
140,400 KB
testcase_54 AC 209 ms
140,464 KB
testcase_55 AC 213 ms
140,456 KB
testcase_56 AC 210 ms
140,524 KB
testcase_57 AC 212 ms
140,188 KB
testcase_58 AC 213 ms
140,248 KB
testcase_59 AC 205 ms
150,568 KB
testcase_60 AC 210 ms
144,552 KB
testcase_61 AC 210 ms
144,920 KB
testcase_62 AC 207 ms
144,540 KB
testcase_63 AC 216 ms
140,300 KB
testcase_64 AC 216 ms
140,560 KB
testcase_65 AC 213 ms
140,044 KB
testcase_66 AC 210 ms
140,444 KB
testcase_67 AC 211 ms
140,368 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from math import sin, cos, pi

n, l = map(int, input().split())
r = 2 * pi / l
t = [r * int(i) for i in input().split()]
t_sin = [sin(i) for i in t]
t_cos = [cos(i) for i in t]

a_sin = 0
a_cos = 0
for i in range(n):
    a_sin += t_sin[i] * i
    a_cos += t_cos[i] * i

b_sin = sum(t_sin)
b_cos = sum(t_cos)

ans = 0
for i in range(n):
    ans += t_sin[i] * a_cos - t_cos[i] * a_sin
    a_sin += n * t_sin[i] - b_sin
    a_cos += n * t_cos[i] - b_cos

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