結果

問題 No.1456 Range Xor
ユーザー yuruhiyayuruhiya
提出日時 2021-03-31 21:27:19
言語 Crystal
(1.11.2)
結果
AC  
実行時間 30 ms / 2,000 ms
コード長 420 bytes
コンパイル時間 23,115 ms
コンパイル使用メモリ 256,092 KB
実行使用メモリ 17,588 KB
最終ジャッジ日時 2023-08-21 23:23:17
合計ジャッジ時間 24,199 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 3 ms
4,568 KB
testcase_01 AC 3 ms
4,552 KB
testcase_02 AC 3 ms
4,380 KB
testcase_03 AC 28 ms
16,272 KB
testcase_04 AC 27 ms
16,720 KB
testcase_05 AC 27 ms
17,260 KB
testcase_06 AC 28 ms
16,640 KB
testcase_07 AC 30 ms
17,588 KB
testcase_08 AC 27 ms
16,108 KB
testcase_09 AC 27 ms
16,260 KB
testcase_10 AC 27 ms
17,044 KB
testcase_11 AC 8 ms
6,840 KB
testcase_12 AC 5 ms
5,312 KB
testcase_13 AC 12 ms
8,500 KB
testcase_14 AC 11 ms
8,432 KB
testcase_15 AC 24 ms
15,476 KB
testcase_16 AC 22 ms
14,008 KB
testcase_17 AC 14 ms
9,280 KB
testcase_18 AC 10 ms
8,496 KB
testcase_19 AC 17 ms
9,468 KB
testcase_20 AC 22 ms
15,192 KB
testcase_21 AC 16 ms
9,528 KB
testcase_22 AC 17 ms
9,616 KB
testcase_23 AC 12 ms
8,752 KB
testcase_24 AC 6 ms
6,476 KB
testcase_25 AC 11 ms
8,124 KB
testcase_26 AC 16 ms
9,408 KB
testcase_27 AC 22 ms
15,712 KB
testcase_28 AC 8 ms
7,020 KB
testcase_29 AC 28 ms
17,108 KB
testcase_30 AC 26 ms
15,156 KB
testcase_31 AC 8 ms
6,804 KB
testcase_32 AC 8 ms
6,440 KB
testcase_33 AC 13 ms
8,964 KB
testcase_34 AC 26 ms
16,272 KB
testcase_35 AC 15 ms
9,540 KB
testcase_36 AC 24 ms
12,136 KB
testcase_37 AC 26 ms
14,732 KB
testcase_38 AC 7 ms
6,428 KB
testcase_39 AC 22 ms
14,092 KB
testcase_40 AC 23 ms
15,596 KB
testcase_41 AC 4 ms
4,644 KB
testcase_42 AC 5 ms
5,620 KB
testcase_43 AC 2 ms
4,496 KB
testcase_44 AC 3 ms
4,440 KB
testcase_45 AC 3 ms
4,500 KB
testcase_46 AC 2 ms
4,412 KB
testcase_47 AC 3 ms
4,440 KB
testcase_48 AC 2 ms
4,416 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

lib C
  fun strtoll(s : UInt8*, p : UInt8**, b : Int32) : Int64
end

class String
  def to_i64
    C.strtoll(self, nil, 10)
  end
end

n, k = read_line.split.map(&.to_i)
a = read_line.split.map(&.to_i64)
b = [0i64]
(0...n).each { |i| b << (b[-1] ^ a[i]) }
c = Hash(Int64, Int32).new(0)
b.each { |x| c[x] += 1 }
puts c.any? { |key, v|
  key2 = key ^ k
  c.has_key?(key2) && (key != key2 || c[key2] >= 2)
} ? "Yes" : "No"
0