結果

問題 No.2976 高階多点評価
ユーザー SSRS
提出日時 2024-11-29 23:05:56
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 367 ms / 1,000 ms
コード長 459 bytes
コンパイル時間 2,182 ms
コンパイル使用メモリ 196,248 KB
最終ジャッジ日時 2025-02-26 09:28:57
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 38
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
const int MAX = 200;
int main(){
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cout << fixed << setprecision(20);
  int T;
  cin >> T;
  for (int i = 0; i < T; i++){
    int N;
    double x;
    cin >> N >> x;
    cout << (complex<double>(0, -0.5) * (pow(complex<double>(x, -1), -(N + 1)) - pow(complex<double>(x, 1), -(N + 1)))).real() * pow(x * x + 1, (double) N / 2 + 1) * pow(-1, N) << endl;
  }
}
0