結果
問題 |
No.342 一番ワロタww
|
ユーザー |
|
提出日時 | 2016-02-12 23:48:44 |
言語 | PyPy3 (7.3.15) |
結果 |
RE
(最新)
AC
(最初)
|
実行時間 | - |
コード長 | 578 bytes |
コンパイル時間 | 420 ms |
コンパイル使用メモリ | 81,972 KB |
実行使用メモリ | 65,764 KB |
最終ジャッジ日時 | 2024-09-22 05:06:11 |
合計ジャッジ時間 | 2,094 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 13 RE * 1 |
ソースコード
import re def solve(): s = input() if s.count("w") == 0 or s.count("w") == len(s): print("") return True s = re.sub(r"^w+", "", s) removeW = re.sub(r"w+", "w", s) splitList = removeW.split("w") matchwords = re.findall(r"w+", s) maxW = max([len(c) for c in matchwords]) idxlist = [] for i in range(len(matchwords)): if len(matchwords[i]) == maxW: idxlist.append(i) idxlist.sort() print("\n".join([splitList[i] for i in idxlist])) return True if __name__=="__main__": solve()