結果
問題 | No.58 イカサマなサイコロ |
ユーザー | moti |
提出日時 | 2015-07-22 09:27:45 |
言語 | C++11 (gcc 11.4.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 802 bytes |
コンパイル時間 | 725 ms |
コンパイル使用メモリ | 90,828 KB |
実行使用メモリ | 4,384 KB |
最終ジャッジ日時 | 2023-09-22 21:11:00 |
合計ジャッジ時間 | 1,625 ms |
ジャッジサーバーID (参考情報) |
judge11 / judge12 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 11 ms
4,380 KB |
testcase_01 | AC | 47 ms
4,380 KB |
testcase_02 | AC | 10 ms
4,380 KB |
testcase_03 | AC | 6 ms
4,376 KB |
testcase_04 | AC | 29 ms
4,376 KB |
testcase_05 | AC | 33 ms
4,380 KB |
testcase_06 | AC | 43 ms
4,380 KB |
testcase_07 | WA | - |
testcase_08 | AC | 20 ms
4,376 KB |
testcase_09 | WA | - |
ソースコード
#include <iostream> #include <algorithm> #include <cmath> #include <vector> #include <complex> #include <queue> #include <set> #include <map> #include <iomanip> #include <random> using namespace std; #define REP(i,a,b) for(int i=a;i<(int)b;i++) #define rep(i,n) REP(i,0,n) typedef long long ll; default_random_engine gen; uniform_int_distribution<int> futu(1, 6); uniform_int_distribution<int> ikasama(4, 6); int solve(int N, int K) { int taro = 0, jiro = 0; rep(i, N-K) { taro += futu(gen); jiro += futu(gen); } rep(i, K) { taro += ikasama(gen); jiro += futu(gen); } return taro > jiro; } int main() { int N, K; cin >> N >> K; ll ans = 0; rep(_, 100000) { ans += solve(N, K); } cout << setprecision(5) << (double)ans / 100000 << endl; return 0; }