結果
| 問題 |
No.183 たのしい排他的論理和(EASY)
|
| コンテスト | |
| ユーザー |
fushime2
|
| 提出日時 | 2017-12-29 22:31:17 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 323 ms / 5,000 ms |
| コード長 | 498 bytes |
| コンパイル時間 | 1,244 ms |
| コンパイル使用メモリ | 159,844 KB |
| 実行使用メモリ | 169,412 KB |
| 最終ジャッジ日時 | 2024-06-30 03:32:56 |
| 合計ジャッジ時間 | 3,922 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 18 |
ソースコード
#include "bits/stdc++.h"
using namespace std;
#define FOR(i,a,b) for(int (i)=(a);i<(int)(b);i++)
#define rep(i,n) FOR(i,0,n)
int main() {
int N; cin >> N;
vector<int> A(N);
for (int& i : A) cin >> i;
static bool dp[5010][40000] = {{0},{0}};
dp[0][0] = 1;
rep(i, N) rep(x, 40000) if (dp[i][x]) {
dp[i + 1][x] |= dp[i][x];
dp[i + 1][x ^ A[i]] |= dp[i][x];
}
int ans = 0;
rep(x, 40000) ans += (dp[N][x]);
cout << ans << endl;
return 0;
}
fushime2