結果
| 問題 | No.183 たのしい排他的論理和(EASY) |
| コンテスト | |
| ユーザー |
otamay6
|
| 提出日時 | 2019-11-18 10:33:46 |
| 言語 | C++14 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
AC
|
| 実行時間 | 307 ms / 5,000 ms |
| コード長 | 542 bytes |
| 記録 | |
| コンパイル時間 | 1,079 ms |
| コンパイル使用メモリ | 186,832 KB |
| 実行使用メモリ | 23,680 KB |
| 最終ジャッジ日時 | 2026-03-24 02:07:42 |
| 合計ジャッジ時間 | 4,091 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 18 |
ソースコード
#include<bits/stdc++.h>
#define REP(i,n) for(int i=0,i##_len=(n);i<i##_len;++i)
#define rep(i,a,b) for(int i=int(a);i<int(b);++i)
#define All(x) (x).begin(),(x).end()
using namespace std;
typedef long long ll;
int main(){
int N;cin>>N;
vector<int> A(N);
REP(i, N) cin >> A[i];
vector<vector<bool>> dp(N+1,vector<bool>((1<<15),false));
dp[0][0]=true;
REP(i,N) REP(j,(1<<15)){
dp[i+1][j] = dp[i][j]||dp[i][j^A[i]];
}
int ans=0;
REP(i,1<<15) if(dp[N][i]){
ans++;
}
cout<<ans<<endl;
}
otamay6