結果

問題 No.893 お客様を誘導せよ
ユーザー ducktailducktail
提出日時 2019-10-10 14:14:42
言語 Scheme
(Gauche-0.9.14)
結果
AC  
実行時間 1,212 ms / 2,000 ms
コード長 612 bytes
コンパイル時間 397 ms
コンパイル使用メモリ 7,144 KB
実行使用メモリ 39,336 KB
最終ジャッジ日時 2023-08-13 12:57:19
合計ジャッジ時間 4,852 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 17 ms
11,732 KB
testcase_01 AC 18 ms
11,844 KB
testcase_02 AC 109 ms
16,108 KB
testcase_03 AC 416 ms
23,104 KB
testcase_04 AC 425 ms
22,952 KB
testcase_05 AC 335 ms
26,236 KB
testcase_06 AC 228 ms
21,088 KB
testcase_07 AC 17 ms
11,824 KB
testcase_08 AC 1,212 ms
39,336 KB
testcase_09 AC 25 ms
12,844 KB
testcase_10 AC 18 ms
11,912 KB
testcase_11 AC 18 ms
12,008 KB
testcase_12 AC 26 ms
12,800 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

(define (read-list n)
  (cond [(zero? n) '()]
        [else (let1 x (read)
                    (cons x (read-list (- n 1))))]))

(define (read-list-list n)
  (cond [(zero? n) '()]
        [else (let1 m (read)
                    (cons (read-list m) (read-list-list (- n 1))))]))

(define (solve lx)
  (let loop ([lx lx])
    (let1 ly (filter (^x (not (null? x))) lx)
          (cond [(null? ly) '()]
                [else (append (map car ly) (loop (map cdr ly)))]))))

(define (main args)
  (let* ([n (read)]
         [ls (read-list-list n)])
    (print (string-join (map number->string (solve ls)) " ")))
  0)
0