結果
| 問題 |
No.1298 OR XOR
|
| コンテスト | |
| ユーザー |
planes
|
| 提出日時 | 2022-07-29 20:23:27 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 452 bytes |
| コンパイル時間 | 1,599 ms |
| コンパイル使用メモリ | 166,872 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-07-19 11:13:16 |
| 合計ジャッジ時間 | 2,399 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 13 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
using ll =long long;
#define all(v) v.begin(),v.end()
#define rep(i,a,b) for(int i=a;i<b;i++)
#define rrep(i,a,b) for(int i=a;i>=b;i--)
int main() {
ll N;cin>>N;
ll A=0,B=0,C=0;
A=N;
for(ll k=0;k<=30;k++) {
if(N&(1LL<<k)){
if(B==0) B+=(1LL<<k);
else C+=(1LL<<k);
}
}
if(C==0) cout<<-1<<" "<<-1<<" "<<-1<<endl;
else cout<<A<<" "<<B<<" "<<C<<endl;
}
planes