結果

問題 No.183 たのしい排他的論理和(EASY)
ユーザー tottoripaper
提出日時 2015-04-16 23:26:44
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 506 bytes
コンパイル時間 106 ms
コンパイル使用メモリ 23,552 KB
実行使用メモリ 81,456 KB
最終ジャッジ日時 2024-07-04 15:05:50
合計ジャッジ時間 1,471 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 15 WA * 3
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:9:10: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    9 |     scanf("%d", &N);
      |     ~~~~~^~~~~~~~~~
main.cpp:13:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   13 |         scanf("%d", A+i);
      |         ~~~~~^~~~~~~~~~~

ソースコード

diff #

// Wrongri-La Shower

#include <cstdio>

bool can[5001][(1<<14)+1];

int main(){
    int N;
    scanf("%d", &N);

    int A[5000];
    for(int i=0;i<N;i++){
        scanf("%d", A+i);
    }

    can[0][0] = true;
    for(int i=0;i<N;i++){
        for(int j=0;j<=1<<14;j++){
            if(!can[i][j]){continue;}

            can[i+1][j] = true;
            can[i+1][j^A[i]] = true;
        }
    }

    int res = 0;
    for(int i=0;i<=1<<14;i++){
        res += can[N][i];
    }

    printf("%d\n", res);
}
0