結果

問題 No.183 たのしい排他的論理和(EASY)
ユーザー 777yuuki12323777yuuki12323
提出日時 2017-06-28 14:34:58
言語 C++11
(gcc 11.4.0)
結果
MLE  
実行時間 -
コード長 1,034 bytes
コンパイル時間 1,435 ms
コンパイル使用メモリ 72,380 KB
実行使用メモリ 643,708 KB
最終ジャッジ日時 2024-04-15 04:02:44
合計ジャッジ時間 26,566 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
6,816 KB
testcase_01 AC 2 ms
6,944 KB
testcase_02 AC 3 ms
6,940 KB
testcase_03 AC 3 ms
6,940 KB
testcase_04 AC 2 ms
6,944 KB
testcase_05 AC 4 ms
7,116 KB
testcase_06 AC 3 ms
6,940 KB
testcase_07 MLE -
testcase_08 MLE -
testcase_09 RE -
testcase_10 RE -
testcase_11 MLE -
testcase_12 AC 25 ms
6,944 KB
testcase_13 AC 2 ms
6,944 KB
testcase_14 MLE -
testcase_15 TLE -
testcase_16 AC 3 ms
6,944 KB
testcase_17 RE -
testcase_18 MLE -
testcase_19 RE -
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:47:22: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   47 |                 scanf("%d", A+i);
      |                 ~~~~~^~~~~~~~~~~

ソースコード

diff #

#include <iostream>
#include <cstdio>
#include <cmath>
#include <algorithm>
#include <string>
#include <map>
#include <bitset>
#include <vector>
#include <queue>


typedef long long ll;
#define fi first
#define se second
const ll mod = 1000000007;
//              123456789

using namespace std;

///////////////////////////////////////////////
//DP問題
//自力◎
///////////////////////////////////////////////

////////////////////////////////////////////////
////////////////////////////////////////////////

int N;
int idx;
int top = 0;
int ans = 0;
int A[112];
int dp[5123][32780];


int main(){
	
	int i;
	int j;
	int flag = 0;
	
	cin>>N;
	
	fill( dp[0], dp[N], 0 );
	
	for( i = 0; i < N; i++ ){
		scanf("%d", A+i);
		top = max( top, A[i] );
	}
	
	top *= 2;
	
	dp[0][0] = 1;
	
	for( i = 1; i <= N; i++ ){
		for( j = 0; j <= top; j++ ){
			if( dp[i-1][j] ){
				idx = j ^ A[i-1];
				dp[i][idx] = 1;
				dp[i][j] = 1;
			}
		}
	}
	
	
	for( i = 0; i < top; i++ ){
		if( dp[N][i] ) ans++;
	}
	
	cout<<ans<<endl;
		
	return 0;
}
0