結果
| 問題 | No.1450 nahco314's First Problem |
| コンテスト | |
| ユーザー |
shiomusubi496
|
| 提出日時 | 2021-03-14 20:29:13 |
| 言語 | C++14 (gcc 15.3.0 + boost 1.92.0 + ACL) |
| 結果 |
TLE
不安定
|
| 実行時間 | - |
| コード長 | 395 bytes |
| 記録 | |
| コンパイル時間 | 847 ms |
| コンパイル使用メモリ | 179,720 KB |
| 実行使用メモリ | 7,980 KB |
| 最終ジャッジ日時 | 2026-09-21 07:15:35 |
| 合計ジャッジ時間 | 7,144 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge4_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 3 TLE * 1 -- * 33 |
ソースコード
#include<bits/stdc++.h>
using namespace std;
using ll=long long;
int main(){
ll X; cin>>X;
if(__builtin_popcountll(X^1)==1){
cout<<(X^1)<<endl;
return 0;
}
if(__builtin_popcountll(X^2)==2){
cout<<(X^2)<<endl;
return 0;
}
for(int M=1,two=1;two<=X;M++,two*=2){
if(__builtin_popcountll(X^M)==M){
cout<<(X^M)<<endl;
return 0;
}
}
cout<<-1<<endl;
}
shiomusubi496