結果
問題 |
No.183 たのしい排他的論理和(EASY)
|
ユーザー |
|
提出日時 | 2021-08-30 22:37:08 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
RE
|
実行時間 | - |
コード長 | 821 bytes |
コンパイル時間 | 910 ms |
コンパイル使用メモリ | 98,360 KB |
実行使用メモリ | 323,584 KB |
最終ジャッジ日時 | 2024-11-24 07:09:41 |
合計ジャッジ時間 | 9,827 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 15 RE * 3 |
ソースコード
#include <iostream> #include <utility> #include <vector> #include <string> #include <cmath> #include <algorithm> #include <functional> #include <iomanip> #include <map> #include <set> #include <queue> using namespace std; using ll = long long int; #define chmax(x,y) x = (x > (y)) ? x : (x = (y)); #define chmin(x,y) x = (x < (y)) ? x : (x = (y)); int main(int argc, char const *argv[]) { int N; cin >> N; vector<int> W(N); for(auto &e : W)cin >> e; vector<vector<int>> dp(N+1,vector<int>(pow(2,14)+1,0)); dp[0][0] = 1; for(int i=0;i<N;++i) { for(int j=0;j<=pow(2,14);++j) { if(dp[i][j]) { dp[i+1][j] = dp[i][j]; dp[i+1][j^W[i]] = dp[i][j]; } } } int answer = 0; for(int i=0;i<=pow(2,14);++i)answer += dp[N][i]; std::cout << answer << std::endl; }