結果

問題 No.342 一番ワロタww
ユーザー kekenx
提出日時 2020-04-03 18:42:10
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
WA  
実行時間 -
コード長 642 bytes
コンパイル時間 112 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 10,752 KB
最終ジャッジ日時 2024-07-03 01:07:47
合計ジャッジ時間 1,151 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample WA * 3
other WA * 14
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

S = readline().decode().strip()

print(S)
while S.startswith('w'):
    S = S[1:]


cans = []
is_w = False
t = ""
for s in S:
    if s == 'w':
        is_w = True
    elif is_w and s != 'w':
        cans.append(t)
        is_w = False
        t = ""
    t += s

cans.append(t)

res = []
for can in cans:
    cnt = can.count('w')
    res.append([cnt, can.replace('w', '')])

res.sort(key=lambda x: int(x[0]))
x = res[-1][0]
if x == 0:
    print()
else:
    for r in res:
        if r[0] == x:
            print(r[1])
0