結果
| 問題 |
No.58 イカサマなサイコロ
|
| コンテスト | |
| ユーザー |
Dadarithm
|
| 提出日時 | 2015-10-11 11:08:59 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 517 bytes |
| コンパイル時間 | 591 ms |
| コンパイル使用メモリ | 71,240 KB |
| 実行使用メモリ | 6,948 KB |
| 最終ジャッジ日時 | 2024-07-21 06:23:02 |
| 合計ジャッジ時間 | 1,281 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 1 WA * 9 |
ソースコード
#include <iostream>
#include <random>
#include <ctime>
using namespace std;
static const int INF = 1000000000;
int main()
{
int N, K;
cin >> N >> K;
clock_t start = clock();
int A = 0, B = 0;
while (B <= INF && clock() - start < 4500)
{
int a = 0, b =0;
for (int i = 0; i < N; ++i)
b += rand() % 6 + 1;
for (int i = 0; i < K; ++i)
a += rand() % 3 + 4;
for (int i = 0; i < N - K; ++i)
a += rand() % 6 + 1;
if (a > b)
++A;
++B;
}
cout << (double)A / (double)B << endl;
return 0;
}
Dadarithm