結果
問題 | No.1298 OR XOR |
ユーザー |
|
提出日時 | 2020-11-30 12:39:53 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 498 bytes |
コンパイル時間 | 583 ms |
コンパイル使用メモリ | 66,840 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-09-13 02:20:27 |
合計ジャッジ時間 | 1,355 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 13 |
ソースコード
#include <iostream> #include <vector> #include <string> using namespace std; int lsb(int x){ return x & (~(x-1)); } int main() { #ifndef ONLINE_JUDGE freopen("input.txt","r",stdin); freopen("output.txt","w",stdout); #endif int n; cin >> n; int x = lsb(n); int a = n, b = n, c = x; b = b & (~c); if(a == 0 || b == 0 || c == 0 ){ cout << "-1 -1 -1 "<<endl; }else{ cout << a << " "<< b << " "<< c <<endl; } return 0; }