結果

問題 No.342 一番ワロタww
ユーザー daku9640daku9640
提出日時 2018-09-11 22:44:19
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 635 bytes
コンパイル時間 215 ms
コンパイル使用メモリ 10,960 KB
実行使用メモリ 8,452 KB
最終ジャッジ日時 2023-09-06 14:23:07
合計ジャッジ時間 1,421 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 17 ms
8,452 KB
testcase_02 AC 17 ms
8,360 KB
testcase_03 WA -
testcase_04 AC 17 ms
8,372 KB
testcase_05 AC 17 ms
8,420 KB
testcase_06 AC 17 ms
8,380 KB
testcase_07 WA -
testcase_08 AC 17 ms
8,416 KB
testcase_09 AC 21 ms
8,380 KB
testcase_10 AC 17 ms
8,448 KB
testcase_11 WA -
testcase_12 AC 16 ms
8,400 KB
testcase_13 AC 17 ms
8,408 KB
testcase_14 AC 17 ms
8,440 KB
testcase_15 AC 17 ms
8,412 KB
testcase_16 AC 17 ms
8,400 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import defaultdict
def solve():
    S = input()
    if "w" not in S or len(set(S)) == 1:
        return []
    S += '_'
    m = defaultdict(list)
    s = ""
    cnt = 0
    flg = True
    for a in S[::-1] + "w":
        if flg:
            if a == "w":
                cnt += 1
            else:
                flg = False
                s = a
        else:
            if a == "w":
                flg = True
                m[cnt] += [s[::-1]]
                cnt = 1
            else:
                s += a
    return max(m.items())[1]
w = solve()
if w == []:
    print("")
else:
    print(*w, sep="\n")
0