結果
問題 |
No.47 ポケットを叩くとビスケットが2倍
|
ユーザー |
|
提出日時 | 2018-10-10 20:20:05 |
言語 | Java (openjdk 23) |
結果 |
AC
|
実行時間 | 133 ms / 5,000 ms |
コード長 | 526 bytes |
コンパイル時間 | 2,033 ms |
コンパイル使用メモリ | 74,032 KB |
実行使用メモリ | 41,564 KB |
最終ジャッジ日時 | 2024-10-12 17:20:14 |
合計ジャッジ時間 | 5,604 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 21 |
ソースコード
import java.util.Scanner; public class Main { public static void main(String[] args) { // 標準入力から読み込む際に、Scannerオブジェクトを使う。 Scanner sc = new Scanner(System.in); // int 1つ分を読み込む int n = sc.nextInt(); int biscuits = 1; int count = 0; while(biscuits < n){ biscuits = biscuits * 2; count++; } // 標準出力に書き出す。 System.out.println(count); } }