結果

問題 No.342 一番ワロタww
ユーザー tsuchinagatsuchinaga
提出日時 2019-03-19 09:25:56
言語 Go
(1.22.1)
結果
WA  
実行時間 -
コード長 586 bytes
コンパイル時間 11,683 ms
コンパイル使用メモリ 210,816 KB
実行使用メモリ 4,356 KB
最終ジャッジ日時 2023-10-11 13:25:27
合計ジャッジ時間 11,883 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 1 ms
4,348 KB
testcase_02 AC 1 ms
4,352 KB
testcase_03 AC 1 ms
4,352 KB
testcase_04 AC 1 ms
4,352 KB
testcase_05 AC 2 ms
4,352 KB
testcase_06 AC 2 ms
4,348 KB
testcase_07 WA -
testcase_08 AC 2 ms
4,352 KB
testcase_09 AC 2 ms
4,348 KB
testcase_10 AC 2 ms
4,348 KB
testcase_11 AC 1 ms
4,348 KB
testcase_12 AC 2 ms
4,348 KB
testcase_13 AC 1 ms
4,352 KB
testcase_14 WA -
testcase_15 AC 1 ms
4,352 KB
testcase_16 AC 1 ms
4,348 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

package main

import "fmt"

func main() {
	var s, t string
	var w, max int
	_, _ = fmt.Scan(&s)

	ans := make([]string, 0)
	for _, r := range []rune(s) {
		if string(r) == "w" {
			w++
		} else {
			if w != 0 {
				if max < w && t != "" {
					ans = []string{t}
					max = w
				} else if max == w && t != "" {
					ans = append(ans, t)
				}

				t = ""
				w = 0
			}
			t += string(r)
		}
	}

	if max < w && t != "" {
		ans = []string{t}
		max = w
	} else if max == w && t != "" {
		ans = append(ans, t)
	}

	// fmt.Println(ans)

	for _, str := range ans {
		fmt.Println(str)
	}
}
0