結果

問題 No.47 ポケットを叩くとビスケットが2倍
ユーザー キョウチク
提出日時 2019-03-04 15:19:11
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 371 bytes
コンパイル時間 595 ms
コンパイル使用メモリ 55,216 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-06-23 13:29:08
合計ジャッジ時間 1,567 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2 WA * 1
other AC * 3 WA * 18
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
using namespace std;
int main() {
	int N, Biscuit = 1, Pocket, count = 0;
	cin >> N;
	Pocket = N;
	while (Biscuit != N) {
		if (Biscuit + Pocket <= N) {
			Biscuit = Pocket + Biscuit;
			Pocket = Biscuit;
			count++;
		}
		else {
			Pocket = (N - Biscuit) / 2;
			if (Pocket == 0)Pocket = 1;
		}
	}
	//cout << Biscuit << endl;
	cout << count << endl;
}
0