結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
6,812 KB
testcase_01 AC 2 ms
6,944 KB
testcase_02 AC 2 ms
6,944 KB
testcase_03 AC 3 ms
6,940 KB
testcase_04 AC 2 ms
6,944 KB
testcase_05 AC 2 ms
6,940 KB
testcase_06 AC 3 ms
6,940 KB
testcase_07 MLE -
testcase_08 AC 314 ms
347,256 KB
testcase_09 AC 173 ms
252,000 KB
testcase_10 AC 219 ms
294,400 KB
testcase_11 AC 458 ms
372,880 KB
testcase_12 AC 2 ms
6,940 KB
testcase_13 AC 1 ms
6,940 KB
testcase_14 AC 257 ms
108,948 KB
testcase_15 AC 498 ms
385,520 KB
testcase_16 AC 3 ms
6,940 KB
testcase_17 AC 64 ms
121,580 KB
testcase_18 AC 466 ms
470,928 KB
testcase_19 AC 33 ms
73,300 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][32769];
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