結果
問題 |
No.47 ポケットを叩くとビスケットが2倍
|
ユーザー |
|
提出日時 | 2018-10-10 20:18:47 |
言語 | Java (openjdk 23) |
結果 |
WA
|
実行時間 | - |
コード長 | 528 bytes |
コンパイル時間 | 2,070 ms |
コンパイル使用メモリ | 73,664 KB |
実行使用メモリ | 42,720 KB |
最終ジャッジ日時 | 2024-10-12 17:20:01 |
合計ジャッジ時間 | 5,082 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | WA * 3 |
other | WA * 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+1); } }