結果

問題 No.47 ポケットを叩くとビスケットが2倍
ユーザー chami
提出日時 2024-03-07 03:33:57
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 32 ms / 5,000 ms
コード長 224 bytes
コンパイル時間 2,035 ms
コンパイル使用メモリ 191,872 KB
最終ジャッジ日時 2025-02-20 01:31:06
ジャッジサーバーID
(参考情報)
judge3 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 21
権限があれば一括ダウンロードができます

ソースコード

diff #

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

int main() {
  int n,ans;
  cin>>n;
  ans=log2(n);
  if(pow(2,ans)==n){
  	cout<<ans<<endl;
  }
  else
	cout<<ans+1<<endl;
}
0