結果
問題 |
No.183 たのしい排他的論理和(EASY)
|
ユーザー |
|
提出日時 | 2025-04-19 09:32:18 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 569 bytes |
コンパイル時間 | 2,036 ms |
コンパイル使用メモリ | 193,984 KB |
実行使用メモリ | 83,584 KB |
最終ジャッジ日時 | 2025-04-19 09:32:23 |
合計ジャッジ時間 | 4,793 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | WA * 2 |
other | WA * 17 RE * 1 |
ソースコード
#include <bits/stdc++.h> using namespace std; int main(){ int n; cin >> n; vector<int> a(n); for(int i=0; n>i; ++i) cin >> a[i]; bool dp[n+1][16385]; for(int i=0; n>=i; ++i) for(int j=0; 16384>=j; ++j) dp[i][j] = false; dp[0][0] = true; for(int i=0; n>i; ++i){ for(int j=0; 16384>=j; ++j){ if(dp[i][j] == true) dp[i+1][j^a[i]] = true; if(dp[i][j] == true) dp[i+1][j] = true; } } int ans = 0; for(int i=0; 16384>=i; ++i) ans += dp[n][i]; cout << ans << endl; for(int i=0; 10>i; ++i) cout << dp[n][i] << " "; cout << endl; }