結果

問題 No.183 たのしい排他的論理和(EASY)
ユーザー BantakoBantako
提出日時 2017-08-09 10:11:20
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
MLE  
実行時間 -
コード長 511 bytes
コンパイル時間 1,678 ms
コンパイル使用メモリ 163,208 KB
実行使用メモリ 684,668 KB
最終ジャッジ日時 2024-04-20 08:20:45
合計ジャッジ時間 5,224 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 3 ms
6,816 KB
testcase_01 AC 3 ms
6,944 KB
testcase_02 AC 2 ms
6,944 KB
testcase_03 AC 2 ms
6,944 KB
testcase_04 AC 2 ms
6,940 KB
testcase_05 AC 3 ms
6,940 KB
testcase_06 AC 3 ms
6,940 KB
testcase_07 MLE -
testcase_08 MLE -
testcase_09 AC 200 ms
260,368 KB
testcase_10 MLE -
testcase_11 MLE -
testcase_12 AC 3 ms
6,940 KB
testcase_13 AC 2 ms
6,944 KB
testcase_14 MLE -
testcase_15 MLE -
testcase_16 AC 3 ms
6,940 KB
testcase_17 AC 73 ms
128,344 KB
testcase_18 MLE -
testcase_19 AC 38 ms
87,524 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp:7:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    7 | main(){
      | ^~~~

ソースコード

diff #

#include<bits/stdc++.h>
typedef long long ll;
using namespace std;
int INF = 1e9;
int MOD = 1e9+7;
int dp[5001][40000];
main(){
    int N,A[5000];
    cin >> N;
    for(int i = 0;i < N;i++)cin >> A[i];
    dp[0][0] = 1;
    for(int i = 0;i < N;i++){
        for(int j = 0;j <= 16384*2;j++){
            if(dp[i][j]){
                dp[i+1][j^A[i]] = 1;
                dp[i+1][j] = 1;
            }
        }
    }
    int cnt = 0;
    for(int i = 0;i <= 16384*2;i++)cnt += dp[N][i];
    cout << cnt << endl;
}
0