結果
| 問題 | No.183 たのしい排他的論理和(EASY) |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2021-08-30 22:45:12 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 820 bytes |
| コンパイル時間 | 858 ms |
| コンパイル使用メモリ | 102,652 KB |
| 実行使用メモリ | 23,552 KB |
| 最終ジャッジ日時 | 2024-11-24 07:27:47 |
| 合計ジャッジ時間 | 4,103 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 15 WA * 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<bool>> dp(N+1,vector<bool>(pow(2,15),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;
}