結果

問題 No.342 一番ワロタww
ユーザー kekenxkekenx
提出日時 2020-04-03 18:34:59
言語 Python3
(3.11.6 + numpy 1.26.0 + scipy 1.11.3)
結果
WA  
実行時間 -
コード長 592 bytes
コンパイル時間 192 ms
コンパイル使用メモリ 10,868 KB
実行使用メモリ 7,928 KB
最終ジャッジ日時 2023-09-15 23:57:48
合計ジャッジ時間 1,390 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 17 ms
7,880 KB
testcase_02 AC 16 ms
7,808 KB
testcase_03 AC 16 ms
7,816 KB
testcase_04 AC 17 ms
7,812 KB
testcase_05 AC 16 ms
7,808 KB
testcase_06 AC 16 ms
7,848 KB
testcase_07 AC 16 ms
7,740 KB
testcase_08 AC 16 ms
7,828 KB
testcase_09 AC 16 ms
7,880 KB
testcase_10 AC 16 ms
7,812 KB
testcase_11 AC 16 ms
7,820 KB
testcase_12 AC 16 ms
7,816 KB
testcase_13 AC 16 ms
7,892 KB
testcase_14 WA -
testcase_15 AC 16 ms
7,828 KB
testcase_16 AC 16 ms
7,872 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

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

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