結果
| 問題 | No.1286 Stone Skipping |
| コンテスト | |
| ユーザー |
mine691
|
| 提出日時 | 2020-09-30 02:22:08 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 635 bytes |
| コンパイル時間 | 2,323 ms |
| コンパイル使用メモリ | 194,776 KB |
| 最終ジャッジ日時 | 2025-01-14 23:33:39 |
|
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 TLE * 1 |
| other | AC * 8 TLE * 18 |
ソースコード
#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 = 1; i <= D; i++)
{
if (func(i, D) == D)
{
cout << i << "\n";
return 0;
}
}
}
mine691