結果
問題 |
No.212 素数サイコロと合成数サイコロ (2)
|
ユーザー |
|
提出日時 | 2016-11-20 21:43:23 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 560 bytes |
コンパイル時間 | 1,449 ms |
コンパイル使用メモリ | 165,244 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-11-27 09:08:25 |
合計ジャッジ時間 | 1,964 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | WA * 10 |
ソースコード
#include <bits/stdc++.h> using namespace std; int asai[] = { 2, 3, 5, 7, 11, 13 }; int bsai[] = { 4, 6, 8, 9, 10, 12 }; void dfs( int a, int b, double x, double &sum ){ if( a + b == 0 ) return ( void ) ( sum += x ); if( a - 1 >= 0 ){ for( int i = 0; i < 6; ++i ) return dfs( a - 1, b, x * asai[ i ], sum ); } else{ for( int i = 0; i < 6; ++i ) return dfs( a, b - 1, x * bsai[ i ], sum ); } } signed main(){ int a, b; cin >> a >> b; double ans = 0.0; dfs( a, b, 1.0, ans ); cout << ans / pow( 6, a + b ); return 0; }