結果
| 問題 | No.183 たのしい排他的論理和(EASY) |
| コンテスト | |
| ユーザー |
h_noson
|
| 提出日時 | 2016-02-16 19:32:34 |
| 言語 | C++11 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
AC
|
| 実行時間 | 105 ms / 5,000 ms |
| コード長 | 483 bytes |
| 記録 | |
| コンパイル時間 | 507 ms |
| コンパイル使用メモリ | 76,612 KB |
| 実行使用メモリ | 7,844 KB |
| 最終ジャッジ日時 | 2026-03-19 00:39:59 |
| 合計ジャッジ時間 | 2,016 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 18 |
ソースコード
#include <iostream>
#include <map>
using namespace std;
int main() {
int n;
cin >> n;
bool dp[32768];
fill(dp,dp+32768,false);
dp[0] = true;
for (int i = 0; i < n; i++) {
int a;
cin >> a;
for (int j = 0; j < 32768; j++) {
if (dp[j])
dp[j^a] = true;
}
}
int ans = 0;
for (int i = 0; i < 32768; i++) {
if (dp[i])
ans++;
}
cout << ans << endl;
return 0;
}
h_noson