結果

問題 No.495 (^^*) Easy
ユーザー hebiyanhebiyan
提出日時 2017-05-18 00:51:22
言語 Scheme
(Gauche-0.9.14)
結果
AC  
実行時間 42 ms / 2,000 ms
コード長 476 bytes
コンパイル時間 39 ms
コンパイル使用メモリ 5,152 KB
実行使用メモリ 18,032 KB
最終ジャッジ日時 2023-10-18 00:01:49
合計ジャッジ時間 1,133 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 26 ms
16,452 KB
testcase_01 AC 26 ms
16,452 KB
testcase_02 AC 25 ms
16,452 KB
testcase_03 AC 26 ms
16,456 KB
testcase_04 AC 25 ms
16,476 KB
testcase_05 AC 27 ms
16,652 KB
testcase_06 AC 42 ms
18,032 KB
権限があれば一括ダウンロードができます

ソースコード

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