結果

問題 No.342 一番ワロタww
ユーザー peroonperoon
提出日時 2019-06-05 20:32:15
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 33 ms / 5,000 ms
コード長 680 bytes
コンパイル時間 172 ms
コンパイル使用メモリ 11,924 KB
実行使用メモリ 10,048 KB
最終ジャッジ日時 2023-10-22 06:24:56
合計ジャッジ時間 1,412 ms
ジャッジサーバーID
(参考情報)
judge11 / judge9
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 33 ms
10,048 KB
testcase_01 AC 31 ms
10,048 KB
testcase_02 AC 30 ms
10,048 KB
testcase_03 AC 30 ms
10,048 KB
testcase_04 AC 29 ms
10,048 KB
testcase_05 AC 29 ms
10,048 KB
testcase_06 AC 30 ms
10,048 KB
testcase_07 AC 30 ms
10,048 KB
testcase_08 AC 29 ms
10,048 KB
testcase_09 AC 29 ms
10,048 KB
testcase_10 AC 30 ms
10,048 KB
testcase_11 AC 30 ms
10,048 KB
testcase_12 AC 30 ms
10,048 KB
testcase_13 AC 29 ms
10,048 KB
testcase_14 AC 30 ms
10,048 KB
testcase_15 AC 30 ms
10,048 KB
testcase_16 AC 29 ms
10,048 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

# -*- coding: utf-8 -*-
from collections import defaultdict

s = input()
L = len(s)

# X文字の文字列のリストを管理
mp = defaultdict(list)

count = 0
t = ""
w = 'w'
last = ''

for i in reversed(range(L)):
    c = s[i]
    if c==w:
        if last==w:
            count += 1
        else:
            # register
            mp[count].append(t)
            t = ""
            count = 1
    # 文字
    else:
        if last=='':
            continue
        else:
            t = c + t
    last = c
    
if(t!=""):
    mp[count].append(t)

if len(mp)==0:
    exit(0)

keys = sorted(list(mp.keys()))
ma = keys[-1]

texts = mp[ma]
for s in reversed(texts):
    print(s)
0