結果

問題 No.342 一番ワロタww
ユーザー HachimoriHachimori
提出日時 2016-02-12 23:02:39
言語 Python2
(2.7.18)
結果
RE  
実行時間 -
コード長 773 bytes
コンパイル時間 334 ms
コンパイル使用メモリ 7,160 KB
実行使用メモリ 6,472 KB
最終ジャッジ日時 2023-10-22 03:22:48
合計ジャッジ時間 1,224 ms
ジャッジサーバーID
(参考情報)
judge12 / judge9
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 10 ms
6,464 KB
testcase_01 AC 9 ms
6,464 KB
testcase_02 RE -
testcase_03 RE -
testcase_04 RE -
testcase_05 RE -
testcase_06 RE -
testcase_07 RE -
testcase_08 RE -
testcase_09 RE -
testcase_10 RE -
testcase_11 RE -
testcase_12 RE -
testcase_13 RE -
testcase_14 AC 9 ms
6,464 KB
testcase_15 AC 9 ms
6,464 KB
testcase_16 RE -
権限があれば一括ダウンロードができます

ソースコード

diff #

#!/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)
    
    print "\n".join(ansList[::-1])

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