結果

問題 No.560 ふしぎなナップサック
ユーザー elzupelzup
提出日時 2017-08-26 18:48:26
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 637 bytes
コンパイル時間 1,074 ms
コンパイル使用メモリ 158,984 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-04-23 17:14:47
合計ジャッジ時間 1,663 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
5,248 KB
testcase_01 AC 1 ms
5,376 KB
testcase_02 AC 2 ms
5,376 KB
testcase_03 AC 1 ms
5,376 KB
testcase_04 AC 1 ms
5,376 KB
testcase_05 AC 1 ms
5,376 KB
testcase_06 AC 1 ms
5,376 KB
testcase_07 AC 1 ms
5,376 KB
testcase_08 AC 2 ms
5,376 KB
testcase_09 AC 1 ms
5,376 KB
testcase_10 AC 1 ms
5,376 KB
testcase_11 AC 2 ms
5,376 KB
testcase_12 AC 2 ms
5,376 KB
testcase_13 AC 1 ms
5,376 KB
testcase_14 AC 1 ms
5,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
typedef signed long long ll;

#define ALL(a) (a.begin()),(a.end())
#define ZERO(a) memset(a, 0, sizeof(a))
#define MINUS(a) memset(a,0xff,sizeof(a))
#define SIZE(array) (sizeof(array) / sizeof(array[0]))

#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)

long mod = 1000000007L;

auto cmp = [](pair<int, pair<int, long>> const & a, pair<int, pair<int, long>> const & b) {
	return a.second.second < b.second.second;
};

signed main() {
	int n, m;
	cin >> n >> m;
	double t = n;
	REP(i, m) {
		t = double(t * 3 + 1) / 3.0;
	}
	cout << fixed << setprecision(10) << t;
}
0