結果

問題 No.58 イカサマなサイコロ
ユーザー latte0119latte0119
提出日時 2016-01-23 18:55:27
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 872 bytes
コンパイル時間 1,579 ms
コンパイル使用メモリ 159,184 KB
実行使用メモリ 4,352 KB
最終ジャッジ日時 2023-10-21 13:50:30
合計ジャッジ時間 21,278 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 748 ms
4,348 KB
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 AC 2,148 ms
4,348 KB
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;

#define int long long

typedef pair<int,int>pint;
typedef vector<int>vint;
typedef vector<pint>vpint;
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define all(v) (v).begin(),(v).end()
#define rep(i,n) for(int i=0;i<(n);i++)
#define reps(i,f,n) for(int i=(f);i<(n);i++)
#define each(it,v) for(__typeof((v).begin()) it=(v).begin();it!=(v).end();it++)
template<class T,class U>void chmin(T &t,U f){if(t>f)t=f;}
template<class T,class U>void chmax(T &t,U f){if(t<f)t=f;}

int times=10000000;

signed main(){
    srand((unsigned)time(NULL));

    int N,K;cin>>N>>K;

    int win=0;
    rep(_,times){
        int a=0,b=0;
        rep(i,N)b+=rand()%6+1;
        rep(i,K)a+=rand()%6+1;
        rep(i,N-K)a+=rand()%3+4;
        if(a>b)win++;
    }

    printf("%.20lf\n",1.0*win/times);
    return 0;
}
0