結果
問題 |
No.58 イカサマなサイコロ
|
ユーザー |
|
提出日時 | 2018-06-03 13:59:45 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 483 bytes |
コンパイル時間 | 1,467 ms |
コンパイル使用メモリ | 64,316 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-06-30 09:20:21 |
合計ジャッジ時間 | 2,412 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 9 WA * 1 |
ソースコード
#include<iostream> using namespace std; int main(){ int n, k; cin >> n >> k; int total = 0, win = 0; for(int i = 0; i < 500000; i++){ int taro = 0, ziro = 0; for(int j = 0; j < n; j++) ziro += 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 > ziro) win++; total++; } cout << (double)win / total << endl; return 0; }