結果
| 問題 |
No.567 コンプリート
|
| コンテスト | |
| ユーザー |
とばり
|
| 提出日時 | 2018-09-09 04:03:07 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 248 ms / 2,000 ms |
| コード長 | 539 bytes |
| コンパイル時間 | 1,936 ms |
| コンパイル使用メモリ | 166,224 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-12-23 02:30:47 |
| 合計ジャッジ時間 | 2,977 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 12 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
using int64 = long long;
using uint64 = unsigned long long;
double prop[7];
int main()
{
cin.tie(nullptr);
ios::sync_with_stdio(false);
int N;
cin >> N;
prop[1] = 1;
for (int i = 0; i < N - 1; i++)
{
for (int num = 6; num >= 1; num--)
{
prop[num] = (num / 6.0) * prop[num];
prop[num] += (1.0 - (num - 1) / 6.0) * prop[num - 1];
}
}
cout << fixed << setprecision(10) << prop[6] << endl;
return 0;
}
とばり