結果

問題 No.1286 Stone Skipping
ユーザー Nzt3Nzt3
提出日時 2020-11-13 22:35:20
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 268 bytes
コンパイル時間 1,502 ms
コンパイル使用メモリ 165,292 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-07-22 21:33:54
合計ジャッジ時間 2,435 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 24 WA * 2
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;

int main(){
  int64_t d;
  cin>>d;
  int64_t ans=1e18;
  for(int i=0;i<(1<<10);i++){
    int64_t sum=0,n=d/2+i;
    while(n!=0){
      sum+=n,n/=2;
      if(sum==d)ans=min(ans,d/2+i);
    }
  }
  cout<<min(ans,d)<<'\n';
}
0