結果
| 問題 | No.680 作れる数 |
| コンテスト | |
| ユーザー |
kurenai3110
|
| 提出日時 | 2018-04-27 23:38:33 |
| 言語 | C++11 (gcc 15.2.0 + boost 1.90.0) |
| 結果 |
AC
|
| 実行時間 | 1 ms / 2,000 ms |
| + 161µs | |
| コード長 | 426 bytes |
| 記録 | |
| コンパイル時間 | 442 ms |
| コンパイル使用メモリ | 89,196 KB |
| 実行使用メモリ | 5,888 KB |
| 最終ジャッジ日時 | 2026-07-31 11:20:43 |
| 合計ジャッジ時間 | 1,513 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 20 |
ソースコード
#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <cmath>
using namespace std;
typedef long long ll;
int main() {
int N; cin >> N;
bool flag = false;
int n = ceil(N / 2.);
for (int i = n; i < n + 100; i++) {
int x = i;
int cnt = 0;
while (x) {
if (x % 2)cnt++;
x /= 2;
}
if (2 * i - cnt == N)flag = true;
}
cout << (flag ? "YES" : "NO") << endl;
return 0;
}
kurenai3110