結果
問題 |
No.183 たのしい排他的論理和(EASY)
|
ユーザー |
![]() |
提出日時 | 2020-01-18 15:49:18 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 145 ms / 5,000 ms |
コード長 | 496 bytes |
コンパイル時間 | 2,064 ms |
コンパイル使用メモリ | 192,444 KB |
最終ジャッジ日時 | 2025-01-08 20:03:47 |
ジャッジサーバーID (参考情報) |
judge5 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 18 |
ソースコード
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define rep(i, n) for (int i = 0; i < (int)(n); i++) int main(){ int n, x, ans; const int s = pow(2, 15); bool number[s]; fill(number, number + s, false); number[0] = true; cin >> n; rep(i, n){ cin >> x; rep(j, s) number[j^x] |= number[j]; } ans = 0; rep(i, s) if(number[i]) ans++; cout << ans << endl; return 0; }