結果

問題 No.183 たのしい排他的論理和(EASY)
ユーザー BantakoBantako
提出日時 2017-08-09 10:08:59
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 507 bytes
コンパイル時間 1,335 ms
コンパイル使用メモリ 163,372 KB
実行使用メモリ 362,832 KB
最終ジャッジ日時 2024-04-20 07:25:31
合計ジャッジ時間 3,400 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
6,812 KB
testcase_01 AC 2 ms
6,944 KB
testcase_02 AC 2 ms
6,940 KB
testcase_03 AC 2 ms
6,940 KB
testcase_04 AC 2 ms
6,948 KB
testcase_05 AC 2 ms
6,940 KB
testcase_06 AC 2 ms
6,940 KB
testcase_07 WA -
testcase_08 AC 175 ms
325,300 KB
testcase_09 AC 103 ms
229,836 KB
testcase_10 AC 132 ms
272,536 KB
testcase_11 AC 201 ms
350,940 KB
testcase_12 WA -
testcase_13 AC 2 ms
6,944 KB
testcase_14 AC 142 ms
165,648 KB
testcase_15 AC 229 ms
362,832 KB
testcase_16 AC 2 ms
6,944 KB
testcase_17 AC 38 ms
90,188 KB
testcase_18 WA -
testcase_19 AC 20 ms
46,280 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][20000];
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;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;i++)cnt += dp[N][i];
    cout << cnt << endl;
}
0