結果
問題 | No.1450 nahco314's First Problem |
ユーザー |
![]() |
提出日時 | 2021-03-31 14:21:15 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 308 bytes |
コンパイル時間 | 1,905 ms |
コンパイル使用メモリ | 165,196 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-11-08 14:13:11 |
合計ジャッジ時間 | 3,214 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 36 WA * 1 |
ソースコード
#include <bits/stdc++.h>int ri() {int n;scanf("%d", &n);return n;}int main() {int64_t x;std::cin >> x;for (int64_t i = std::max<int64_t>(0, x - 60); i <= x + 60; i++) {if ((i ^ __builtin_popcountll(i)) == x) {printf("%" PRId64 "\n", i);return 0;}}puts("-1");return 0;}