結果
| 問題 |
No.183 たのしい排他的論理和(EASY)
|
| コンテスト | |
| ユーザー |
huka_huka
|
| 提出日時 | 2021-09-24 18:46:49 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 823 bytes |
| コンパイル時間 | 2,932 ms |
| コンパイル使用メモリ | 161,420 KB |
| 実行使用メモリ | 6,944 KB |
| 最終ジャッジ日時 | 2024-07-05 09:45:57 |
| 合計ジャッジ時間 | 4,041 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 13 WA * 5 |
ソースコード
# ifndef ONLINE_JUDGE
# define _GLIBCXX_DEBUG
# endif
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vi = vector<int>;
using vvi = vector<vector<int>>;
using pii = pair<int, int>;
# define rep(i, n) for(int i = 0; i < (int)(n); i++)
# define all(v) v.begin(), v.end()
int main(){
constexpr char endl = '\n';
ios::sync_with_stdio(false);
cin.tie(nullptr);
cout << fixed << setprecision(10);
//input();
int N;cin >> N;
vi A(N);
for(auto &&e : A) cin >> e;
//solve();
vector<bool> dp(pow(2, 15), false);
//dp[i]:=iを作れるか
dp[0] = true;
rep(i, N){
dp[A[i]] = true;
}
rep(i, pow(2, 15)){
if(!dp[i]) continue;
for(int &a : A){
dp[i^a] = true;
}
}
//output();
int cnt = 0;
for(bool &&e : dp) if(e) ++cnt;
cout << cnt << endl;
}
huka_huka