結果

問題 No.342 一番ワロタww
コンテスト
ユーザー daku9640
提出日時 2018-09-11 22:44:19
言語 Python3
(3.14.2 + numpy 2.4.0 + scipy 1.16.3)
結果
WA  
実行時間 -
コード長 635 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 248 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 10,880 KB
最終ジャッジ日時 2024-06-24 08:50:03
合計ジャッジ時間 1,623 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2 WA * 1
other AC * 11 WA * 3
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

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 = True
    for a in S[::-1] + "w":
        if flg:
            if a == "w":
                cnt += 1
            else:
                flg = False
                s = a
        else:
            if a == "w":
                flg = True
                m[cnt] += [s[::-1]]
                cnt = 1
            else:
                s += a
    return max(m.items())[1]
w = solve()
if w == []:
    print("")
else:
    print(*w, sep="\n")
0