結果
問題 |
No.567 コンプリート
|
ユーザー |
![]() |
提出日時 | 2018-02-21 23:41:52 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
TLE
|
実行時間 | - |
コード長 | 841 bytes |
コンパイル時間 | 491 ms |
コンパイル使用メモリ | 62,840 KB |
実行使用メモリ | 174,720 KB |
最終ジャッジ日時 | 2024-09-21 15:23:54 |
合計ジャッジ時間 | 4,203 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 11 TLE * 1 |
ソースコード
#include <iostream> #include <iomanip> #include <bitset> using namespace std; double prop[1000010][1 << 6]; int main() { int N; cin >> N; prop[0][0] = 1; for (int i = 0; i < N; i++) { for (int mask = 0; mask < (1 << 6); mask++) { for (int d = 0; d < 6; d++) { if ((mask >> d) & 1) { prop[i + 1][mask] += prop[i][mask & ~(1 << d)] / 6.0; prop[i + 1][mask] += prop[i][mask] / 6.0; } } } } cout << fixed << setprecision(10) << prop[N][(1 << 6) - 1] << endl; /* for (int i = 0; i < N; i++) { for (int mask = 0; mask < (1 << 6); mask++) { bitset<6> bits(mask); cerr << i + 1 << " " << bits << " " << prop[i + 1][mask] << endl; } } */ return 0; }