結果

問題 No.342 一番ワロタww
ユーザー 👑 yumechiyumechi
提出日時 2016-02-12 23:48:44
言語 PyPy3
(7.3.13)
結果
RE  
(最新)
AC  
(最初)
実行時間 -
コード長 578 bytes
コンパイル時間 892 ms
コンパイル使用メモリ 81,724 KB
実行使用メモリ 66,076 KB
最終ジャッジ日時 2023-10-22 03:42:18
合計ジャッジ時間 2,854 ms
ジャッジサーバーID
(参考情報)
judge13 / judge10
このコードへのチャレンジ(β)

テストケース

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

ソースコード

diff #

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()
0