提出 #53597541


ソースコード 拡げる

import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int H = sc.nextInt();

        int ans = -1;
        boolean flag = true;
        double result = 0;
        while (flag) {
            ans++;
            result = result + Math.pow(2, ans);
            if (result > H) {
                flag = false;
            }
        }
        System.out.println(ans + 1);

    }
}

提出情報

提出日時
問題 A - Exponential Plant
ユーザ andrywawa
言語 Java (OpenJDK 17)
得点 100
コード長 491 Byte
結果 AC
実行時間 73 ms
メモリ 38212 KiB

ジャッジ結果

セット名 Sample All
得点 / 配点 0 / 0 100 / 100
結果
AC × 3
AC × 24
セット名 テストケース
Sample 00_sample_00.txt, 00_sample_01.txt, 00_sample_02.txt
All 00_sample_00.txt, 00_sample_01.txt, 00_sample_02.txt, 01_random_00.txt, 01_random_01.txt, 01_random_02.txt, 01_random_03.txt, 01_random_04.txt, 01_random_05.txt, 01_random_06.txt, 01_random_07.txt, 01_random_08.txt, 01_random_09.txt, 02_hand_00.txt, 02_hand_01.txt, 02_hand_02.txt, 02_hand_03.txt, 02_hand_04.txt, 02_hand_05.txt, 02_hand_06.txt, 02_hand_07.txt, 02_hand_08.txt, 02_hand_09.txt, 02_hand_10.txt
ケース名 結果 実行時間 メモリ
00_sample_00.txt AC 71 ms 38076 KiB
00_sample_01.txt AC 71 ms 38044 KiB
00_sample_02.txt AC 70 ms 37848 KiB
01_random_00.txt AC 71 ms 38144 KiB
01_random_01.txt AC 71 ms 37900 KiB
01_random_02.txt AC 72 ms 38212 KiB
01_random_03.txt AC 72 ms 37812 KiB
01_random_04.txt AC 72 ms 37848 KiB
01_random_05.txt AC 73 ms 38156 KiB
01_random_06.txt AC 72 ms 38140 KiB
01_random_07.txt AC 69 ms 38084 KiB
01_random_08.txt AC 71 ms 37828 KiB
01_random_09.txt AC 69 ms 37760 KiB
02_hand_00.txt AC 71 ms 38108 KiB
02_hand_01.txt AC 71 ms 38072 KiB
02_hand_02.txt AC 72 ms 37828 KiB
02_hand_03.txt AC 70 ms 37832 KiB
02_hand_04.txt AC 71 ms 37808 KiB
02_hand_05.txt AC 70 ms 37748 KiB
02_hand_06.txt AC 70 ms 37832 KiB
02_hand_07.txt AC 71 ms 38092 KiB
02_hand_08.txt AC 69 ms 37840 KiB
02_hand_09.txt AC 71 ms 37808 KiB
02_hand_10.txt AC 70 ms 37880 KiB