結果

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

ソースコード

diff #

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

bool[213805] 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