結果

問題 No.82 市松模様
ユーザー RinRin
提出日時 2015-08-27 16:00:44
言語 Scheme
(Gauche-0.9.14)
結果
AC  
実行時間 20 ms / 5,000 ms
コード長 664 bytes
コンパイル時間 31 ms
コンパイル使用メモリ 5,212 KB
実行使用メモリ 12,120 KB
最終ジャッジ日時 2023-09-25 18:53:59
合計ジャッジ時間 881 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 19 ms
11,556 KB
testcase_01 AC 18 ms
11,720 KB
testcase_02 AC 18 ms
11,632 KB
testcase_03 AC 19 ms
11,784 KB
testcase_04 AC 19 ms
11,728 KB
testcase_05 AC 18 ms
11,612 KB
testcase_06 AC 19 ms
11,828 KB
testcase_07 AC 18 ms
11,856 KB
testcase_08 AC 20 ms
11,928 KB
testcase_09 AC 20 ms
12,120 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

(define (System.out.println x)
  (begin
    (display x)
    (newline)
  )
)

(define (CngClr C)
  (if (string=? C "W")
      "B"
      "W"
  )
)

(let (
      (W (read))
      (H (read))
      (C (symbol->string (read)))
     )
  (let loop((i 1) (j 1) (Color C))
    (begin
      (display Color)
      (if (= i W)
          (if (= j H)
                (newline)
                (begin
                  (newline)
                  (if (= (modulo W 2) 0)
                      (loop 1 (+ j 1) Color)
                      (loop 1 (+ j 1) (CngClr Color))
                  )
                )
          )
          (loop (+ i 1) j (CngClr Color))
      )
    )
  )
)
0