結果

問題 No.26 シャッフルゲーム
ユーザー MiyamonYMiyamonY
提出日時 2019-09-03 03:00:20
言語 Scheme
(Gauche-0.9.14)
結果
AC  
実行時間 20 ms / 5,000 ms
コード長 392 bytes
コンパイル時間 72 ms
コンパイル使用メモリ 5,300 KB
実行使用メモリ 11,928 KB
最終ジャッジ日時 2023-08-23 10:33:26
合計ジャッジ時間 1,151 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 18 ms
11,672 KB
testcase_01 AC 19 ms
11,668 KB
testcase_02 AC 19 ms
11,712 KB
testcase_03 AC 19 ms
11,852 KB
testcase_04 AC 18 ms
11,764 KB
testcase_05 AC 19 ms
11,928 KB
testcase_06 AC 19 ms
11,684 KB
testcase_07 AC 18 ms
11,764 KB
testcase_08 AC 20 ms
11,904 KB
testcase_09 AC 19 ms
11,772 KB
権限があれば一括ダウンロードができます

ソースコード

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