結果

問題 No.1272 珍しい級数
ユーザー face4
提出日時 2020-10-31 16:22:04
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 398 bytes
コンパイル時間 610 ms
コンパイル使用メモリ 74,332 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-07-22 05:04:14
合計ジャッジ時間 1,960 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 50
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
#include<iomanip>
#include<cmath>
using namespace std;

int main(){
    double d = 0;
    int k;
    cin >> k;
    if(k == 0){
        cout << 0 << endl;
        return 0;
    }
    for(int i = 1; i <= 9; i++){
        double tmp = sin(i*k);
        for(int j = 1; j <= i; j++) tmp /= i;
        d += tmp;
    }
    cout << fixed << setprecision(12) << d << endl;
    return 0;
}
0