結果

問題 No.65 回数の期待値の練習
ユーザー ninoinuininoinui
提出日時 2020-09-07 11:34:19
言語 C++17
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 70 ms / 5,000 ms
コード長 293 bytes
コンパイル時間 2,079 ms
コンパイル使用メモリ 199,788 KB
実行使用メモリ 4,388 KB
最終ジャッジ日時 2023-08-19 16:31:57
合計ジャッジ時間 4,213 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 11 ms
4,380 KB
testcase_01 AC 16 ms
4,384 KB
testcase_02 AC 20 ms
4,380 KB
testcase_03 AC 33 ms
4,384 KB
testcase_04 AC 25 ms
4,380 KB
testcase_05 AC 27 ms
4,380 KB
testcase_06 AC 29 ms
4,384 KB
testcase_07 AC 37 ms
4,380 KB
testcase_08 AC 38 ms
4,384 KB
testcase_09 AC 42 ms
4,380 KB
testcase_10 AC 45 ms
4,384 KB
testcase_11 AC 48 ms
4,380 KB
testcase_12 AC 51 ms
4,380 KB
testcase_13 AC 54 ms
4,380 KB
testcase_14 AC 56 ms
4,384 KB
testcase_15 AC 59 ms
4,380 KB
testcase_16 AC 62 ms
4,380 KB
testcase_17 AC 65 ms
4,380 KB
testcase_18 AC 67 ms
4,388 KB
testcase_19 AC 70 ms
4,384 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#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";
}
0