結果

問題 No.183 たのしい排他的論理和(EASY)
ユーザー yuly3yuly3
提出日時 2020-01-30 02:56:25
言語 Nim
(2.0.2)
結果
RE  
実行時間 -
コード長 399 bytes
コンパイル時間 2,961 ms
コンパイル使用メモリ 68,888 KB
実行使用メモリ 4,484 KB
最終ジャッジ日時 2023-10-14 08:07:21
合計ジャッジ時間 4,820 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,348 KB
testcase_01 AC 2 ms
4,348 KB
testcase_02 AC 2 ms
4,348 KB
testcase_03 AC 2 ms
4,348 KB
testcase_04 AC 2 ms
4,348 KB
testcase_05 AC 3 ms
4,348 KB
testcase_06 AC 2 ms
4,352 KB
testcase_07 RE -
testcase_08 AC 149 ms
4,348 KB
testcase_09 AC 103 ms
4,348 KB
testcase_10 AC 123 ms
4,348 KB
testcase_11 AC 162 ms
4,352 KB
testcase_12 RE -
testcase_13 AC 2 ms
4,348 KB
testcase_14 AC 105 ms
4,352 KB
testcase_15 AC 168 ms
4,352 KB
testcase_16 AC 3 ms
4,352 KB
testcase_17 AC 39 ms
4,480 KB
testcase_18 RE -
testcase_19 AC 20 ms
4,348 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import strutils, sequtils, math


proc solve() =
    var
        _ = stdin.readLine.parseInt
        A = stdin.readLine.strip.split.map(parseInt)
        dp: array[16385, int]
    
    dp[0] = 1
    for a in A:
        var dp_tmp = dp
        for i in 0..<dp.len:
            if dp[i] == 1:
                dp_tmp[i xor a] = 1
        dp = dp_tmp
    echo sum(dp)


when is_main_module:
    solve()
0