結果

問題 No.342 一番ワロタww
コンテスト
ユーザー peroon
提出日時 2019-06-05 20:32:15
言語 Python3
(3.14.7 + numpy 2.5.2 + scipy 1.18.0)
コンパイル:
python3 -mpy_compile _filename_
実行:
python3 _filename_
結果
AC  
実行時間 94 ms / 5,000 ms
+ 312µs
コード長 680 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 292 ms
コンパイル使用メモリ 21,596 KB
実行使用メモリ 15,788 KB
最終ジャッジ日時 2026-09-02 07:38:19
合計ジャッジ時間 3,258 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge2_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 14
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

# -*- coding: utf-8 -*-
from collections import defaultdict

s = input()
L = len(s)

# X文字の文字列のリストを管理
mp = defaultdict(list)

count = 0
t = ""
w = 'w'
last = ''

for i in reversed(range(L)):
    c = s[i]
    if c==w:
        if last==w:
            count += 1
        else:
            # register
            mp[count].append(t)
            t = ""
            count = 1
    # 文字
    else:
        if last=='':
            continue
        else:
            t = c + t
    last = c
    
if(t!=""):
    mp[count].append(t)

if len(mp)==0:
    exit(0)

keys = sorted(list(mp.keys()))
ma = keys[-1]

texts = mp[ma]
for s in reversed(texts):
    print(s)
0