結果
| 問題 |
No.65 回数の期待値の練習
|
| コンテスト | |
| ユーザー |
ninoinui
|
| 提出日時 | 2020-09-07 11:34:19 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 62 ms / 5,000 ms |
| コード長 | 293 bytes |
| コンパイル時間 | 2,445 ms |
| コンパイル使用メモリ | 194,444 KB |
| 最終ジャッジ日時 | 2025-01-14 08:09:29 |
|
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 16 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
int main() {
int K;
cin >> K;
random_device rd;
mt19937 mt(rd());
int cnt = 0;
for (int i = 1e6; i; i--) {
int tmp = 0;
while (tmp < K) tmp += mt() % 6 + 1, cnt++;
}
cout << fixed << setprecision(2) << cnt / 1e6 << "\n";
}
ninoinui