結果

問題 No.712 赤旗
コンテスト
ユーザー keiden
提出日時 2024-09-17 13:07:41
言語 Scheme
(Gauche-0.9.15)
コンパイル:
true
実行:
gosh _filename_
結果
AC  
実行時間 18 ms / 2,000 ms
コード長 463 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 82 ms
コンパイル使用メモリ 6,400 KB
実行使用メモリ 16,384 KB
最終ジャッジ日時 2026-04-06 07:22:23
合計ジャッジ時間 622 ms
ジャッジサーバーID
(参考情報)
judge1_1 / judge3_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 5
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

(define (count-W-in-string s)
  (define (rec idx count)
    (if (= idx (string-length s))
      count
      (rec
        (+ idx 1)
        (if (char=? (string-ref s idx) #\W) (+ count 1) count))))
  (rec 0 0))

(define yuki712
  (let*
    (
      (n (read))
      (m (read))
      (_ (read-line))
      (s "")
    )
    (do
      ((i 0 (+ i 1)))
      ((= i n))
      (set! s (string-append s (read-line)))
    )
    (write (count-W-in-string s))
    (newline)))
0