結果
| 問題 |
No.47 ポケットを叩くとビスケットが2倍
|
| コンテスト | |
| ユーザー |
chacoder1
|
| 提出日時 | 2021-01-24 15:51:30 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 5,000 ms |
| コード長 | 365 bytes |
| コンパイル時間 | 1,624 ms |
| コンパイル使用メモリ | 191,732 KB |
| 最終ジャッジ日時 | 2025-01-18 07:51:32 |
|
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 21 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i,n) for(int i=0;i<n;i++)
signed main(){
int n;
cin>>n;
if(n==1){
cout<<0<<endl;
return 0;
}
int temp=1;
int cnt=0;
while(temp*2<=n){
//cout<<temp<<" "<<cnt<<endl;
temp*=2;
cnt++;
}
if(temp != n){
cnt++;
}
cout<<cnt<<endl;
return 0;
}
chacoder1