結果
問題 |
No.183 たのしい排他的論理和(EASY)
|
ユーザー |
![]() |
提出日時 | 2020-06-27 16:29:44 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 211 ms / 5,000 ms |
コード長 | 566 bytes |
コンパイル時間 | 1,468 ms |
コンパイル使用メモリ | 167,704 KB |
実行使用メモリ | 137,984 KB |
最終ジャッジ日時 | 2024-07-05 17:25:00 |
合計ジャッジ時間 | 4,054 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
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; bool dp[5003][1<<15]; int main(){ int N;cin>>N; vector<int> S(N); for(int i=0;i<N;i++){ cin>>S[i]; } dp[0][0]=1; for(int i=0;i<N;i++){ for(int j=0;j<(1<<15);j++){ if(dp[i][j]==1){ dp[i+1][j^S[i]]=1; dp[i+1][j]=1; } } } int cnt=0; for(int j=0;j<(1<<15);j++){ if(dp[N][j]) cnt++; } cout<<cnt<<endl; }