結果

問題 No.342 一番ワロタww
コンテスト
ユーザー Hachimori
提出日時 2016-02-12 23:05:03
言語 PyPy2
(7.3.20)
結果
RE  
実行時間 -
コード長 789 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 157 ms
コンパイル使用メモリ 76,792 KB
最終ジャッジ日時 2025-12-03 19:18:51
ジャッジサーバーID
(参考情報)
judge1 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample RE * 3
other AC * 4 RE * 10
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#!/usr/bin/env python
#coding:utf8

def read():
    return raw_input().decode('utf-8')


def work(s):
    ansList = []
    maxLeng = 0
    idx = len(s) - 1
    
    while idx >= 0:
        cnt = 0
        while idx >= 0 and s[idx] == 'w'.decode('utf-8'):
            cnt += 1
            idx -= 1

        toPush = ''
        while idx >= 0 and s[idx] != 'w'.decode('utf-8'):
            toPush += s[idx]
            idx -= 1
        toPush = toPush[::-1]    

        if cnt == 0 or len(toPush) == 0:
            continue
        
        if maxLeng < cnt:
            ansList = [toPush]
            maxLeng = cnt
        elif maxLeng == cnt:
            ansList.append(toPush)

    if ansList:
        print "\n".join(ansList[::-1])

    
if __name__ == "__main__":
    work(read())
0