結果
問題 |
No.183 たのしい排他的論理和(EASY)
|
ユーザー |
|
提出日時 | 2018-11-25 16:37:10 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
RE
|
実行時間 | - |
コード長 | 433 bytes |
コンパイル時間 | 1,887 ms |
コンパイル使用メモリ | 168,832 KB |
実行使用メモリ | 6,824 KB |
最終ジャッジ日時 | 2024-12-24 19:45:39 |
合計ジャッジ時間 | 7,481 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | RE * 2 |
other | AC * 7 WA * 1 RE * 10 |
ソースコード
#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++) { scanf("%d", &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; }