結果
問題 | No.680 作れる数 |
ユーザー |
|
提出日時 | 2018-04-27 22:50:59 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 1,486 bytes |
コンパイル時間 | 538 ms |
コンパイル使用メモリ | 69,248 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-06-27 22:06:43 |
合計ジャッジ時間 | 1,219 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 20 |
ソースコード
#include <iostream>#include <algorithm>#include <vector>using namespace std;#define YES(condition) if(condition) cout << "YES" << endl; else cout << "NO" << endl#define Yes(condition) if(condition) cout << "Yes" << endl; else cout << "No" << endl#define POSS(condition) if(condition) cout << "POSSIBLE" << endl; else cout << "IMPOSSIBLE" << endl#define Poss(condition) if(condition)cout << "Possible" << endl; else cout << "Impossible" << endl#define First(condition) if(condition)cout << "First" << endl; else cout << "Second" << endl#define negative(condition, num) if(condition)cout << -1 << endl; else cout << num << endllong power(long base, long exponent, long mod){ if(exponent % 2){ return power(base, exponent - 1, mod) * base % mod; }else if(exponent){ longroot_ans = power(base, exponent / 2, mod); return root_ans * root_ans % mod; }else{ return 1; }}struct position{ int y, x; }; position move_pattern[4] = {{-1, 0}, {0, 1}, {1, 0}, {0, -1}};template<class itr> void array_output(itr start, itr goal){ string ans; for(auto i = start; i != goal; i++){ ans += to_string(*i) + " "; } ans.pop_back(); cout << ans << endl; }long gcd(long a, long b){ if(a && b){ return gcd(min(a, b), max(a, b) % min(a, b)); }else{ return a; }}#define division long(1e9 + 7)#define all(x) (x).begin(), (x).end()int main(){long N;cin >> N;for(int i = 30; i >= 0; i--){if((1 << i) - 1 <= N){N -= (1 << i) - 1;}}YES(!N);}