結果
| 問題 |
No.2976 高階多点評価
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-02-05 21:27:37 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 312 ms / 1,000 ms |
| コード長 | 392 bytes |
| コンパイル時間 | 2,136 ms |
| コンパイル使用メモリ | 194,732 KB |
| 最終ジャッジ日時 | 2025-02-19 01:54:35 |
|
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 38 |
ソースコード
#define _CRT_SECURE_NO_WARNINGS
#include <bits/stdc++.h>
using namespace std;
int main() {
int T;
cin >> T;
while (T--) {
int n; double x;
cin >> n >> x;
complex<double> xp(x, 1), xn(x, -1), I(0, 1);
auto res = pow(-1, n) * (pow(xn, -n - 1) - pow(xp, -n - 1)) / (2. * I);
res *= pow(x * x + 1, n / 2. + 1);
cout << fixed << setprecision(5) << res.real() << endl;
}
}