結果

問題 No.345 最小チワワ問題
ユーザー tarotaro789
提出日時 2017-06-27 23:57:04
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
WA  
実行時間 -
コード長 308 bytes
コンパイル時間 112 ms
コンパイル使用メモリ 12,416 KB
実行使用メモリ 10,624 KB
最終ジャッジ日時 2024-10-04 13:50:26
合計ジャッジ時間 2,016 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 17 WA * 12
権限があれば一括ダウンロードができます

ソースコード

diff #

st=input()
cnt=0
flg=0
ans=[]
try:
    for i in range(len(st)):
        if st[i]=="c":
            cix=i
            flg=1
        elif st[i]=="w" and flg==1:
            cnt+=1

        if cnt==2:
            ans.append(i-cix+1)
            cnt=0
            flg=0
    print(min(ans))
except:
    print(-1)
0