結果

問題 No.342 一番ワロタww
ユーザー Mr.FukuMr.Fuku
提出日時 2018-08-11 11:40:21
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 766 bytes
コンパイル時間 82 ms
コンパイル使用メモリ 11,852 KB
実行使用メモリ 10,012 KB
最終ジャッジ日時 2023-10-24 13:47:20
合計ジャッジ時間 1,522 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

s = input()
max_word = [s]

def cntw():
    global max_word
    max_cnt = 0
    cnt = 0
    i = len(s)-1
    while i>=0:
        if s[i]=="w":
            while s[i]=="w":
                cnt+=1
                i-=1
                if i<0:
                    return
            if cnt>=max_cnt:
                stock = ""
                while s[i]!="w":
                    stock = s[i] + stock
                    i-=1
                    if i<0:
                        break
                if cnt==max_cnt:
                    max_word.append(stock)
                else:
                    max_cnt=cnt
                    max_word = [stock]
            cnt=0
        else:
            i-=1

cntw()
max_word.reverse()
for ans in max_word:
    print(ans)
0