結果

問題 No.345 最小チワワ問題
ユーザー oz4point5
提出日時 2019-03-30 15:31:53
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
WA  
実行時間 -
コード長 509 bytes
コンパイル時間 210 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 10,752 KB
最終ジャッジ日時 2024-11-15 16:52:50
合計ジャッジ時間 2,303 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 14 WA * 15
権限があれば一括ダウンロードができます

ソースコード

diff #

# -*- coding: utf-8 -*-

s = list(input())

findc = True
findFW = False
findSW = False
first = 0
end = 0
ans = -1

for i in range(len(s)):
    if findc:
        if s[i] == "c":
            first = i
            findc = False
            findFW = True
    elif findFW:
        if s[i] == "w":
            findFW = False
            findSW = True
    elif findSW:
        if s[i] == "w":
            end = i
            findSW = False
            findc = True
            ans = max(ans,end-first+1)

print(ans)
0