結果

問題 No.342 一番ワロタww
ユーザー yakeshiba
提出日時 2020-09-27 02:06:29
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 27 ms / 5,000 ms
コード長 591 bytes
コンパイル時間 82 ms
コンパイル使用メモリ 12,416 KB
実行使用メモリ 10,624 KB
最終ジャッジ日時 2024-06-30 03:10:49
合計ジャッジ時間 1,099 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 14
権限があれば一括ダウンロードができます

ソースコード

diff #

S = input()[::-1]

cnt = 0
moji = ""
ans = {}
for s in S:
    if s == "w":
        if cnt and moji:
            if cnt not in ans:
                ans[cnt] = [moji[::-1]]
            else:
                ans[cnt].append(moji[::-1])
            moji = ""
            cnt = 0
        cnt += 1
    else:
        if not cnt and not moji:
            continue
        moji += s
        
if moji:
    if cnt not in ans:
        ans[cnt] = [moji[::-1]]
    else:
        ans[cnt].append(moji[::-1])

try:
    for a in ans[max(ans.keys())][::-1]:
        print(a)
except ValueError:
    print("")
0