結果
| 問題 |
No.66 輝け☆全国たこやき杯
|
| コンテスト | |
| ユーザー |
nmnmnmnmnmnmnm
|
| 提出日時 | 2014-11-14 00:02:01 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 939 bytes |
| コンパイル時間 | 905 ms |
| コンパイル使用メモリ | 80,064 KB |
| 実行使用メモリ | 6,824 KB |
| 最終ジャッジ日時 | 2024-12-31 10:21:17 |
| 合計ジャッジ時間 | 1,138 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | WA * 10 |
ソースコード
#include <iostream>
#include <sstream>
#include <cstdio>
#include <algorithm>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <cstring>
#include <cmath>
#include <cstdlib>
#include <stack>
#include <queue>
#include <numeric>
#include <ctime>
using namespace std;
double dp[11][1024];
int p[1024];
int main(){
int k;
cin >> k;
for(int i = 0; i < pow(2, k); i++){
cin >> p[i];
}
int n = pow(2, k);
int b = 2;
for(int i = 0; i < n; i++){
dp[0][i] = 1.0;
}
for(int i = 0; i < k; i++){
for(int j = 0; j < n; j += b){
for(int t = j; t < j + b / 2; t++){
for(int s = j + b / 2; s < j + b; s++){
dp[i+1][t] += (p[t]*p[t] / (p[t]*p[t]+p[s]*p[s])) * dp[i][s] * dp[i][t];
dp[i+1][s] += (p[s]*p[s] / (p[t]*p[t]+p[s]*p[s])) * dp[i][s] * dp[i][t];
}
}
}
b *= 2;
}
cout << dp[k][0] << endl;
return 0;
}
nmnmnmnmnmnmnm