結果

問題 No.1385 Simple Geometry 2
ユーザー MitarushiMitarushi
提出日時 2021-02-03 17:24:23
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 215 ms / 500 ms
コード長 484 bytes
コンパイル時間 1,212 ms
コンパイル使用メモリ 86,708 KB
実行使用メモリ 150,764 KB
最終ジャッジ日時 2023-09-17 18:38:29
合計ジャッジ時間 18,617 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 71 ms
71,760 KB
testcase_01 AC 71 ms
71,500 KB
testcase_02 AC 71 ms
71,780 KB
testcase_03 AC 73 ms
71,732 KB
testcase_04 AC 73 ms
71,840 KB
testcase_05 AC 74 ms
71,784 KB
testcase_06 AC 72 ms
71,776 KB
testcase_07 AC 75 ms
71,836 KB
testcase_08 AC 87 ms
76,996 KB
testcase_09 AC 82 ms
76,968 KB
testcase_10 AC 84 ms
77,060 KB
testcase_11 AC 83 ms
76,988 KB
testcase_12 AC 82 ms
77,296 KB
testcase_13 AC 211 ms
140,092 KB
testcase_14 AC 213 ms
140,748 KB
testcase_15 AC 214 ms
141,960 KB
testcase_16 AC 214 ms
140,960 KB
testcase_17 AC 212 ms
140,668 KB
testcase_18 AC 212 ms
141,196 KB
testcase_19 AC 211 ms
141,512 KB
testcase_20 AC 213 ms
142,124 KB
testcase_21 AC 213 ms
141,848 KB
testcase_22 AC 208 ms
145,400 KB
testcase_23 AC 209 ms
140,156 KB
testcase_24 AC 210 ms
146,864 KB
testcase_25 AC 210 ms
145,304 KB
testcase_26 AC 212 ms
141,000 KB
testcase_27 AC 213 ms
141,192 KB
testcase_28 AC 212 ms
145,764 KB
testcase_29 AC 213 ms
141,268 KB
testcase_30 AC 215 ms
141,884 KB
testcase_31 AC 213 ms
141,428 KB
testcase_32 AC 211 ms
139,972 KB
testcase_33 AC 213 ms
141,732 KB
testcase_34 AC 213 ms
141,028 KB
testcase_35 AC 214 ms
141,492 KB
testcase_36 AC 211 ms
140,188 KB
testcase_37 AC 211 ms
141,472 KB
testcase_38 AC 211 ms
140,748 KB
testcase_39 AC 211 ms
141,564 KB
testcase_40 AC 211 ms
141,808 KB
testcase_41 AC 212 ms
141,476 KB
testcase_42 AC 207 ms
141,024 KB
testcase_43 AC 208 ms
140,724 KB
testcase_44 AC 210 ms
141,476 KB
testcase_45 AC 212 ms
141,092 KB
testcase_46 AC 214 ms
140,560 KB
testcase_47 AC 214 ms
140,968 KB
testcase_48 AC 213 ms
141,048 KB
testcase_49 AC 212 ms
140,796 KB
testcase_50 AC 214 ms
140,240 KB
testcase_51 AC 212 ms
141,276 KB
testcase_52 AC 211 ms
141,572 KB
testcase_53 AC 211 ms
140,964 KB
testcase_54 AC 211 ms
140,948 KB
testcase_55 AC 212 ms
140,500 KB
testcase_56 AC 209 ms
140,388 KB
testcase_57 AC 212 ms
139,988 KB
testcase_58 AC 211 ms
141,088 KB
testcase_59 AC 202 ms
150,764 KB
testcase_60 AC 207 ms
144,584 KB
testcase_61 AC 204 ms
144,396 KB
testcase_62 AC 207 ms
145,716 KB
testcase_63 AC 212 ms
141,804 KB
testcase_64 AC 213 ms
141,200 KB
testcase_65 AC 212 ms
140,792 KB
testcase_66 AC 211 ms
140,308 KB
testcase_67 AC 212 ms
140,960 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from math import sin, cos, pi

n, l = map(int, input().split())
t = [2*pi * int(i) / l 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-1)
    a_cos += t_cos[i] * (i-1)

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