結果

問題 No.1176 少ない質問
ユーザー tentententen
提出日時 2020-08-24 11:31:09
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 561 bytes
コンパイル時間 1,734 ms
コンパイル使用メモリ 74,016 KB
実行使用メモリ 41,472 KB
最終ジャッジ日時 2024-04-24 02:58:09
合計ジャッジ時間 4,858 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 110 ms
41,128 KB
testcase_01 AC 98 ms
40,244 KB
testcase_02 AC 120 ms
41,292 KB
testcase_03 AC 109 ms
40,984 KB
testcase_04 WA -
testcase_05 AC 108 ms
40,852 KB
testcase_06 AC 97 ms
39,852 KB
testcase_07 AC 99 ms
40,000 KB
testcase_08 AC 107 ms
41,428 KB
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 AC 110 ms
40,104 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 AC 112 ms
41,472 KB
testcase_17 AC 111 ms
40,016 KB
testcase_18 AC 109 ms
40,088 KB
testcase_19 AC 116 ms
41,100 KB
testcase_20 AC 113 ms
41,128 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        long a = sc.nextLong();
        long max = a;
        long x = 2;
        while (true) {
            long y = 2;
            int count = 1;
            while (y < a) {
                y *= x;
                count++;
            }
            if (max > count * x) {
                max = count * x;
            } else {
                break;
            }
            x++;
       }
       System.out.println(max);
    }
}
0