結果
| 問題 | No.47 ポケットを叩くとビスケットが2倍 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2017-12-08 23:04:34 |
| 言語 | C++11 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 414 bytes |
| 記録 | |
| コンパイル時間 | 511 ms |
| コンパイル使用メモリ | 78,188 KB |
| 実行使用メモリ | 6,400 KB |
| 最終ジャッジ日時 | 2026-05-23 13:03:53 |
| 合計ジャッジ時間 | 6,999 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 11 WA * 10 |
ソースコード
#include <iostream>
#include <cmath>
using namespace std;
int main(){
int n; cin >> n;
if(n == 1) cout << "0" << endl;
else if(n%2 == 1) cout << (2*n + 1)/2 -1 << endl;
else if(n == 2) cout << "1" << endl;
else if(n == 4) cout << "2" << endl;
else {
for(int i = 1; i < n; i++){
if(pow(2,i) <= n && n <= pow(2,i+1))cout << i + 1 << endl;
}
}
return 0;
}