結果
問題 | No.183 たのしい排他的論理和(EASY) |
ユーザー | wotsushi |
提出日時 | 2016-12-24 14:00:12 |
言語 | Ruby (3.3.0) |
結果 |
MLE
|
実行時間 | - |
コード長 | 282 bytes |
コンパイル時間 | 398 ms |
コンパイル使用メモリ | 11,120 KB |
実行使用メモリ | 818,748 KB |
最終ジャッジ日時 | 2023-08-21 07:53:13 |
合計ジャッジ時間 | 7,863 ms |
ジャッジサーバーID (参考情報) |
judge13 / judge14 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 101 ms
17,720 KB |
testcase_01 | AC | 126 ms
20,364 KB |
testcase_02 | AC | 165 ms
25,832 KB |
testcase_03 | AC | 154 ms
24,160 KB |
testcase_04 | AC | 108 ms
18,484 KB |
testcase_05 | AC | 173 ms
26,524 KB |
testcase_06 | AC | 131 ms
21,196 KB |
testcase_07 | MLE | - |
testcase_08 | -- | - |
testcase_09 | -- | - |
testcase_10 | -- | - |
testcase_11 | -- | - |
testcase_12 | -- | - |
testcase_13 | -- | - |
testcase_14 | -- | - |
testcase_15 | -- | - |
testcase_16 | -- | - |
testcase_17 | -- | - |
testcase_18 | -- | - |
testcase_19 | -- | - |
コンパイルメッセージ
Syntax OK
ソースコード
N = gets.to_i A = gets.split().map(&:to_i) dp = Array.new(2**14, false) dp[0] = true A.product([*0...(2**14)]).each do |a, i| if a < 2**14 dp[i ^ a] ||= dp[i] end end ans = if A.include?(2**14) 2 * dp.count(true) else dp.count(true) end puts ans