結果

問題 No.47 ポケットを叩くとビスケットが2倍
ユーザー non
提出日時 2019-03-06 23:09:10
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 393 bytes
コンパイル時間 1,441 ms
コンパイル使用メモリ 166,420 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-06-23 14:40:40
合計ジャッジ時間 2,235 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample WA * 3
other AC * 1 WA * 20
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>

using namespace std;

int main()
{
  long long num, count = 0, bis = 1;
  cin >> num;

  if (num == 1)
  {
    cout << 0 << endl;
    exit(0);
  }

  while(1)
  {
    long long los = num - bis;
    cout << los << endl;

    if (los >= bis * 2)
    {
      bis = bis * 2;
      count++;
    }
    else
    {
      cout << count + 1 << endl;
      exit(0);
    }
  }
}
0