結果

問題 No.183 たのしい排他的論理和(EASY)
ユーザー hotpepsihotpepsi
提出日時 2015-11-01 21:32:09
言語 C++11
(gcc 13.3.0)
結果
AC  
実行時間 204 ms / 5,000 ms
コード長 418 bytes
コンパイル時間 494 ms
コンパイル使用メモリ 54,644 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-06-29 04:24:21
合計ジャッジ時間 2,911 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 18
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <cstring>

using namespace std;

int main(int argc, char *argv[]) {
	int N;
	cin >> N;
	int f[32768];
	memset(f, 0x3f, sizeof(f));
	f[0] = 0;
	for (int i = 1; i <= N; ++i) {
		int a;
		cin >> a;
		for (int j = 0; j < 32768; ++j) {
			if (f[j] < i) {
				f[j ^ a] = i;
			}
		}
	}

	int ans = 0;
	for (int j = 0; j < 32768; ++j) {
		ans += f[j] <= N;
	}
	cout << ans << endl;

	return 0;
}
0