結果

問題 No.365 ジェンガソート
ユーザー ikdikd
提出日時 2019-08-05 10:08:42
言語 Scheme
(Gauche-0.9.14)
結果
AC  
実行時間 91 ms / 2,000 ms
コード長 440 bytes
コンパイル時間 38 ms
コンパイル使用メモリ 5,212 KB
実行使用メモリ 19,516 KB
最終ジャッジ日時 2023-09-25 16:41:11
合計ジャッジ時間 3,602 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 18 ms
11,692 KB
testcase_01 AC 18 ms
11,868 KB
testcase_02 AC 18 ms
11,632 KB
testcase_03 AC 17 ms
11,664 KB
testcase_04 AC 17 ms
11,696 KB
testcase_05 AC 18 ms
11,748 KB
testcase_06 AC 18 ms
11,868 KB
testcase_07 AC 18 ms
11,696 KB
testcase_08 AC 18 ms
11,888 KB
testcase_09 AC 18 ms
11,688 KB
testcase_10 AC 18 ms
11,680 KB
testcase_11 AC 18 ms
11,868 KB
testcase_12 AC 17 ms
11,688 KB
testcase_13 AC 19 ms
11,908 KB
testcase_14 AC 17 ms
11,788 KB
testcase_15 AC 18 ms
11,680 KB
testcase_16 AC 72 ms
16,600 KB
testcase_17 AC 86 ms
19,516 KB
testcase_18 AC 22 ms
12,860 KB
testcase_19 AC 84 ms
17,508 KB
testcase_20 AC 38 ms
13,776 KB
testcase_21 AC 36 ms
14,000 KB
testcase_22 AC 71 ms
16,480 KB
testcase_23 AC 55 ms
15,356 KB
testcase_24 AC 68 ms
15,912 KB
testcase_25 AC 36 ms
14,040 KB
testcase_26 AC 62 ms
15,468 KB
testcase_27 AC 90 ms
17,444 KB
testcase_28 AC 64 ms
15,308 KB
testcase_29 AC 87 ms
17,552 KB
testcase_30 AC 60 ms
15,364 KB
testcase_31 AC 39 ms
13,864 KB
testcase_32 AC 36 ms
13,884 KB
testcase_33 AC 87 ms
17,652 KB
testcase_34 AC 31 ms
13,792 KB
testcase_35 AC 70 ms
16,000 KB
testcase_36 AC 86 ms
17,656 KB
testcase_37 AC 84 ms
17,656 KB
testcase_38 AC 91 ms
17,472 KB
testcase_39 AC 87 ms
17,568 KB
testcase_40 AC 88 ms
17,440 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#! /usr/bin/env gosh

(let* ([n (read)]
      [a (let input ([i 0] [li (list)])
           (if (= i n)
             li
             (input (+ i 1) (cons (read) li))))])
  (let ([cost (let solve ([i 0] [li a] [tgt n] [res 0])
    (if (= i n)
      res
      (let* ([found (= (car li) tgt)])
        (solve (+ i 1)
               (cdr li)
               (- tgt (if found 1 0))
               (+ res (if found 0 1))))))])
    (display cost)))
0