結果

問題 No.47 ポケットを叩くとビスケットが2倍
ユーザー Shawn stayC
提出日時 2020-05-17 11:16:17
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 5,000 ms
コード長 291 bytes
コンパイル時間 1,689 ms
コンパイル使用メモリ 165,524 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-09-25 02:05:53
合計ジャッジ時間 2,427 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 21
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#define rep(i,n) for(int i=0; i<(n); i++)
using namespace std;
typedef long long ll;

int main(){
	int N; cin>>N;
    int i=1; int cnt=0;
	while(i<N){
		i*=2; cnt++;
        if(i*2>N) break;
	}
	if(pow(2,cnt)==N) cout << cnt << endl;
  	else cout << cnt+1 << endl;
}
0