結果
| 問題 | No.680 作れる数 |
| コンテスト | |
| ユーザー |
kurenai3110
|
| 提出日時 | 2018-04-27 23:38:33 |
| 言語 | C++11 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
AC
|
| 実行時間 | 1 ms / 2,000 ms |
| コード長 | 426 bytes |
| 記録 | |
| コンパイル時間 | 593 ms |
| コンパイル使用メモリ | 90,836 KB |
| 実行使用メモリ | 7,844 KB |
| 最終ジャッジ日時 | 2026-03-16 02:52:39 |
| 合計ジャッジ時間 | 1,202 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_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