結果
| 問題 |
No.58 イカサマなサイコロ
|
| コンテスト | |
| ユーザー |
fiord
|
| 提出日時 | 2015-06-17 00:08:51 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 404 ms / 5,000 ms |
| コード長 | 408 bytes |
| コンパイル時間 | 431 ms |
| コンパイル使用メモリ | 56,976 KB |
| 実行使用メモリ | 6,944 KB |
| 最終ジャッジ日時 | 2024-07-07 03:26:19 |
| 合計ジャッジ時間 | 3,243 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 10 |
ソースコード
#include <iostream>
#include <algorithm>
#include <cstdlib>
using namespace std;
#define E 1000000
int main(){
int n,k; cin>>n>>k;
int cnt=0;
for(int i=0;i<E;i++){
int taro=0,jiro=0;
for(int j=0;j<n;j++){
jiro+=(rand()%6)+1;
}
for(int j=0;j<k;j++){
taro+=(rand()%3)+4;
}
for(int j=k;j<n;j++){
taro+=(rand()%6)+1;
}
if(taro>jiro) cnt++;
}
cout<<(double)cnt/E<<endl;
return 0;
}
fiord