結果
| 問題 |
No.1539 不可欠な部分
|
| コンテスト | |
| ユーザー |
57tggx
|
| 提出日時 | 2021-06-06 11:54:14 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 504 ms / 2,000 ms |
| コード長 | 743 bytes |
| コンパイル時間 | 913 ms |
| コンパイル使用メモリ | 89,668 KB |
| 最終ジャッジ日時 | 2025-01-22 03:54:47 |
|
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 20 |
ソースコード
#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;
}
}
57tggx