結果
| 問題 | No.47 ポケットを叩くとビスケットが2倍 |
| コンテスト | |
| ユーザー |
aparachia14
|
| 提出日時 | 2016-01-18 22:48:39 |
| 言語 | Java (openjdk 25.0.2) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 740 bytes |
| 記録 | |
| コンパイル時間 | 4,608 ms |
| コンパイル使用メモリ | 81,944 KB |
| 実行使用メモリ | 45,176 KB |
| 最終ジャッジ日時 | 2026-04-09 14:54:09 |
| 合計ジャッジ時間 | 5,251 ms |
|
ジャッジサーバーID (参考情報) |
judge3_1 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 WA * 2 |
| other | AC * 19 WA * 2 |
ソースコード
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
//No.47 ポケットを叩くとビスケットが2倍
public class TwiceBiscuit {
public static void main(String[] args) throws IOException {
// TODO 自動生成されたメソッド・スタブ
//食べたいビスケットの枚数
int want;
//ビスケットの枚数
int biscuit = 1;
//カウンタ
int counter = 0;
//入力受け取り
BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
want = Integer.parseInt(in.readLine());
while(true){
biscuit = biscuit * 2;
if(biscuit > want){
break;
}else{
}
counter++;
}
System.out.println(++counter);
}
}
aparachia14