結果
問題 |
No.1286 Stone Skipping
|
ユーザー |
|
提出日時 | 2020-09-30 04:15:21 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
TLE
|
実行時間 | - |
コード長 | 639 bytes |
コンパイル時間 | 1,825 ms |
コンパイル使用メモリ | 193,324 KB |
最終ジャッジ日時 | 2025-01-14 23:35:10 |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 TLE * 1 |
other | AC * 13 TLE * 13 |
ソースコード
#include <bits/stdc++.h> using namespace std; using ll = int_fast64_t; constexpr int mod = 1e9 + 7; constexpr int inf = (1 << 30) - 1; constexpr ll infll = (1LL << 61) - 1; #define fast() ios::sync_with_stdio(false), cin.tie(nullptr) #define set_digit(N) cout << fixed << setprecision((N)) #pragma GCC target("avx2") #pragma GCC optimize("O3") #pragma GCC optimize("unroll-loops") ll func(ll x, ll D) { ll sum = 0; for (int i = 0; x > 0 && sum < D; i++) { sum += x; x /= 2; } return sum; } int main() { ll D; cin >> D; for (int i = D / 2; i <= D; i++) { if (func(i, D) == D) { cout << i << "\n"; return 0; } } }