結果

問題 No.567 コンプリート
ユーザー startcppstartcpp
提出日時 2017-09-12 15:02:57
言語 C
(gcc 12.3.0)
結果
WA  
実行時間 -
コード長 323 bytes
コンパイル時間 346 ms
コンパイル使用メモリ 30,336 KB
実行使用メモリ 56,704 KB
最終ジャッジ日時 2024-04-25 07:05:54
合計ジャッジ時間 1,217 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <stdio.h>

int n;
double dp[1000001][7];

int main() {
	scanf("%d", &n);
	
	dp[0][0] = 1;
	for (int i = 0; i < n; i++) {
		for (int j = 0; j <= 6; j++) {
			dp[i + 1][j] = dp[i][j] * j / 6.0;
			if (j < 6) {
				dp[i + 1][j + 1] = dp[i][j] * (6.0 - j) / 6.0;
			}
		}
	}

	printf("%.14f\n", dp[n][6]);
	return 0;
}
0