結果

問題 No.183 たのしい排他的論理和(EASY)
ユーザー kotamanegikotamanegi
提出日時 2016-08-14 22:38:04
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 672 ms / 5,000 ms
コード長 862 bytes
コンパイル時間 757 ms
コンパイル使用メモリ 83,972 KB
実行使用メモリ 247,544 KB
最終ジャッジ日時 2023-09-12 01:09:41
合計ジャッジ時間 6,358 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 3 ms
4,380 KB
testcase_01 AC 3 ms
4,380 KB
testcase_02 AC 3 ms
4,380 KB
testcase_03 AC 3 ms
4,376 KB
testcase_04 AC 3 ms
4,376 KB
testcase_05 AC 4 ms
4,376 KB
testcase_06 AC 3 ms
4,380 KB
testcase_07 AC 557 ms
219,816 KB
testcase_08 AC 563 ms
220,632 KB
testcase_09 AC 386 ms
152,160 KB
testcase_10 AC 463 ms
182,640 KB
testcase_11 AC 610 ms
239,020 KB
testcase_12 AC 4 ms
4,376 KB
testcase_13 AC 2 ms
4,376 KB
testcase_14 AC 672 ms
247,544 KB
testcase_15 AC 631 ms
247,480 KB
testcase_16 AC 3 ms
4,380 KB
testcase_17 AC 140 ms
57,264 KB
testcase_18 AC 547 ms
214,556 KB
testcase_19 AC 72 ms
29,724 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <algorithm>
#include <utility>
#include <functional>
#include <cstring>
#include <queue>
#include <stack>
#include <math.h>
#include <iterator>
#include <vector>
#include <string>
#include <set>
#include <math.h>
#include <iostream> 
#include<map>
#include <stdlib.h>
#include <list>
#include <typeinfo>
#include <list>
#include <set>
#include <iomanip>
using namespace std;
#define MAX_MOD 1000000007
#define REP(i,n) for(int i = 0;i < n;++i)
bool can[6000][50000] = {};
int main() {
	can[0][0] = true;
	int n;
	cin >> n;
	for (int i = 1;i <= n;++i) {
		int a;
		cin >> a;
		for (int q = 0;q < 50000;++q) {
			can[i][a^q] = max(can[i - 1][q],can[i][a^q]);
			can[i][q] = max(can[i][q],can[i - 1][q]);
		}
	}
	int ans = 0;
	for (int q = 0;q < 50000;++q) {
		ans += can[n][q];
	}
	cout << ans << endl;
}
0