結果

問題 No.1539 不可欠な部分
ユーザー 57tggx57tggx
提出日時 2021-06-06 11:54:14
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 524 ms / 2,000 ms
コード長 743 bytes
コンパイル時間 1,437 ms
コンパイル使用メモリ 82,692 KB
実行使用メモリ 4,508 KB
最終ジャッジ日時 2023-08-14 19:49:16
合計ジャッジ時間 27,575 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,376 KB
testcase_01 AC 448 ms
4,376 KB
testcase_02 AC 513 ms
4,380 KB
testcase_03 AC 224 ms
4,388 KB
testcase_04 AC 192 ms
4,504 KB
testcase_05 AC 148 ms
4,384 KB
testcase_06 AC 254 ms
4,384 KB
testcase_07 AC 64 ms
4,508 KB
testcase_08 AC 143 ms
4,384 KB
testcase_09 AC 443 ms
4,380 KB
testcase_10 AC 468 ms
4,384 KB
testcase_11 AC 524 ms
4,384 KB
testcase_12 AC 504 ms
4,380 KB
testcase_13 AC 511 ms
4,384 KB
testcase_14 AC 509 ms
4,380 KB
testcase_15 AC 518 ms
4,384 KB
testcase_16 AC 518 ms
4,380 KB
testcase_17 AC 477 ms
4,380 KB
testcase_18 AC 506 ms
4,384 KB
testcase_19 AC 512 ms
4,504 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <iomanip>
#include <cmath>

double fnc(double x){
	return std::exp(std::cos(x));
}

constexpr double E = 2.7182818284590452353602874713526624977572470936999595749669676277240766303535475945713821785251664274;
constexpr double REC_E_PI_SQ = 0.0372739804171723022424089344791876134444808019989621640823907769743547772695024254310945085466479157;

double solve(double n){
	return (
		fnc(REC_E_PI_SQ / n) * 7
		+ fnc(REC_E_PI_SQ * 0.75 / n) * 32
		+ fnc(REC_E_PI_SQ * 0.5 / n) * 12
		+ fnc(REC_E_PI_SQ * 0.25 / n) * 32
		+ E * 7
	) * REC_E_PI_SQ / 90;
}

int main(){
	int t;
	std::cin >> t;
	for(int i = 0; i < t; ++i){
		double n;
		std::cin >> n;
		std::cout << std::setprecision(12) << solve(n) << std::endl;
	}
}
0