結果

問題 No.345 最小チワワ問題
ユーザー R N
提出日時 2020-10-12 21:34:14
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
RE  
実行時間 -
コード長 396 bytes
コンパイル時間 301 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 10,752 KB
最終ジャッジ日時 2024-07-20 18:12:38
合計ジャッジ時間 2,434 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2 RE * 1
other AC * 10 WA * 3 RE * 16
権限があれば一括ダウンロードができます

ソースコード

diff #

# coding=utf-8:

import re

s = str(input())
if "cww" in s:
    print(3)
elif len(s) < 3:
    print(-1)
elif len(s) >= 4:
    c = re.compile(r'.*c.*w.*w')
    countList = list()
    for i in range(len(s)):
        temp1 = re.search(c, s[i:])
        if temp1 != None:
            temp2 = temp1.group()
            countList.append(len(temp2))
        else:
            break
print(min(countList))
0