結果
| 問題 |
No.1298 OR XOR
|
| コンテスト | |
| ユーザー |
Ilag
|
| 提出日時 | 2020-11-27 21:40:24 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 682 bytes |
| コンパイル時間 | 1,605 ms |
| コンパイル使用メモリ | 167,076 KB |
| 実行使用メモリ | 6,944 KB |
| 最終ジャッジ日時 | 2024-07-26 12:00:33 |
| 合計ジャッジ時間 | 2,070 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 13 |
ソースコード
#include <bits/stdc++.h>
using i32 = std::int32_t;
using i64 = std::int64_t;
using u32 = std::uint32_t;
using u64 = std::uint64_t;
using usize = std::size_t;
const i32 INF = 1001001001;
const i64 LINF = 1001001001001001;
const u32 MOD1 = 1000000007;
const u32 MOD2 = 998244353;
int main(){
std::ios::sync_with_stdio(false);
std::cin.tie(nullptr);
i64 n;
std::cin>>n;
i64 a=0,b=0,c=0;
for(i64 i=1,j=0;i<=n;i<<=1,j++){
if(!(n>>j&1))continue;
if(j&1){
a|=i;
b|=i;
}else{
b|=i;
c|=i;
}
}
if(a==0||b==0||c==0)a=-1,b=-1,c=-1;
std::cout<<a<<' '<<b<<' '<<c<<std::endl;
}
Ilag