結果
| 問題 |
No.1298 OR XOR
|
| コンテスト | |
| ユーザー |
planes
|
| 提出日時 | 2022-07-29 20:22:34 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 443 bytes |
| コンパイル時間 | 1,523 ms |
| コンパイル使用メモリ | 166,088 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-07-19 11:12:30 |
| 合計ジャッジ時間 | 3,869 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | WA * 1 |
| other | WA * 13 |
コンパイルメッセージ
In file included from /home/linuxbrew/.linuxbrew/Cellar/gcc@12/12.3.0/include/c++/12/istream:39,
from /home/linuxbrew/.linuxbrew/Cellar/gcc@12/12.3.0/include/c++/12/sstream:38,
from /home/linuxbrew/.linuxbrew/Cellar/gcc@12/12.3.0/include/c++/12/complex:45,
from /home/linuxbrew/.linuxbrew/Cellar/gcc@12/12.3.0/include/c++/12/ccomplex:39,
from /home/linuxbrew/.linuxbrew/Cellar/gcc@12/12.3.0/include/c++/12/x86_64-pc-linux-gnu/bits/stdc++.h:54,
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:20:22:
/home/linuxbrew/.linuxbrew/Cellar/gcc@12/12.3.0/include/c++/12/ostream:202:25: warning: 'B' may be used uninitialized [-Wmaybe-uninitialized]
202 | { return _M_insert(__n); }
| ~~~~~~~~~^~~~~
main.cpp: In function 'int main()':
main.cpp:10:8: note: 'B' was declared here
10 | ll A,B,C;
| ^
main.cpp:15:13: warning: 'C' may be used uninitialized [-Wmaybe-uninitialized]
15 | else C+=(1LL<<k);
| ~^~~~~~~~~~
main.cpp:10:10: note: 'C' was declared here
10 | ll A,B,C;
| ^
ソースコード
#include <bits/stdc++.h>
using namespace std;
using ll =long long;
#define all(v) v.begin(),v.end()
#define rep(i,a,b) for(int i=a;i<b;i++)
#define rrep(i,a,b) for(int i=a;i>=b;i--)
int main() {
ll N;cin>>N;
ll A,B,C;
A=N;
for(ll k=0;k<=30;k++) {
if(N&(1LL<<k)){
if(B==0) B+=(1LL<<k);
else C+=(1LL<<k);
}
}
if(C==0) cout<<-1<<" "<<-1<<" "<<-1<<endl;
else cout<<A<<" "<<B<<" "<<C<<endl;
}
planes