結果

問題 No.183 たのしい排他的論理和(EASY)
ユーザー 小指が強い人小指が強い人
提出日時 2016-01-06 00:40:27
言語 Ruby
(3.3.0)
結果
TLE  
実行時間 -
コード長 304 bytes
コンパイル時間 97 ms
コンパイル使用メモリ 11,892 KB
実行使用メモリ 17,132 KB
最終ジャッジ日時 2023-10-19 15:25:49
合計ジャッジ時間 7,409 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 90 ms
16,340 KB
testcase_01 AC 90 ms
16,340 KB
testcase_02 AC 89 ms
16,616 KB
testcase_03 AC 85 ms
16,340 KB
testcase_04 AC 85 ms
16,340 KB
testcase_05 AC 92 ms
17,132 KB
testcase_06 AC 88 ms
16,340 KB
testcase_07 TLE -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.rb:1: warning: assigned but unused variable - n
Syntax OK

ソースコード

diff #

n = gets.to_i
a = gets.split.map(&:to_i)
h = Hash.new
h[0] = true
buf = Array.new(2 ** 15)
a.each do |x|
    len = 0
    h.each_key do |k|
        y = x ^ k
        next if h.has_key?(y)
        buf[len] = y
        len += 1
    end
    len.times do |i|
        h[buf[i]] = true
    end
end
puts h.length
0