結果

問題 No.1385 Simple Geometry 2
ユーザー pockynypockyny
提出日時 2021-02-14 15:11:26
言語 C++17
(gcc 13.2.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 662 bytes
コンパイル時間 1,555 ms
コンパイル使用メモリ 78,188 KB
実行使用メモリ 11,940 KB
最終ジャッジ日時 2023-09-29 05:18:51
合計ジャッジ時間 41,809 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,376 KB
testcase_01 AC 2 ms
4,380 KB
testcase_02 AC 2 ms
4,500 KB
testcase_03 AC 2 ms
4,376 KB
testcase_04 AC 2 ms
4,376 KB
testcase_05 AC 2 ms
4,376 KB
testcase_06 AC 2 ms
4,380 KB
testcase_07 AC 2 ms
4,380 KB
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 TLE -
testcase_14 TLE -
testcase_15 TLE -
testcase_16 TLE -
testcase_17 TLE -
testcase_18 TLE -
testcase_19 WA -
testcase_20 TLE -
testcase_21 TLE -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 TLE -
testcase_28 WA -
testcase_29 TLE -
testcase_30 WA -
testcase_31 TLE -
testcase_32 WA -
testcase_33 TLE -
testcase_34 TLE -
testcase_35 TLE -
testcase_36 WA -
testcase_37 TLE -
testcase_38 TLE -
testcase_39 TLE -
testcase_40 TLE -
testcase_41 TLE -
testcase_42 WA -
testcase_43 TLE -
testcase_44 TLE -
testcase_45 TLE -
testcase_46 TLE -
testcase_47 TLE -
testcase_48 TLE -
testcase_49 TLE -
testcase_50 TLE -
testcase_51 TLE -
testcase_52 TLE -
testcase_53 TLE -
testcase_54 TLE -
testcase_55 TLE -
testcase_56 WA -
testcase_57 TLE -
testcase_58 TLE -
testcase_59 WA -
testcase_60 WA -
testcase_61 WA -
testcase_62 WA -
testcase_63 TLE -
testcase_64 TLE -
testcase_65 TLE -
testcase_66 TLE -
testcase_67 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <cmath>
using namespace std;
typedef long double ld;
ld t[500010],pi = acos(-1);
int main(){
    cout.precision(20);
    int i,n; ld l;
    cin >> n >> l;
    for(i=0;i<n;i++) cin >> t[i];
    ld s = 0,c = 0,ans = 0;
    ld ans2 = 0;
    for(i=n - 1;i>=0;i--){
        ans += ld(n + 2*i)*(s*cos(2*pi*t[i]/l) - c*sin(2*pi*t[i]/l));
        s += sin(2*pi*t[i]/l); c += cos(2*pi*t[i]/l);
    }
    s = 0; c = 0;
    for(i=0;i<n;i++){
        ans += ld(2*i)*(s*cos(2*pi*t[i]/l) - c*sin(2*pi*t[i]/l));
        s += sin(2*pi*t[i]/l); c += cos(2*pi*t[i]/l);
    }
    ans *= 3;
    ans /= (ld)(n*(n - 1)*(n - 2));
    cout << ans << endl;
}
0