結果

問題 No.1456 Range Xor
ユーザー simansiman
提出日時 2021-05-09 11:52:36
言語 Ruby
(3.3.0)
結果
AC  
実行時間 170 ms / 2,000 ms
コード長 233 bytes
コンパイル時間 368 ms
コンパイル使用メモリ 11,836 KB
実行使用メモリ 27,796 KB
最終ジャッジ日時 2023-10-18 22:04:16
合計ジャッジ時間 8,536 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 88 ms
16,048 KB
testcase_01 AC 87 ms
16,052 KB
testcase_02 AC 86 ms
16,052 KB
testcase_03 AC 158 ms
27,796 KB
testcase_04 AC 159 ms
27,796 KB
testcase_05 AC 160 ms
27,796 KB
testcase_06 AC 159 ms
27,796 KB
testcase_07 AC 170 ms
27,796 KB
testcase_08 AC 164 ms
27,796 KB
testcase_09 AC 163 ms
27,796 KB
testcase_10 AC 160 ms
27,796 KB
testcase_11 AC 104 ms
17,988 KB
testcase_12 AC 95 ms
16,576 KB
testcase_13 AC 116 ms
19,048 KB
testcase_14 AC 111 ms
19,044 KB
testcase_15 AC 145 ms
26,120 KB
testcase_16 AC 139 ms
25,696 KB
testcase_17 AC 123 ms
21,104 KB
testcase_18 AC 110 ms
18,952 KB
testcase_19 AC 126 ms
22,272 KB
testcase_20 AC 137 ms
25,628 KB
testcase_21 AC 127 ms
22,172 KB
testcase_22 AC 126 ms
22,376 KB
testcase_23 AC 112 ms
20,508 KB
testcase_24 AC 98 ms
17,196 KB
testcase_25 AC 113 ms
18,688 KB
testcase_26 AC 127 ms
21,424 KB
testcase_27 AC 132 ms
25,272 KB
testcase_28 AC 104 ms
18,548 KB
testcase_29 AC 158 ms
26,544 KB
testcase_30 AC 155 ms
27,472 KB
testcase_31 AC 103 ms
18,216 KB
testcase_32 AC 100 ms
18,008 KB
testcase_33 AC 116 ms
20,804 KB
testcase_34 AC 159 ms
27,372 KB
testcase_35 AC 122 ms
21,540 KB
testcase_36 AC 158 ms
27,680 KB
testcase_37 AC 157 ms
26,336 KB
testcase_38 AC 97 ms
17,280 KB
testcase_39 AC 137 ms
25,488 KB
testcase_40 AC 144 ms
25,396 KB
testcase_41 AC 91 ms
16,080 KB
testcase_42 AC 96 ms
16,888 KB
testcase_43 AC 87 ms
16,052 KB
testcase_44 AC 88 ms
16,052 KB
testcase_45 AC 87 ms
16,052 KB
testcase_46 AC 88 ms
16,052 KB
testcase_47 AC 88 ms
16,052 KB
testcase_48 AC 88 ms
16,052 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

N, K = gets.split.map(&:to_i)
A = gets.split.map(&:to_i)

hash = Hash.new
v = K

A.each do |a|
  v ^= a
  hash[v] = true
end

cur = 0

A.each do |a|
  cur ^= a

  if hash[cur] || cur == K
    puts 'Yes'
    exit
  end
end

puts 'No'
0