結果
| 問題 | 
                            No.342 一番ワロタww
                             | 
                    
| コンテスト | |
| ユーザー | 
                             | 
                    
| 提出日時 | 2018-09-11 22:50:35 | 
| 言語 | Python3  (3.13.1 + numpy 2.2.1 + scipy 1.14.1)  | 
                    
| 結果 | 
                             
                                AC
                                 
                             
                            
                         | 
                    
| 実行時間 | 34 ms / 5,000 ms | 
| コード長 | 710 bytes | 
| コンパイル時間 | 333 ms | 
| コンパイル使用メモリ | 12,672 KB | 
| 実行使用メモリ | 10,880 KB | 
| 最終ジャッジ日時 | 2024-06-24 09:03:57 | 
| 合計ジャッジ時間 | 1,607 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge3 / judge1 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 14 | 
ソースコード
from collections import defaultdict
def solve():
    S = input()
    for i in range(len(S)):
        if S[i] != "w":
            S = S[i:]
            break
    if "w" not in S or len(set(S)) == 1:
        return []
    S += '_'
    m = defaultdict(list)
    s = ""
    cnt = 0
    flg = False
    for a in S:
        if flg:
            if a == "w":
                cnt += 1
            else:
                flg = False
                m[cnt] += [s]
                s = a
        else:
            if a == "w":
                flg = True
                cnt = 1
            else:
                s += a
    return max(m.items())[1]
w = solve()
if w == []:
    print("")
else:
    print(*w, sep="\n")