結果

問題 No.567 コンプリート
ユーザー __DielsAlder____DielsAlder__
提出日時 2019-01-17 17:38:35
言語 C++11
(gcc 11.4.0)
結果
TLE  
実行時間 -
コード長 546 bytes
コンパイル時間 486 ms
コンパイル使用メモリ 68,428 KB
実行使用メモリ 113,024 KB
最終ジャッジ日時 2023-09-14 02:03:32
合計ジャッジ時間 4,354 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 30 ms
112,960 KB
testcase_01 AC 29 ms
112,844 KB
testcase_02 AC 30 ms
113,024 KB
testcase_03 AC 29 ms
112,976 KB
testcase_04 AC 29 ms
112,960 KB
testcase_05 AC 28 ms
112,976 KB
testcase_06 AC 29 ms
112,856 KB
testcase_07 AC 30 ms
112,848 KB
testcase_08 AC 29 ms
112,908 KB
testcase_09 AC 30 ms
112,856 KB
testcase_10 AC 29 ms
112,900 KB
testcase_11 AC 28 ms
112,908 KB
testcase_12 AC 30 ms
112,948 KB
testcase_13 AC 29 ms
112,948 KB
testcase_14 AC 29 ms
112,896 KB
testcase_15 TLE -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
#include<algorithm>
#include<string>
#include<cstdlib>
#include<map>
#include<iomanip>
#include<sstream>
using namespace std;


int main() {
	long long int n,sum=0,v;
	long double sai[1000050][7] = {};
	cin >> n;
	if (n > 10000) {
		cout << "0.99999999999999"<<endl;
	}
	sai[0][0] = 1;
	for (int i = 1; i <= n; i++) {
		for (int j = 0; j <= 5; j++) {
			sai[i][j] += sai[i - 1][j] * (j) / 6;
			sai[i][j + 1] += sai[i - 1][j] * (6 - j) / 6;
		}
		sai[i][6] += sai[i - 1][6];
	}
	cout << setprecision(15) << sai[n][6]<<endl;
}

0