結果
問題 |
No.183 たのしい排他的論理和(EASY)
|
ユーザー |
![]() |
提出日時 | 2017-07-26 13:27:00 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 378 bytes |
コンパイル時間 | 2,407 ms |
コンパイル使用メモリ | 196,104 KB |
最終ジャッジ日時 | 2025-01-05 01:52:22 |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 15 WA * 3 |
ソースコード
#include <bits/stdc++.h> using namespace std; int main() { int N; cin >> N; vector<bool> dp((1 << 14) + 1); dp[0] = true; int res = 1; for (int i = 0, a; i < N; i++) { cin >> a; auto tdp = dp; for (int j = 0; j <= 1 << 14; j++) { if (tdp[j] && (j ^ a) <= (1 << 14) && !dp[j ^ a]) { dp[j ^ a] = true; res++; } } } cout << res << endl; return 0; }