結果

問題 No.495 (^^*) Easy
ユーザー hebiyan
提出日時 2017-05-18 00:51:22
言語 Scheme
(Gauche-0.9.15)
結果
AC  
実行時間 42 ms / 2,000 ms
コード長 476 bytes
コンパイル時間 68 ms
コンパイル使用メモリ 6,812 KB
実行使用メモリ 18,048 KB
最終ジャッジ日時 2024-09-17 21:06:21
合計ジャッジ時間 1,089 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 7
権限があれば一括ダウンロードができます

ソースコード

diff #

(use srfi-1)

(define (count-direction s l r)
  (cond
   ((or (null? s) (char=? #\# (car s))) `(,l ,r))
   (else
    (case (list-ref s 3)
      ((#\*)
       (count-direction (drop s 5) (+ 1 l) r))
      ((#\^)
       (count-direction (drop s 5) l (+ 1 r)))
      (else
       (count-direction (drop s 5) l r))))))

(letrec ((line (read-line))
         (lr (count-direction (string->list line)
                              0 0)))
  (format #t "~a ~a\n" (car lr) (cadr lr)))
0