結果

問題 No.1176 少ない質問
ユーザー ninoinui
提出日時 2020-08-21 23:02:40
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 9 ms / 1,000 ms
コード長 312 bytes
コンパイル時間 2,936 ms
コンパイル使用メモリ 191,396 KB
最終ジャッジ日時 2025-01-13 06:33:08
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 21
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

int main() {
  long A;
  cin >> A;
  if (A == 1) return cout << 1 << "\n", 0;
  int ans = 1e9;
  for (int i = 2; i < 1e6; i++) {
    long double tmp = i;
    int cnt = 1;
    while (tmp < A) tmp *= i, cnt++;
    ans = min(ans, i * cnt);
  }
  cout << ans << "\n";
}
0