結果

問題 No.47 ポケットを叩くとビスケットが2倍
ユーザー GBGB
提出日時 2018-04-10 10:12:42
言語 Java21
(openjdk 21)
結果
AC  
実行時間 120 ms / 5,000 ms
コード長 364 bytes
コンパイル時間 1,942 ms
コンパイル使用メモリ 71,936 KB
実行使用メモリ 56,484 KB
最終ジャッジ日時 2023-09-09 03:44:24
合計ジャッジ時間 5,897 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 116 ms
55,792 KB
testcase_01 AC 115 ms
54,440 KB
testcase_02 AC 116 ms
56,108 KB
testcase_03 AC 116 ms
56,484 KB
testcase_04 AC 116 ms
56,008 KB
testcase_05 AC 116 ms
55,712 KB
testcase_06 AC 115 ms
55,712 KB
testcase_07 AC 116 ms
56,160 KB
testcase_08 AC 118 ms
56,096 KB
testcase_09 AC 120 ms
55,700 KB
testcase_10 AC 120 ms
55,668 KB
testcase_11 AC 119 ms
55,940 KB
testcase_12 AC 117 ms
55,952 KB
testcase_13 AC 117 ms
55,776 KB
testcase_14 AC 118 ms
55,540 KB
testcase_15 AC 120 ms
55,696 KB
testcase_16 AC 117 ms
55,860 KB
testcase_17 AC 118 ms
55,824 KB
testcase_18 AC 117 ms
55,448 KB
testcase_19 AC 118 ms
55,772 KB
testcase_20 AC 117 ms
56,096 KB
testcase_21 AC 120 ms
55,748 KB
testcase_22 AC 117 ms
55,340 KB
testcase_23 AC 117 ms
55,644 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.*;
import java.util.*;

class Main{
  public static void main(String[] args) throws IOException{
    Scanner scan=new Scanner(System.in);
    int n=Integer.parseInt(scan.next());
    int count=0;
    
    do{
      if(n==1){
        count=0;
      }else{
        count++;
      }
    }while(Math.pow(2,count)<n);
    System.out.println(count);
  }
}
0