結果
| 問題 | No.680 作れる数 |
| コンテスト | |
| ユーザー |
Kutimoti_T
|
| 提出日時 | 2018-05-12 09:47:28 |
| 言語 | C++11 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 332 bytes |
| 記録 | |
| コンパイル時間 | 937 ms |
| コンパイル使用メモリ | 174,336 KB |
| 実行使用メモリ | 6,144 KB |
| 最終ジャッジ日時 | 2026-03-16 22:52:35 |
| 合計ジャッジ時間 | 1,746 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 20 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
using i64 = long long;
#define rep(i,s,e) for(int (i) = (s);(i) <= (e);(i)++)
i64 N;
int main(){
cin >> N;
for(int i= 30;i >= 0;i--){
i64 now = (1LL << i) - 1;
if(now <= N) N -= now;
}
if(N == 0){
cout << "YES" << endl;
}
else{
cout << "NO" << endl;
}
}
Kutimoti_T