結果
問題 |
No.2773 Wake up Record 1
|
ユーザー |
|
提出日時 | 2024-06-09 19:49:27 |
言語 | Scheme (Gauche-0.9.15) |
結果 |
AC
|
実行時間 | 112 ms / 2,000 ms |
コード長 | 494 bytes |
コンパイル時間 | 246 ms |
コンパイル使用メモリ | 5,248 KB |
実行使用メモリ | 24,320 KB |
最終ジャッジ日時 | 2024-12-30 19:20:49 |
合計ジャッジ時間 | 3,885 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 22 |
ソースコード
(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)