結果
| 問題 |
No.242 ビンゴゲーム
|
| コンテスト | |
| ユーザー |
nmnmnmnmnmnmnm
|
| 提出日時 | 2015-06-24 00:07:58 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
(最新)
AC
(最初)
|
| 実行時間 | - |
| コード長 | 1,670 bytes |
| コンパイル時間 | 1,268 ms |
| コンパイル使用メモリ | 86,668 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-07-07 17:14:42 |
| 合計ジャッジ時間 | 9,308 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 WA * 1 |
| other | AC * 3 WA * 5 |
ソースコード
#include <algorithm>
#include <cfloat>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <functional>
#include <iostream>
#include <map>
#include <memory>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>
using namespace std;
#define sz size()
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define all(c) (c).begin(), (c).end()
#define rep(i,a,b) for(int i=(a);i<(b);++i)
#define clr(a, b) memset((a), (b) ,sizeof(a))
#define MOD 1000000007
unsigned int xor128(void) {
static unsigned int x = 123456789;
static unsigned int y = 362436069;
static unsigned int z = 521288629;
static unsigned int w = 88675123;
unsigned int t;
t = x ^ (x << 11);
x = y; y = z; z = w;
return w = (w ^ (w >> 19)) ^ (t ^ (t >> 8));
}
int m[12][5] = {
{0,1,2,3,4},
{5,6,7,8,9},
{10,11,12,13,14},
{15,16,17,18,19},
{20,21,22,23,24},
{0,5,10,15,20},
{1,6,11,16,21},
{2,7,12,17,22},
{3,8,13,18,23},
{4,9,14,19,24},
{0,6,12,18,24},
{4,8,12,16,20}
};
int main(){
int n;
cin>>n;
int d[25];
int ans = 0;
int ra[99];
rep(j,0,99)ra[j]=j;
rep(i,0,1000000){
int nn = 99;
rep(j,0,99){
swap(ra[xor128()%nn],ra[nn-1]);
nn--;
}
clr(d,0);
rep(j,0,n){
if(ra[j]<25)d[ra[j]]=1;
}
int p = 0;
rep(j,0,12){
int c = 0;
rep(k,0,5){
if(d[m[j][k]]==1){
c++;
}
}
if(c==5)p++;
}
ans+=p;
}
printf("%.20f\n",1.*ans/1000000);
return 0;
}
/*
モンテカルロ法
*/
nmnmnmnmnmnmnm