結果

問題 No.632 穴埋め門松列
ユーザー maimai
提出日時 2017-07-16 11:42:15
言語 Scheme
(Gauche-0.9.14)
結果
AC  
実行時間 25 ms / 1,000 ms
コード長 680 bytes
コンパイル時間 82 ms
コンパイル使用メモリ 5,248 KB
実行使用メモリ 16,000 KB
最終ジャッジ日時 2024-04-16 22:30:24
合計ジャッジ時間 1,082 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

(define (iskadomatz? a b c)
    (and (not (= a c)) (or (and (< a b) (> b c)) (and (> a b) (< b c))))
)

; 2時間ぐらいググったけれど展開方法が分からなかったので気合
(define (iskadomatz2? arr a b)
    (iskadomatz? a b (car arr))
)
(define (iskadomatz1? arr a)
    (iskadomatz2? (cdr arr) a (car arr))
)
(define (iskadomatz-list? arr)
    (iskadomatz1? (cdr arr) (car arr))
)


(define (replace arr from to)
    (map (lambda (e) (if (equal? e from) to e)) arr)
)

(let
    (
         (bamboo (list (read) (read) (read)))
    )
    (if (iskadomatz-list? (replace bamboo '? 1)) (write 1) #f)
    (if (iskadomatz-list? (replace bamboo '? 4)) (write 4) #f)
)
0