結果

問題 No.26 シャッフルゲーム
ユーザー MiyamonY
提出日時 2019-09-03 03:00:20
言語 Scheme
(Gauche-0.9.15)
結果
AC  
実行時間 31 ms / 5,000 ms
コード長 392 bytes
コンパイル時間 195 ms
コンパイル使用メモリ 6,820 KB
実行使用メモリ 16,000 KB
最終ジャッジ日時 2024-12-21 12:39:06
合計ジャッジ時間 1,195 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 10
権限があれば一括ダウンロードができます

ソースコード

diff #

(define (read-number)
  (string->number (read-line)))

(let ((n (read-number))
      (_ (read-number)))
  (let loop ((line (read-line)))
    (cond ((eof-object? line) (print n))
	  (else
	   (let ((tokens (map string->number (string-split line #\space))))
	     (cond ((= n (car tokens)) (set! n (cadr tokens)))
		   ((= n (cadr tokens)) (set! n (car tokens))))
	     (loop (read-line)))))))
0