結果
問題 | No.1298 OR XOR |
ユーザー |
![]() |
提出日時 | 2020-11-05 00:46:53 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 454 bytes |
コンパイル時間 | 574 ms |
コンパイル使用メモリ | 65,988 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-07-22 10:29:51 |
合計ジャッジ時間 | 1,465 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 13 |
ソースコード
/* author: Kite_kumacreated: 2020.11.05 00:38:14 */#include <iostream>using namespace std;int main() {int N;cin >> N;if(__builtin_popcount(N) < 2) {cout << "-1 -1 -1\n";return 0;}int A, B, C;A = B = C = 0;for(int i = 0; i < 31; i++) {if(N & (1 << i)) {A |= 1 << i;if(C) {B |= 1 << i;} else {C |= 1 << i;}}}if(!C) A = B = C = -1;cout << A << " " << B << " " << C << endl;return 0;}