結果
問題 | No.680 作れる数 |
ユーザー |
|
提出日時 | 2018-04-27 23:33:36 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 991 bytes |
コンパイル時間 | 1,861 ms |
コンパイル使用メモリ | 192,632 KB |
最終ジャッジ日時 | 2025-01-05 10:26:12 |
ジャッジサーバーID (参考情報) |
judge1 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 14 WA * 6 |
ソースコード
#include <bits/stdc++.h> #define show(x) cerr << #x << " = " << x << endl using namespace std; using ll = long long; using ld = long double; constexpr ll MOD = 1000000007LL; template <typename T> constexpr T INF = numeric_limits<T>::max() / 10; template <typename Functor> struct fix_type { Functor functor; template <typename... Args> decltype(auto) operator()(Args&&... args) const& { return functor(functor, std::forward<Args>(args)...); } }; template <typename Functor> fix_type<typename std::decay<Functor>::type> fix(Functor&& functor) { return {std::forward<Functor>(functor)}; } int main() { ll N; cin >> N; if (N == 0) { cout << "YES" << endl; return 0; } for (ll i = 1, l = 2;; i++, l <<= 1) { const ll L = l - 1; const ll R = 2 * L - i; if (L > N) { break; } if (L <= N and N <= R) { cout << "YES" << endl; return 0; } } cout << "NO" << endl; return 0; }