結果

問題 No.342 一番ワロタww
ユーザー daku9640
提出日時 2018-09-11 22:26:56
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
WA  
実行時間 -
コード長 617 bytes
コンパイル時間 90 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 10,880 KB
最終ジャッジ日時 2024-06-24 08:20:50
合計ジャッジ時間 1,382 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2 WA * 1
other AC * 13 WA * 1
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import defaultdict
def solve():
    S = input()
    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