結果

問題 No.26 シャッフルゲーム
ユーザー _Clay_____Clay____
提出日時 2018-10-08 11:50:27
言語 Scheme
(Gauche-0.9.14)
結果
AC  
実行時間 22 ms / 5,000 ms
コード長 596 bytes
コンパイル時間 53 ms
コンパイル使用メモリ 6,812 KB
実行使用メモリ 16,000 KB
最終ジャッジ日時 2024-04-20 18:29:51
合計ジャッジ時間 963 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 21 ms
16,000 KB
testcase_01 AC 20 ms
15,872 KB
testcase_02 AC 21 ms
16,000 KB
testcase_03 AC 21 ms
15,872 KB
testcase_04 AC 22 ms
15,872 KB
testcase_05 AC 21 ms
16,000 KB
testcase_06 AC 22 ms
15,872 KB
testcase_07 AC 22 ms
16,000 KB
testcase_08 AC 21 ms
15,744 KB
testcase_09 AC 22 ms
16,000 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

(let* ((p (string->number (read-line)))
       (n (string->number (read-line)))
       (r (let loop ((i 1)
                     (r p))
                    (if (> i n)
                        r
                        (let* ((l (map string->number (string-split (read-line) " ")))
                               (a (car l))
                               (b (cadr l))) 
                              (loop (+ i 1)
                                    (cond ((= r a) b)
                                          ((= r b) a)
                                          (else r))))))))
      (print r)) 
0