結果
| 問題 |
No.560 ふしぎなナップサック
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2019-10-24 23:21:49 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 244 bytes |
| コンパイル時間 | 1,493 ms |
| コンパイル使用メモリ | 164,624 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-07-18 08:00:16 |
| 合計ジャッジ時間 | 2,069 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 12 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
double f(int n, double x) {
if (n == 0) {
return x;
}
return f(n - 1, 2.0 / 3 * x + 1.0 / 3 * (x + 1));
}
int main() {
int m, n;
cin>>m>>n;
printf("%.9lf\n", 1.0 * m + f(n, 0.0));
}