結果
| 問題 | No.184 たのしい排他的論理和(HARD) |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2016-03-31 23:25:31 |
| 言語 | C++11 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 314 bytes |
| 記録 | |
| コンパイル時間 | 1,107 ms |
| コンパイル使用メモリ | 174,084 KB |
| 実行使用メモリ | 6,272 KB |
| 最終ジャッジ日時 | 2026-03-25 19:54:40 |
| 合計ジャッジ時間 | 1,972 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge1_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | WA * 3 |
| other | AC * 6 WA * 28 |
コンパイルメッセージ
main.cpp: In function 'int main()':
main.cpp:12:13: warning: 'sum' may be used uninitialized [-Wmaybe-uninitialized]
12 | sum |= tmp;
| ~~~~^~~~~~
main.cpp:8:17: note: 'sum' was declared here
8 | int n, tmp, sum;
| ^~~
ソースコード
#include <bits/stdc++.h>
using namespace std;
int main() {
cin.tie(0);
ios::sync_with_stdio(false);
int n, tmp, sum;
cin >> n;
for (int i = 0; i < n; i++) {
cin >> tmp;
sum |= tmp;
}
bitset<61> x(sum);
cout << (1 << min((int)x.count(), n)) << "\n";
return 0;
}