結果

問題 No.1176 少ない質問
ユーザー kumakumaaaaa
提出日時 2020-08-21 22:01:53
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 437 bytes
コンパイル時間 1,487 ms
コンパイル使用メモリ 165,720 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-10-15 05:38:51
合計ジャッジ時間 2,157 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 20 WA * 1
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#define INF 2000000000000000000
#define ll long long
using namespace std;

int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  ll A;
  cin >> A;
  ll ans = INF;
  for (ll i = 1; i <= 60; ++i) {
    if (A <= pow(2, i)) {
      ans = i * 2;
      break;
    }
  }
  for (ll i = 1; i <= 38; ++i) {
    if (A <= pow(3, i)) {
      ans = min(ans, i * 3);
      break;
    }
  }
  cout << ans << "\n";
}
0