結果

問題 No.75 回数の期待値の問題
ユーザー BantakoBantako
提出日時 2017-08-08 23:38:39
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 381 bytes
コンパイル時間 1,636 ms
コンパイル使用メモリ 162,552 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-04-20 05:18:24
合計ジャッジ時間 2,924 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 22 ms
5,248 KB
testcase_01 AC 22 ms
5,376 KB
testcase_02 AC 22 ms
5,376 KB
testcase_03 AC 22 ms
5,376 KB
testcase_04 AC 23 ms
5,376 KB
testcase_05 AC 22 ms
5,376 KB
testcase_06 AC 23 ms
5,376 KB
testcase_07 AC 23 ms
5,376 KB
testcase_08 AC 22 ms
5,376 KB
testcase_09 AC 23 ms
5,376 KB
testcase_10 AC 22 ms
5,376 KB
testcase_11 AC 23 ms
5,376 KB
testcase_12 AC 23 ms
5,376 KB
testcase_13 AC 23 ms
5,376 KB
testcase_14 AC 22 ms
5,376 KB
testcase_15 AC 22 ms
5,376 KB
testcase_16 AC 23 ms
5,376 KB
testcase_17 AC 22 ms
5,376 KB
testcase_18 AC 22 ms
5,376 KB
testcase_19 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp:6:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    6 | main(){
      | ^~~~

ソースコード

diff #

#include<bits/stdc++.h>
typedef long long ll;
using namespace std;
int INF = 1e9;
int MOD = 1e9+7;
main(){
    int K;
    ll sum = 0,cnt = 0;
    cin >> K;
    while(sum < 1000000){
        int num = 0;
        while(num != K){
            num += rand() % 6 + 1;
            if(num > K)num = 0;
            sum++;
        }
        cnt++;
    }
    cout << 1.* sum / cnt << endl;
}
0