結果

問題 No.342 一番ワロタww
コンテスト
ユーザー norioc
提出日時 2024-07-17 02:03:30
言語 PyPy3
(7.3.17)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
AC  
実行時間 37 ms / 5,000 ms
コード長 359 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 617 ms
コンパイル使用メモリ 85,120 KB
実行使用メモリ 64,000 KB
最終ジャッジ日時 2026-03-31 16:29:47
合計ジャッジ時間 1,967 ms
ジャッジサーバーID
(参考情報)
judge1_0 / judge3_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 14
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

import re

S = input()

w = 'w'
reg = re.compile('^[^w]*w+')
s = S
cands = []
while m := reg.match(s):
    t = m.group(0)
    if t[0] != w:
        cands.append((t, t.count(w)))
    s = s[len(t):]

if not cands:
    print()
    exit()

_, max_wcnt = max(cands, key=lambda x: x[1])
for s, wcnt in cands:
    if wcnt == max_wcnt:
        print(s[:-wcnt])
0