結果
| 問題 |
No.47 ポケットを叩くとビスケットが2倍
|
| コンテスト | |
| ユーザー |
h66_34
|
| 提出日時 | 2016-12-26 16:23:29 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 358 bytes |
| コンパイル時間 | 1,046 ms |
| コンパイル使用メモリ | 60,404 KB |
| 実行使用メモリ | 6,824 KB |
| 最終ジャッジ日時 | 2024-12-15 00:09:13 |
| 合計ジャッジ時間 | 1,480 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | WA * 3 |
| other | WA * 21 |
ソースコード
#include <iostream>
#include <math.h>
using namespace std;
int main(){
int N;
cin >> N;
int i=0;
while((N-pow(2,(i+1)))>=0){
i=i+1;
}
cout << i << endl;
if((N-(int)pow(2,i))==0){
cout << i <<endl;
}
else if((N-(int)pow(2,i))==1){
cout << i+1 <<endl;
}
else{
cout << i+1+(N-(int)pow(2,i))%2 << endl;
}
return 0;
}
h66_34