結果

問題 No.183 たのしい排他的論理和(EASY)
ユーザー BantakoBantako
提出日時 2017-08-09 10:29:42
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 297 ms / 5,000 ms
コード長 512 bytes
コンパイル時間 1,432 ms
コンパイル使用メモリ 163,652 KB
実行使用メモリ 144,352 KB
最終ジャッジ日時 2023-09-12 13:56:41
合計ジャッジ時間 4,456 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,380 KB
testcase_01 AC 2 ms
4,376 KB
testcase_02 AC 2 ms
4,380 KB
testcase_03 AC 2 ms
4,376 KB
testcase_04 AC 2 ms
4,376 KB
testcase_05 AC 2 ms
4,380 KB
testcase_06 AC 2 ms
4,376 KB
testcase_07 AC 297 ms
144,352 KB
testcase_08 AC 236 ms
118,664 KB
testcase_09 AC 160 ms
96,460 KB
testcase_10 AC 195 ms
105,900 KB
testcase_11 AC 267 ms
135,432 KB
testcase_12 AC 2 ms
4,376 KB
testcase_13 AC 2 ms
4,376 KB
testcase_14 AC 225 ms
106,112 KB
testcase_15 AC 266 ms
135,860 KB
testcase_16 AC 2 ms
4,380 KB
testcase_17 AC 59 ms
39,424 KB
testcase_18 AC 249 ms
140,964 KB
testcase_19 AC 30 ms
21,020 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp:7:1: 警告: ISO C++ では型の無い ‘main’ の宣言を禁止しています [-Wreturn-type]
    7 | main(){
      | ^~~~

ソースコード

diff #

#include<bits/stdc++.h>
typedef long long ll;
using namespace std;
int INF = 1e9;
int MOD = 1e9+7;
bool 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