結果
問題 |
No.2773 Wake up Record 1
|
ユーザー |
|
提出日時 | 2024-06-15 22:46:48 |
言語 | Go (1.23.4) |
結果 |
AC
|
実行時間 | 98 ms / 2,000 ms |
コード長 | 484 bytes |
コンパイル時間 | 16,803 ms |
コンパイル使用メモリ | 222,460 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-06-15 22:47:08 |
合計ジャッジ時間 | 16,119 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 22 |
ソースコード
// No.2773 Wake up Record 1 package main import ( "fmt" "strconv" "strings" ) func main() { var n int fmt.Scan(&n) var s string fmt.Scan(&s) var ans []string if strings.HasPrefix(s, "o") { ans = append(ans, "1") } w := strings.SplitAfter(s, "xo") l := 0 for i := 0; i < len(w); i++ { if !strings.HasSuffix(w[i], "xo") { break } x := l + len(w[i]) ans = append(ans, strconv.Itoa(x)) l = x } fmt.Println(len(ans)) fmt.Println(strings.Join(ans, " ")) }