結果

問題 No.565 回転拡大
ユーザー ducktailducktail
提出日時 2018-01-01 16:06:24
言語 Scheme
(Gauche-0.9.14)
結果
AC  
実行時間 19 ms / 2,000 ms
コード長 1,024 bytes
コンパイル時間 75 ms
コンパイル使用メモリ 5,292 KB
実行使用メモリ 13,976 KB
最終ジャッジ日時 2023-08-24 15:39:24
合計ジャッジ時間 3,021 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 19 ms
13,976 KB
testcase_01 AC 18 ms
11,808 KB
testcase_02 AC 19 ms
11,796 KB
testcase_03 AC 18 ms
11,872 KB
testcase_04 AC 18 ms
11,840 KB
testcase_05 AC 17 ms
11,896 KB
testcase_06 AC 19 ms
11,796 KB
testcase_07 AC 18 ms
12,000 KB
testcase_08 AC 18 ms
11,892 KB
testcase_09 AC 18 ms
11,976 KB
testcase_10 AC 18 ms
11,780 KB
testcase_11 AC 17 ms
11,928 KB
testcase_12 AC 18 ms
11,824 KB
testcase_13 AC 18 ms
11,868 KB
testcase_14 AC 19 ms
11,820 KB
testcase_15 AC 18 ms
12,044 KB
testcase_16 AC 19 ms
11,800 KB
testcase_17 AC 18 ms
11,984 KB
testcase_18 AC 18 ms
11,820 KB
testcase_19 AC 18 ms
11,804 KB
testcase_20 AC 18 ms
11,872 KB
testcase_21 AC 18 ms
11,936 KB
testcase_22 AC 18 ms
12,004 KB
testcase_23 AC 19 ms
11,768 KB
testcase_24 AC 19 ms
11,796 KB
testcase_25 AC 18 ms
11,852 KB
testcase_26 AC 18 ms
11,972 KB
testcase_27 AC 18 ms
11,816 KB
testcase_28 AC 19 ms
11,788 KB
testcase_29 AC 19 ms
11,848 KB
testcase_30 AC 18 ms
11,824 KB
testcase_31 AC 18 ms
11,768 KB
testcase_32 AC 18 ms
11,868 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

(define (rotate-right mx)
  (let loop ([ls mx]
             [rs (make-list (length (car mx)) '())])
    (cond [(null? ls) rs]
          [else (loop (cdr ls) (map (lambda (x y) (cons x y)) (car ls) rs))])))

(define (rotate-pict mx r)
  (cond [(= r 90) (rotate-right mx)]
        [(= r 180) (rotate-right (rotate-right mx))]
        [(= r 270) (rotate-right (rotate-right (rotate-right mx)))]
        [else mx]))

(define (enlarge-print mx k)
  (for-each (lambda (rl)
              (let ([s (list->string
                        (concatenate
                         (map (lambda (x) (make-list k x)) rl)))])
                (dotimes (k) (print s)))
              ) mx))

(define (read-pict h)
  (let loop ([n h]
             [ls '()])
    (cond [(zero? n) (reverse ls)]
          [else (loop (- n 1) (cons (string->list (read-line)) ls))])))

(define (main args)
  (let* ([r (read)]
         [k (read)]
         [h (read)]
         [w (read-line)]
         [pl (read-pict h)])
    (enlarge-print (rotate-pict pl r) k))
  0)
0