結果

問題 No.47 ポケットを叩くとビスケットが2倍
ユーザー A_ru8743731
提出日時 2017-07-08 19:22:58
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 2 ms / 5,000 ms
コード長 572 bytes
コンパイル時間 623 ms
コンパイル使用メモリ 78,260 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-10-06 19:50:10
合計ジャッジ時間 1,486 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 21
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <sstream>
#include <vector>
#include <algorithm>
#include <string>
#include <functional>
#include <numeric>
#include <ctype.h>
#include <cstdlib>
#include <string.h>
#include <cmath>
#include <cstdio>
#include <map>
#include <queue>
#include <utility>

using namespace std;

const int INF = 1000000007;
const double PI = acos(-1.0);

int main()
{
	int N, cnt = 0, Bis = 1;
	cin >> N;

	if (N == 1)
	{
		cout << 0 << endl;
		return 0;
	}

	while (true)
	{
		if (N <= Bis * 2)
			break;
		Bis = Bis * 2;
		cnt++;
	}

	cout << cnt + 1 << endl;

}
0