結果
問題 |
No.183 たのしい排他的論理和(EASY)
|
ユーザー |
![]() |
提出日時 | 2019-06-17 03:42:37 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2,597 ms / 5,000 ms |
コード長 | 672 bytes |
コンパイル時間 | 1,663 ms |
コンパイル使用メモリ | 169,236 KB |
実行使用メモリ | 163,516 KB |
最終ジャッジ日時 | 2024-07-02 03:59:29 |
合計ジャッジ時間 | 18,719 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 18 |
ソースコード
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define all(x) (x).begin(),(x).end() const int mod=1000000007; int main(){ int N;cin>>N; vector<int> S(N); for(int i=0;i<N;i++){ cin>>S[i]; } bool dp[1<<15][N+1]; for(int i=0;i<(1<<15);i++){ for(int j=0;j<N+1;j++){ dp[i][j]=0; } } dp[0][0]=1; for(int j=0;j<N;j++){ for(int i=0;i<(1<<15);i++){ if(dp[i][j]==1){ dp[i^S[j]][j+1]=1; dp[i][j+1]=1; } } } int cnt=0; for(int i=0;i<(1<<15);i++){ if(dp[i][N]) cnt++; } cout<<cnt<<endl; }