結果

問題 No.893 お客様を誘導せよ
ユーザー ducktail
提出日時 2019-10-10 14:14:42
言語 Scheme
(Gauche-0.9.15)
結果
AC  
実行時間 371 ms / 2,000 ms
コード長 612 bytes
コンパイル時間 125 ms
コンパイル使用メモリ 5,120 KB
実行使用メモリ 49,660 KB
最終ジャッジ日時 2024-11-21 07:58:02
合計ジャッジ時間 3,172 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 11
権限があれば一括ダウンロードができます

ソースコード

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