結果
| 問題 |
No.680 作れる数
|
| コンテスト | |
| ユーザー |
kurenai3110
|
| 提出日時 | 2018-04-27 23:29:02 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 446 bytes |
| コンパイル時間 | 519 ms |
| コンパイル使用メモリ | 66,552 KB |
| 実行使用メモリ | 6,948 KB |
| 最終ジャッジ日時 | 2024-06-27 22:20:28 |
| 合計ジャッジ時間 | 1,232 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 10 WA * 10 |
ソースコード
#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <cmath>
using namespace std;
typedef long long ll;
vector<int>A;
int main() {
int N; cin >> N;
for (int i = 1; i < 31; i++) {
A.push_back((1 << i) - 1);
}
bool flag = false;
for (int i = 1; i < 31; i++) {
int y = N + i;
int x = A[i-1];
while (y > x)x *= 2;
if (x == y)flag = true;
}
cout << (flag ? "YES" : "NO") << endl;
return 0;
}
kurenai3110