結果

問題 No.2024 Xer
コンテスト
ユーザー keiden
提出日時 2024-09-29 20:45:54
言語 Scheme
(Gauche-0.9.15)
コンパイル:
true
実行:
gosh _filename_
結果
AC  
実行時間 686 ms / 2,000 ms
コード長 554 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 271 ms
コンパイル使用メモリ 8,228 KB
実行使用メモリ 40,376 KB
最終ジャッジ日時 2026-04-16 03:41:29
合計ジャッジ時間 13,958 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge2_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 47
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

(use scheme.sort)

(define yuki2024
  (let* ((n (read))
         (x (read))
         (an (make-vector n))
         (k<? (lambda (px py) (< (+ px (logxor px x)) (+ py (logxor py x))))))
    (dotimes (i n) (vector-set! an i (read)))
    (vector-sort! k<? an)
    (let loop ((i 0))
      (if (= i (- n 1))
        (display "Yes\n")
        (cond
          ((>= (vector-ref an i) (logxor (vector-ref an (+ i 1)) x)) (display "No\n"))
          ((<= (vector-ref an (+ i 1)) (logxor (vector-ref an i) x)) (display "No\n"))
          (else (loop (+ i 1))))))))
0