結果

問題 No.342 一番ワロタww
ユーザー Mr.FukuMr.Fuku
提出日時 2018-08-11 11:41:39
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 27 ms / 5,000 ms
コード長 767 bytes
コンパイル時間 78 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 10,752 KB
最終ジャッジ日時 2024-04-23 13:38:25
合計ジャッジ時間 1,100 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

s = input()
max_word = [""]

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