結果
問題 |
No.1286 Stone Skipping
|
ユーザー |
|
提出日時 | 2020-12-30 18:57:50 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 473 bytes |
コンパイル時間 | 1,668 ms |
コンパイル使用メモリ | 166,596 KB |
実行使用メモリ | 6,824 KB |
最終ジャッジ日時 | 2024-10-07 21:42:27 |
合計ジャッジ時間 | 2,752 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | WA * 3 |
other | WA * 26 |
ソースコード
#include<bits/stdc++.h> using namespace std; typedef long long ll; ll d; bool ok(ll mid) { ll sum = 0; while (mid) { sum += mid; mid /= 2; if (sum >= d)return true; } return (sum >= d); } int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); cin >> d; cout << ok(4) << endl; ll left = 1, right = 1e18 + 7; for (int rep = 0; rep < 80; rep++) { ll mid = (left + right) / 2; if (ok(mid))right = mid; else left = mid; } cout << right << endl; }