結果
問題 | No.1298 OR XOR |
ユーザー |
![]() |
提出日時 | 2020-11-27 21:29:01 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 2,196 bytes |
コンパイル時間 | 1,828 ms |
コンパイル使用メモリ | 192,720 KB |
最終ジャッジ日時 | 2025-01-16 06:28:47 |
ジャッジサーバーID (参考情報) |
judge3 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 9 WA * 4 |
コンパイルメッセージ
In file included from /usr/include/c++/13/istream:41, from /usr/include/c++/13/sstream:40, from /usr/include/c++/13/complex:45, from /usr/include/c++/13/ccomplex:39, from /usr/include/x86_64-linux-gnu/c++/13/bits/stdc++.h:127, from main.cpp:1: In member function ‘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:50:29: /usr/include/c++/13/ostream:204:25: warning: ‘b’ may be used uninitialized [-Wmaybe-uninitialized] 204 | { return _M_insert(__n); } | ~~~~~~~~~^~~~~ main.cpp: In function ‘int main()’: main.cpp:43:12: note: ‘b’ was declared here 43 | ll b,c; | ^ In member function ‘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:50:41: /usr/include/c++/13/ostream:204:25: warning: ‘c’ may be used uninitialized [-Wmaybe-uninitialized] 204 | { return _M_insert(__n); } | ~~~~~~~~~^~~~~ main.cpp: In function ‘int main()’: main.cpp:43:14: note: ‘c’ was declared here 43 | ll b,c; | ^
ソースコード
#include <bits/stdc++.h>#define rep(a,n) for (ll a = 0; a < (n); ++a)using namespace std;//using namespace atcoder;using ll = long long;typedef pair<ll,ll> P;typedef pair<ll,P> PP;typedef vector<vector<int> > Graph;template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }const ll INF = 1e18;#define debug(v) cout<<#v<<": ",prt(v);template <typename A,typename B>inline void prt(pair<A,B> p){cout<<"("<<p.first<<", "<<p.second<<")\n";}template <typename A,typename B,typename C>inline void prt(tuple<A,B,C> p){cout<<"("<<get<0>(p)<<", "<<get<1>(p)<<", "<<get<2>(p)<<")\n";}inline void prt(bool p){if(p)cout<<"True"<<'\n';else cout<<"False"<<'\n';}template <typename T>inline void prt(vector<T> v){cout<<'{';for(ll i=0;i<v.size();i++){cout<<v[i];if(i<v.size()-1)cout<<", ";}cout<<'}'<<'\n';}template<typename T>inline void prt(vector<vector<T> >& vv){ for(const auto& v : vv){ prt(v); } }template <typename T>inline void prt(deque<T> v){cout<<'{';for(ll i=0;i<v.size();i++){cout<<v[i];if(i<v.size()-1)cout<<", ";}cout<<'}'<<'\n';}template <typename A,typename B>inline void prt(map<A,B> v){cout<<'{';ll c=0;for(auto &p: v){cout<<p.first<<":"<<p.second;c++;if(c!=v.size())cout<<", ";}cout<<'}'<<'\n';}template <typename A,typename B>inline void prt(unordered_map<A,B> v){cout<<'{';ll c=0;for(auto &p: v){cout<<p.first<<":"<<p.second;c++;if(c!=v.size())cout<<", ";}cout<<'}'<<'\n';}template <typename T>inline void prt(set<T> v){cout<<'{';for(auto i=v.begin();i!=v.end();i++){cout<<*i;if(i!=--v.end())cout<<", ";}cout<<'}'<<'\n';}template <typename T>inline void prt(multiset<T> v){cout<<'{';for(auto i=v.begin();i!=v.end();i++){cout<<*i;if(i!=--v.end())cout<<", ";}cout<<'}'<<'\n';}int main(){ll n;cin >> n;if(n==1){cout<<-1<< ' ' << -1 << ' ' << -1 << endl;}else{ll a = n;ll b,c;rep(i,100){if((n>>i)&1){b = n^(1<<i);c = n^b;}}cout << a << ' ' << b << ' ' << c << endl;}return 0;}