結果
問題 | No.342 一番ワロタww |
ユーザー |
|
提出日時 | 2016-02-13 00:00:17 |
言語 | Python2 (2.7.18) |
結果 |
AC
|
実行時間 | 12 ms / 5,000 ms |
コード長 | 785 bytes |
コンパイル時間 | 78 ms |
コンパイル使用メモリ | 7,040 KB |
実行使用メモリ | 6,400 KB |
最終ジャッジ日時 | 2024-10-15 13:15:04 |
合計ジャッジ時間 | 937 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 14 |
ソースコード
#!/usr/bin/env python#coding:utf8def read():return raw_input().decode('utf-8')def work(s):ansList = []maxLeng = 0idx = len(s) - 1while idx >= 0:cnt = 0while idx >= 0 and s[idx] == 'w'.decode('utf-8'):cnt += 1idx -= 1toPush = ''while idx >= 0 and s[idx] != 'w'.decode('utf-8'):toPush += s[idx]idx -= 1toPush = toPush[::-1].encode('utf-8')if cnt == 0 or len(toPush) == 0:continueif maxLeng < cnt:ansList = [toPush]maxLeng = cntelif maxLeng == cnt:ansList.append(toPush)print "\n".join(ansList[::-1])if __name__ == "__main__":work(read())