結果

問題 No.1176 少ない質問
ユーザー HaaHaa
提出日時 2020-08-21 21:33:55
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
TLE  
実行時間 -
コード長 465 bytes
コンパイル時間 1,648 ms
コンパイル使用メモリ 164,512 KB
実行使用メモリ 16,968 KB
最終ジャッジ日時 2024-04-23 05:33:29
合計ジャッジ時間 5,959 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 TLE -
testcase_01 -- -
testcase_02 -- -
testcase_03 -- -
testcase_04 -- -
testcase_05 -- -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef pair<ll, ll> P;
typedef vector<ll> VI;
typedef vector<VI> VVI;
const ll MOD = 1000000007;
const ll INF = 1e18;
#define REP(i, n) for(int i = 0; i < n; i++)
#define ALL(v) v.begin(), v.end()

int main(){
	ll a; cin >> a;
	ll ans=INF;
	for(int k=2;k<=3;k++){
		int c=0;
		double p=1;
		for(int i=1;i<a&&p<a;i*=k){
			c++;
		}
		ans=min(ans,(ll)c*k);
	}
	cout << ans << endl;
	return 0;
}
0