結果
問題 | No.1298 OR XOR |
ユーザー | mogurin_kyopro |
提出日時 | 2020-11-27 21:27:21 |
言語 | C++14 (gcc 13.2.0 + boost 1.83.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 1,115 bytes |
コンパイル時間 | 2,244 ms |
コンパイル使用メモリ | 172,004 KB |
実行使用メモリ | 4,384 KB |
最終ジャッジ日時 | 2023-10-01 04:40:29 |
合計ジャッジ時間 | 2,903 ms |
ジャッジサーバーID (参考情報) |
judge13 / judge12 |
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 2 ms
4,376 KB |
testcase_01 | AC | 2 ms
4,384 KB |
testcase_02 | AC | 2 ms
4,376 KB |
testcase_03 | AC | 2 ms
4,380 KB |
testcase_04 | AC | 2 ms
4,380 KB |
testcase_05 | AC | 2 ms
4,380 KB |
testcase_06 | AC | 2 ms
4,376 KB |
testcase_07 | AC | 1 ms
4,380 KB |
testcase_08 | AC | 2 ms
4,376 KB |
testcase_09 | AC | 2 ms
4,380 KB |
testcase_10 | AC | 2 ms
4,380 KB |
testcase_11 | AC | 1 ms
4,380 KB |
testcase_12 | AC | 2 ms
4,376 KB |
testcase_13 | AC | 2 ms
4,380 KB |
コンパイルメッセージ
次のファイルから読み込み: /usr/local/gcc7/include/c++/12.2.0/istream:39, 次から読み込み: /usr/local/gcc7/include/c++/12.2.0/sstream:38, 次から読み込み: /usr/local/gcc7/include/c++/12.2.0/complex:45, 次から読み込み: /usr/local/gcc7/include/c++/12.2.0/ccomplex:39, 次から読み込み: /usr/local/gcc7/include/c++/12.2.0/x86_64-pc-linux-gnu/bits/stdc++.h:54, 次から読み込み: main.cpp:6: メンバ関数 ‘std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long long int) [with _CharT = char; _Traits = std::char_traits<char>]’ 内, inlined from ‘int main()’ at main.cpp:46:17: /usr/local/gcc7/include/c++/12.2.0/ostream:202:25: 警告: ‘B’ may be used uninitialized [-Wmaybe-uninitialized] 202 | { return _M_insert(__n); } | ~~~~~~~~~^~~~~ main.cpp: 関数 ‘int main()’ 内: main.cpp:38:8: 備考: ‘B’ はここで定義されています 38 | ll A,B; | ^ メンバ関数 ‘std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long long int) [with _CharT = char; _Traits = std::char_traits<char>]’ 内, inlined from ‘int main()’ at main.cpp:46:9: /usr/local/gcc7/include/c++/12.2.0/ostream:202:25: 警告: ‘A’ may be used uninitialized [-Wmaybe-uninitialized] 202 | { return _M_insert(__n); } | ~~~~~~~~~^~~~~ main.cpp: 関数 ‘int main()’ 内: main.cpp:38:6: 備考: ‘A’ はここで定義されています 38 | ll A,B; | ^
ソースコード
#pragma GCC optimize("Ofast") //#ifndef ONLINE_JUDGE //#define _GLIBCXX_DEBUG //#endif //#include <atcoder/all> #include <bits/stdc++.h> #include <chrono> #include <random> using namespace std; //using namespace atcoder; #define rep(i,n) for (int i = 0;i < (int)(n);i++) using ll = long long; const ll MOD=1000000007; //const ll MOD=998244353; //using mint = modint998244353; //using mint = modint; //using mint = modint1000000007; const long long INF = 1LL << 60; const double pi=acos(-1.0); int dx[9] = {1, 0, -1, 0, 1, 1, -1, -1, 0}; int dy[9] = {0, 1, 0, -1, 1, -1, -1, 1, 0}; template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; } template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; } int main() { ios::sync_with_stdio(false); cin.tie(nullptr); // cout << fixed << setprecision(15); ll N; cin>>N; if(__builtin_popcount(N)==1) {cout<<"-1 -1 -1\n"; return 0;} ll A,B; rep(i,40) { if(N&(1<<i)) { A=(1<<i); B=N&~A; break; } } cout<<A<<' '<<B<<' '<<N<<'\n'; return 0; }