結果

問題 No.342 一番ワロタww
ユーザー peroonperoon
提出日時 2019-06-05 20:21:13
言語 Python3
(3.11.6 + numpy 1.26.0 + scipy 1.11.3)
結果
WA  
実行時間 -
コード長 643 bytes
コンパイル時間 87 ms
コンパイル使用メモリ 11,960 KB
実行使用メモリ 10,040 KB
最終ジャッジ日時 2023-10-22 06:06:08
合計ジャッジ時間 1,410 ms
ジャッジサーバーID
(参考情報)
judge12 / judge10
このコードへのチャレンジ(β)

テストケース

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

ソースコード

diff #

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

s = input()

#print(s)
L = len(s)
#print("L", L)

mp = defaultdict(list)

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

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

if(t!=""):
    mp[count].append(t)

# print(mp)

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

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