結果
| 問題 |
No.183 たのしい排他的論理和(EASY)
|
| コンテスト | |
| ユーザー |
115Yuuta
|
| 提出日時 | 2017-10-05 18:31:01 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 580 bytes |
| コンパイル時間 | 1,339 ms |
| コンパイル使用メモリ | 162,620 KB |
| 実行使用メモリ | 228,012 KB |
| 最終ジャッジ日時 | 2024-11-16 21:26:36 |
| 合計ジャッジ時間 | 52,702 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 10 TLE * 8 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
#define PI 4*atan(1)
#define INF 1e8
typedef long long ll;
int dx[4] = {1,0,-1,0};
int dy[4] = {0,1,0,-1};
int n[33000] = {0};
int N;
int dp[5001][33000] = {0};
void dfs(int i, int x, vector<ll> A){
if(i == N + 1)return;
if(dp[i][x] == 1)return;
// n[x^A[i]] = 1;
dp[i][x] = 1;
n[x] = 1;
dfs(i + 1, x^A[i], A);
dfs(i + 1, x, A);
}
int main(){
cin >> N;
vector<ll> A(N + 1, 0);
for(int i = 0; i < N; i++)cin >> A[i];
dfs(0, 0, A);
int cnt = 0;
for(auto t : n)if(t == 1)cnt++;
cout << cnt << endl;
}
115Yuuta