結果
| 問題 | No.183 たのしい排他的論理和(EASY) |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2023-12-19 09:31:52 |
| 言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 544 ms / 5,000 ms |
| コード長 | 578 bytes |
| コンパイル時間 | 3,219 ms |
| コンパイル使用メモリ | 249,548 KB |
| 実行使用メモリ | 23,552 KB |
| 最終ジャッジ日時 | 2024-09-27 08:43:37 |
| 合計ジャッジ時間 | 7,121 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 18 |
ソースコード
#include <bits/stdc++.h>
#define rep(i,a,b) for(int i=a;i<b;i++)
#define rrep(i,a,b) for(int i=a;i>=b;i--)
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
ll INF = 1e18;
int main(){
int N;
cin >> N;
vector<vector<bool> > dp(N+1, vector<bool>(32769, false));
dp[0][0] = true;
int a;
rep(i,1,N+1){
cin >> a;
rep(j,0,32769){
if(dp[i-1][j]){
dp[i][j] = true;
dp[i][a^j] = true;
}
}
}
cout << accumulate(dp[N].begin(), dp[N].end(), 0) << endl;
}