結果

問題 No.567 コンプリート
ユーザー kappybarkappybar
提出日時 2020-05-14 15:47:45
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 124 ms / 2,000 ms
コード長 637 bytes
コンパイル時間 2,021 ms
コンパイル使用メモリ 166,712 KB
実行使用メモリ 4,352 KB
最終ジャッジ日時 2023-10-13 11:05:08
合計ジャッジ時間 2,419 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,352 KB
testcase_01 AC 2 ms
4,348 KB
testcase_02 AC 1 ms
4,352 KB
testcase_03 AC 1 ms
4,348 KB
testcase_04 AC 1 ms
4,348 KB
testcase_05 AC 2 ms
4,352 KB
testcase_06 AC 2 ms
4,352 KB
testcase_07 AC 1 ms
4,352 KB
testcase_08 AC 2 ms
4,348 KB
testcase_09 AC 1 ms
4,348 KB
testcase_10 AC 2 ms
4,352 KB
testcase_11 AC 2 ms
4,348 KB
testcase_12 AC 2 ms
4,348 KB
testcase_13 AC 2 ms
4,352 KB
testcase_14 AC 1 ms
4,348 KB
testcase_15 AC 124 ms
4,348 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(int)(n);i++)
using namespace std;
using ll = long long ;
using P = pair<int,int> ;
using pll = pair<long long,long long>;
constexpr int INF = 1e9;
constexpr long long LINF = 1e17;
constexpr int MOD = 1000000007;

int main(){
    int n;
    cin >> n;
    vector<double> C = {6,15,20,15,6};
    vector<double> res(5,1.0);
    rep(i,n)rep(j,5){
        res[j] *= (j+1)/6.0;
    }

    double ans = 0;
    for(int i=1;i<=6;i++){
        if(i%2==0) ans -= C[i-1] * res[i-1];
        else  ans += C[i-1] * res[i-1];
    }
    cout << setprecision(20) << 1 - ans << endl;
    return 0;
}
0