結果
問題 | No.183 たのしい排他的論理和(EASY) |
ユーザー |
![]() |
提出日時 | 2015-04-17 16:41:47 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 225 ms / 5,000 ms |
コード長 | 580 bytes |
コンパイル時間 | 500 ms |
コンパイル使用メモリ | 62,408 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-06-29 01:46:13 |
合計ジャッジ時間 | 2,864 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 18 |
ソースコード
#include <cstdio> #include <vector> #include <iostream> #include <cassert> #include <cstring> #include <map> using namespace std; typedef long long ll; const int MN = 100100; bool dp[1<<16]; int main() { int n; cin >> n; dp[0] = true; for (int i = 0; i < n; i++) { int a; cin >> a; for (int j = 0; j < (1<<15); j++) { if (dp[j]) { dp[j ^ a] = true; } } } int res = 0; for (int i = 0; i < (1<<15); i++) { if (dp[i]) res++; } cout << res << endl; return 0; }