結果
問題 |
No.183 たのしい排他的論理和(EASY)
|
ユーザー |
|
提出日時 | 2018-11-25 16:38:37 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 411 ms / 5,000 ms |
コード長 | 426 bytes |
コンパイル時間 | 1,526 ms |
コンパイル使用メモリ | 169,560 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-07-01 05:16:38 |
合計ジャッジ時間 | 4,835 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 18 |
ソースコード
#include <bits/stdc++.h> using namespace std; int main(){ ios::sync_with_stdio(false); cin.tie(0); int n; cin >> n; vector<bool> dp(1 << 14 + 1); dp[0] = true; int a; for(int i = 0; i < n; i++) { cin >> a; for(int j = 0; j < dp.size(); j++) { if(dp[j]) dp[a ^ j] = true; } } int ans = 0; for(int i = 0; i < dp.size(); i++) { if(dp[i]) ans++; } cout << ans << endl; return 0; }