結果

問題 No.2773 Wake up Record 1
コンテスト
ユーザー ducktail
提出日時 2024-06-09 19:49:27
言語 Scheme
(Gauche-0.9.15)
コンパイル:
true
実行:
gosh _filename_
結果
AC  
実行時間 72 ms / 2,000 ms
コード長 494 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 213 ms
コンパイル使用メモリ 6,528 KB
実行使用メモリ 24,704 KB
最終ジャッジ日時 2026-06-04 07:56:27
合計ジャッジ時間 2,968 ms
ジャッジサーバーID
(参考情報)
judge1_0 / judge2_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 22
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

(define (solve n s)
  (let loop ([l '()]
             [i 0]
             [c #\x])
    (cond [(= i n) (reverse l)]
          [(and (char=? #\x c)
                (char=? #\o (string-ref s i))) (loop (cons (+ i 1) l) (+ i 1) (string-ref s i))]
          [else (loop l (+ i 1) (string-ref s i))])))

(define (main args)
  (let* ([n (read)]
         [s (symbol->string (read))])
    (let1 l (solve n s)
          (print (length l))
          (print (string-join (map number->string l) " "))))
  0)
0