結果
問題 | No.188 HAPPY DAY |
ユーザー |
|
提出日時 | 2021-09-08 21:07:25 |
言語 | C++17(clang) (17.0.6 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 2,309 bytes |
コンパイル時間 | 5,882 ms |
コンパイル使用メモリ | 166,656 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-12-26 16:43:19 |
合計ジャッジ時間 | 6,128 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | WA * 1 |
ソースコード
#include<bits/stdc++.h>using namespace std;using ll = long long;using PAIR = pair<int, int>;using PAIRLL = pair<ll,ll>;using vi = vector<int>;using vll = vector<ll>;using vvi = vector<vi>;using vs = vector<string>;#define rep(i,n) for(int i=0;i<(n);i++)#define INF 100000000#define REP(i,n) for(ll i=0;i<ll(n);i++)#define REPD(i,n) for(ll i=n-1;i>=0;i--)#define FOR(i,a,b) for(ll i=a;i<=ll(b);i++)#define FORD(i,a,b) for(ll i=a;i>=ll(b);i--)#define FORA(i,I) for(const auto& i:I)//x:コンテナ#define ALL(x) x.begin(),x.end()#define SIZE(x) ll(x.size())//定数#define INF32 2147483647 //2.147483647×10^{9}:32bit整数のinf#define INF64 9223372036854775807 //9.223372036854775807×10^{18}:64bit整数のinf#define MOD 1000000007 //問題による#define F first#define S second//出力(空白区切りで昇順に)#define coutALL(x) for(auto i=x.begin();i!=--x.end();i++)cout<<*i<<" ";cout<<*--x.end()<<endl#define coutALLn(x) for(auto i=x.begin();i!=--x.end();i++)cout<<*i<<endl;cout<<*--x.end()<<endlll myceil(ll a,ll b){return (a+(b-1))/b;}ll myfloor(ll a,ll b){return a/b;}int vector_finder(std::vector<int> vec, int number) {auto itr = std::find(vec.begin(), vec.end(), number);size_t index = std::distance( vec.begin(), itr );if (index != vec.size()) { // 発見できたときreturn 1;}else { // 発見できなかったときreturn 0;}}vector<ll> vector_find_ll(vector<ll> vec,ll num){int N = vec.size();vector<ll> match_num;rep(i,N){if (vec[i] == num){match_num.push_back(i);}}return match_num;}ll vector_max(vector<ll> vec){ll ret = -INF64;rep(i,vec.size()){ret = max(ret,vec[i]);}return ret;}ll vector_min(vector<ll> vec){ll ret = INF64;rep(i,vec.size()){ret = min(ret,vec[i]);}return ret;}int main(){int N ;cin >> N;vector<int> lsA(N);rep(i,N) cin >> lsA[i];vector<vector<bool>> dp(N+1,vector<bool>(1<<15,false));dp[0][0] = true;rep(i,N){for (int j= 0; j < 1<<15;j++){dp[i+1][j] = dp[i][j] || dp[i][j^lsA[i]];}}int cnt = 0;rep(i,1<<15){if (dp[N][i]){cnt += 1;}}cout << cnt <<endl;}