結果
問題 |
No.1298 OR XOR
|
ユーザー |
![]() |
提出日時 | 2020-11-28 00:59:29 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 443 bytes |
コンパイル時間 | 1,856 ms |
コンパイル使用メモリ | 166,052 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-07-26 21:34:14 |
合計ジャッジ時間 | 2,644 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 13 |
ソースコード
#include <bits/stdc++.h> using namespace std; typedef long long ll; int main() { int N; cin >> N; int A = N; int B = N; int C = N; for (int i = 0; i < 31; i++) { if ((1<<i) == N) { cout << "-1 -1 -1\n"; return 0; } if (((1<<i) & N) != 0) { B = N - (1<<i); C = (1<<i); } } cout << A << " " << B << " " << C << "\n"; return 0; }