結果

問題 No.1286 Stone Skipping
ユーザー er
提出日時 2025-05-01 19:15:16
言語 C++23
(gcc 13.3.0 + boost 1.87.0)
結果
TLE  
実行時間 -
コード長 888 bytes
コンパイル時間 1,315 ms
コンパイル使用メモリ 114,940 KB
実行使用メモリ 16,068 KB
最終ジャッジ日時 2025-05-01 19:15:22
合計ジャッジ時間 5,619 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 21 TLE * 1 -- * 4
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <iomanip>
#include <vector>
#include <math.h>
#include <queue>
#include <deque>
#include <map>
#include <set>

using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); ++i)
#define all(a) a.begin(), a.end()
#define arr(a) a.rbegin(), a.rend()
template<typename T> bool chmin(T& a, T b){if(a > b){a = b; return true;} return false;}
template<typename T> bool chmax(T& a, T b){if(a < b){a = b; return true;} return false;}
using ll = long long;

//Konishii

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    
    ll d; cin >> d;
    ll v = d/2 + 1;
    while(true) {
        ll res = 0;
        ll c = v;
        while(c > 0) {
            res += c;
            if(res == d) {
                cout << v << endl;
                return 0;
            } else if(res > d) break;
            c /= 2;
        }

        v++;
    }
}
0