結果
問題 |
No.183 たのしい排他的論理和(EASY)
|
ユーザー |
|
提出日時 | 2015-04-16 23:42:25 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 579 bytes |
コンパイル時間 | 409 ms |
コンパイル使用メモリ | 54,504 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-07-04 15:13:16 |
合計ジャッジ時間 | 1,774 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 10 WA * 5 RE * 3 |
ソースコード
#include<iostream> #include<numeric> using namespace std; const int VAL = 5005; const int RANGE = (1 << 14) + 5; int nVal, val[VAL]; void read() { cin >> nVal; for (int i = 0; i < nVal; ++i) cin >> val[i]; } void work() { bool avail[RANGE] = {}; avail[0] = true; for (int i = 0; i < RANGE; ++i) { if (!avail[i]) continue; for (int j = 0; j < nVal; ++j) avail[i ^ val[j]] = true; } cout << accumulate(avail, avail + RANGE, 0) << endl; } int main() { read(); work(); return 0; }