結果
| 問題 | No.560 ふしぎなナップサック |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2017-09-20 22:32:57 |
| 言語 | C++11 (gcc 15.3.0 + boost 1.92.0) |
| 結果 |
TLE
不安定
|
| 実行時間 | - |
| コード長 | 432 bytes |
| 記録 | |
| コンパイル時間 | 300 ms |
| コンパイル使用メモリ | 85,324 KB |
| 実行使用メモリ | 10,048 KB |
| 最終ジャッジ日時 | 2026-09-21 05:31:22 |
| 合計ジャッジ時間 | 6,346 ms |
|
ジャッジサーバーID (参考情報) |
judge4_0 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 TLE * 1 -- * 1 |
| other | -- * 12 |
ソースコード
#include <iostream>
#include <stdio.h>
#include <algorithm>
#include <math.h>
using namespace std;
int sum(int m, int n, int now)
{
if (n==now)
return 3 * m + 1;
else
return sum(2 * m, n, now + 1) + sum(m + 1, n, now + 1) + sum(0, n, now + 1);
}
int main(void)
{
int m, n;
cin >> m >> n;
double ans = sum(m, n, 1) / pow(3.0, n);
printf("%.8f\n", ans);
return 0;
}