結果
| 問題 | No.58 イカサマなサイコロ |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2016-11-25 16:18:11 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.89.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 529 bytes |
| 記録 | |
| コンパイル時間 | 1,522 ms |
| コンパイル使用メモリ | 166,480 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-11-27 11:16:05 |
| 合計ジャッジ時間 | 2,042 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 5 WA * 5 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
signed main(){
int N, K; cin >> N >> K;
const int trial = ( int ) 1e5;
int win_cnt = 0;
for( int i = 0; i < trial; ++i ){
int nirou = 0;
for( int j = 0; j < N; ++j )
nirou += rand() % 6 + 1;
int tarou = 0;
for( int j = 0; j < N - K; ++j )
tarou += rand() % 6 + 1;
for( int j = 0; j < K; ++j )
tarou += rand() % 3 + 4;
win_cnt += tarou > nirou;
}
cout << fixed << setprecision( 6 ) << 1.0 * win_cnt / trial << endl;
return 0;
}