結果
| 問題 | No.183 たのしい排他的論理和(EASY) |
| コンテスト | |
| ユーザー |
lll
|
| 提出日時 | 2018-04-08 22:58:18 |
| 言語 | C++14 (gcc 15.2.0 + boost 1.90.0) |
| 結果 |
AC
|
| 実行時間 | 99 ms / 5,000 ms |
| + 845µs | |
| コード長 | 798 bytes |
| 記録 | |
| コンパイル時間 | 557 ms |
| コンパイル使用メモリ | 105,216 KB |
| 実行使用メモリ | 5,888 KB |
| 最終ジャッジ日時 | 2026-08-02 05:50:31 |
| 合計ジャッジ時間 | 2,494 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 18 |
ソースコード
#include <algorithm>
#include <cmath>
#include <cstring>
#include <deque>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <string>
#include <unordered_map>
#include <vector>
using namespace std;
using ll = long long;
int main() {
cin.tie(0);
ios::sync_with_stdio(false);
int N;
const int maxSize = 1 << 15;
int dp[maxSize] = {};
cin >> N;
dp[0] = true;
for (int i = 0; i < N; i++) {
int a;
cin >> a;
dp[a] = true;
for (int j = 0; j < maxSize; j++) {
if (dp[j]) {
dp[a ^ j] = true;
}
}
}
int ans = 0;
for (int i = 0; i < maxSize; i++) {
if (dp[i])
ans++;
}
cout << ans << endl;
return 0;
}
lll