結果

問題 No.1385 Simple Geometry 2
ユーザー 沙耶花沙耶花
提出日時 2021-02-07 23:23:13
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
TLE  
実行時間 -
コード長 743 bytes
コンパイル時間 2,080 ms
コンパイル使用メモリ 199,944 KB
実行使用メモリ 15,732 KB
最終ジャッジ日時 2023-09-18 01:06:04
合計ジャッジ時間 7,824 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ(β)

テストケース

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

ソースコード

diff #

#include <stdio.h>
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define Inf 1000000001

int main(){
	
	int N;
	cin>>N;
	
	long long L;
	cin>>L;
	
	double PI = acos(-1.0);
	
	vector<double> x(N),y(N);
	rep(i,N){
		long long T;
		scanf("%lld",&T);
		
		x[i] = cos(PI * 2.0 / L * T);
		y[i] = sin(PI * 2.0 / L * T);
	}
	
	double ans = 0.0;

	rep(i,N){

		double sp = 0.0,cp = 0.0;
		int cntp = 0;
		int jj = i;
		rep(j,N-1){
			jj++;
			if(jj>=N)break;
			double ss = y[jj]-y[i];
			double cc = x[jj]-x[i];
			ans += ss*cp;
			ans -= cc*sp;
			sp += ss;
			cp += cc;
		}
	}
	
	ans /= N;
	ans /= N-1;
	ans /= N-2;
	ans *= 6.0;
	ans /= 2.0;
	
	cout<<fixed<<setprecision(12)<<ans<<endl;
	
	return 0;
}
0