結果
| 問題 |
No.58 イカサマなサイコロ
|
| ユーザー |
Lay_ec
|
| 提出日時 | 2014-11-05 00:18:04 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
(最新)
AC
(最初)
|
| 実行時間 | - |
| コード長 | 628 bytes |
| コンパイル時間 | 849 ms |
| コンパイル使用メモリ | 72,288 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-12-30 17:40:54 |
| 合計ジャッジ時間 | 6,500 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 9 WA * 1 |
ソースコード
#include <iostream>
#include <string>
#include <vector>
#include <cmath>
#include <algorithm>
#include <cstdlib>
#include <ctime>
#include <cstdio>
#include <functional>
#include <set>
#include <sstream>
#include <cctype>
using namespace std;
int main(){
int n,k;
cin>>n>>k;
srand(time(NULL));
long win=0;
for(long i=0;i<(2<<20);i++){
int jiro=0,taro=0;
for(int j=0;j<n;j++) jiro+=(rand()%6+1);
for(int j=0;j<n-k;j++) taro+=(rand()%6+1);
for(int j=0;j<k;j++) taro+=(rand()%3+4);
if(taro>jiro) win++;
}
printf("%.16f\n",(double)win/(2<<20));
return 0;
}
Lay_ec