結果

問題 No.2024 Xer
ユーザー keiden
提出日時 2024-09-29 20:45:54
言語 Scheme
(Gauche-0.9.15)
結果
AC  
実行時間 961 ms / 2,000 ms
コード長 554 bytes
コンパイル時間 120 ms
コンパイル使用メモリ 6,820 KB
実行使用メモリ 40,132 KB
最終ジャッジ日時 2024-09-29 20:46:12
合計ジャッジ時間 17,674 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 47
権限があれば一括ダウンロードができます

ソースコード

diff #

(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