結果
| 問題 |
No.1450 nahco314's First Problem
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2021-03-31 15:33:19 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 439 bytes |
| コンパイル時間 | 1,832 ms |
| コンパイル使用メモリ | 191,228 KB |
| 最終ジャッジ日時 | 2025-01-20 01:54:35 |
|
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 WA * 1 |
| other | AC * 5 WA * 32 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(ll i = 0; i < ll(n); i++)
using ll = long long;
using P = pair<int, int>;
int main() {
cin.tie(0);
ios_base::sync_with_stdio(false);
ll x;
cin >> x;
rep(i, 64) {
if(i == (ll)__builtin_popcount(x ^ i) && (x ^ i) <= (ll)2e18) {
cout << (x ^ i) << endl;
return 0;
}
}
cout << -1 << endl;
return 0;
}