結果
問題 | No.183 たのしい排他的論理和(EASY) |
ユーザー |
|
提出日時 | 2015-06-12 01:50:10 |
言語 | C++11 (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 670 bytes |
コンパイル時間 | 457 ms |
コンパイル使用メモリ | 59,160 KB |
実行使用メモリ | 323,584 KB |
最終ジャッジ日時 | 2024-07-06 15:48:14 |
合計ジャッジ時間 | 10,660 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | WA * 2 |
other | WA * 4 RE * 14 |
ソースコード
#include <iostream> #include <algorithm> using namespace std; static const int NMAX = 5000; static const int AMAX = 16384; int main(){ int N; cin >> N; int memo[N + 1][AMAX + 1], A[N]; for(int i = 0; i < N; i++) cin >> A[i]; for(int i = 0; i <= N; i++){ for(int j = 0; j <= AMAX; j++){ memo[i][j] = 0; } } memo[0][0] = 1; for(int i = 0; i < N; i++){ for(int j = 0; j <= AMAX; j++){ memo[i + 1][(j ^ A[i])] += memo[i][j]; memo[i + 1][j] += memo[i][j]; } } int result = 0; for(int i = 0; i <= AMAX; i++){ if(memo[N][i] > 0){ cout << i << endl; result++; } } cout << result << endl; }