結果

問題 No.183 たのしい排他的論理和(EASY)
ユーザー _agatan
提出日時 2015-04-24 20:15:46
言語 D
(dmd 2.109.1)
結果
RE  
実行時間 -
コード長 414 bytes
コンパイル時間 1,321 ms
コンパイル使用メモリ 141,044 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-06-12 02:35:31
合計ジャッジ時間 3,166 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 15 RE * 3
権限があれば一括ダウンロードができます

ソースコード

diff #

import std.stdio, std.algorithm, std.array, std.conv, std.string;

bool[21384] dp;

void main()
{
    int N;
    readf("%d\n", &N);
    auto as = readln().split().map!(to!long);
    dp[0] = true;
    foreach(a; as) {
        dp[a^0] = true;
        for(int i = 16384; i >= 0; --i) {
            if(dp[i]){
                dp[i^a] = true;
            }
        }
    }
    writeln(dp[0..$].filter!"a"().count());
}
0