結果

問題 No.2971 無理積分
ユーザー GOTKAKO
提出日時 2024-11-29 21:36:04
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 25 ms / 1,000 ms
コード長 403 bytes
コンパイル時間 2,028 ms
コンパイル使用メモリ 194,144 KB
最終ジャッジ日時 2025-02-26 09:14:09
ジャッジサーバーID
(参考情報)
judge2 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 36
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);

    double N; cin >> N;
    N = N*N*N;

    double answer = 0,dx = 0.000001,back = sqrt(N);
    for(double x=0; x<1; x+=dx){
        double next = sqrt(x*x*x+N);
        answer += (back+next)/2*dx;
        back = next;
    }
    cout << fixed << setprecision(20) << answer << endl;
}
0