結果

問題 No.342 一番ワロタww
ユーザー daku9640daku9640
提出日時 2018-09-11 22:50:35
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 20 ms / 5,000 ms
コード長 710 bytes
コンパイル時間 98 ms
コンパイル使用メモリ 10,784 KB
実行使用メモリ 8,516 KB
最終ジャッジ日時 2023-09-06 14:38:29
合計ジャッジ時間 1,291 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 20 ms
8,512 KB
testcase_01 AC 18 ms
8,356 KB
testcase_02 AC 18 ms
8,452 KB
testcase_03 AC 20 ms
8,328 KB
testcase_04 AC 18 ms
8,456 KB
testcase_05 AC 19 ms
8,380 KB
testcase_06 AC 18 ms
8,512 KB
testcase_07 AC 18 ms
8,332 KB
testcase_08 AC 18 ms
8,464 KB
testcase_09 AC 17 ms
8,348 KB
testcase_10 AC 17 ms
8,356 KB
testcase_11 AC 17 ms
8,516 KB
testcase_12 AC 17 ms
8,376 KB
testcase_13 AC 17 ms
8,404 KB
testcase_14 AC 17 ms
8,380 KB
testcase_15 AC 17 ms
8,452 KB
testcase_16 AC 18 ms
8,416 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import defaultdict
def solve():
    S = input()
    for i in range(len(S)):
        if S[i] != "w":
            S = S[i:]
            break
    if "w" not in S or len(set(S)) == 1:
        return []
    S += '_'
    m = defaultdict(list)
    s = ""
    cnt = 0
    flg = False
    for a in S:
        if flg:
            if a == "w":
                cnt += 1
            else:
                flg = False
                m[cnt] += [s]
                s = a
        else:
            if a == "w":
                flg = True
                cnt = 1
            else:
                s += a
    return max(m.items())[1]
w = solve()
if w == []:
    print("")
else:
    print(*w, sep="\n")
0