結果
| 問題 | No.58 イカサマなサイコロ |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2015-06-19 03:47:32 |
| 言語 | C++11 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
AC
|
| 実行時間 | 68 ms / 5,000 ms |
| コード長 | 357 bytes |
| 記録 | |
| コンパイル時間 | 452 ms |
| コンパイル使用メモリ | 87,756 KB |
| 実行使用メモリ | 6,272 KB |
| 最終ジャッジ日時 | 2026-03-28 18:12:07 |
| 合計ジャッジ時間 | 1,259 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 10 |
ソースコード
#include <vector>
#include <random>
#include <cstdio>
using namespace std;
int main(){
int N,K,T=999999,S=0,I=0;
scanf("%d%d",&N,&K);
uniform_int_distribution<int>g(1,6),h(4,6);
mt19937_64 e(0);
for(;I<T;I++){
int a=0,b=0,i=0;
for(;i<N;i++)a+=g(e),b+=i<K?h(e):g(e);
if(a<b)S++;
}
printf("%f\n",S*1.0/T);
}