結果
問題 |
No.183 たのしい排他的論理和(EASY)
|
ユーザー |
![]() |
提出日時 | 2021-01-04 04:17:41 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 629 ms / 5,000 ms |
コード長 | 428 bytes |
コンパイル時間 | 1,944 ms |
コンパイル使用メモリ | 196,388 KB |
最終ジャッジ日時 | 2025-01-17 09:33:25 |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 18 |
ソースコード
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; vector<int> a(n); for (int i = 0; i < n; i++) { cin >> a.at(i); } vector<bool> dp(1 << 15); dp.at(0) = true; for (int i = 0; i < n; i++) { for (int j = 0; j < 1 << 15; j++) { dp.at(j) = dp.at(j) || dp.at(a.at(i) ^ j); } } cout << count(dp.begin(), dp.end(), true) << endl; }