結果

問題 No.345 最小チワワ問題
ユーザー しらっ亭
提出日時 2016-02-27 01:36:00
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
WA  
実行時間 -
コード長 274 bytes
コンパイル時間 278 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 10,624 KB
最終ジャッジ日時 2024-09-24 10:56:56
合計ジャッジ時間 2,096 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 25 WA * 4
権限があれば一括ダウンロードができます

ソースコード

diff #

import re


def solve():
    S = input()

    p = re.compile('c[^c]*?w.*?w')
    ms = p.findall(S)
    if ms:
        ans = 114514
        for m in ms:
            ans = min(ans, len(m))
        print(ans)
    else:
        print(-1)

if __name__ == '__main__':
    solve()
0