結果

問題 No.342 一番ワロタww
ユーザー kekenx
提出日時 2020-04-03 18:40:00
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
WA  
実行時間 -
コード長 601 bytes
コンパイル時間 85 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 10,752 KB
最終ジャッジ日時 2024-07-03 01:07:35
合計ジャッジ時間 1,129 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
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]
for r in res:
    if r[0] == x:
        print(r[1])
0