結果
問題 |
No.345 最小チワワ問題
|
ユーザー |
|
提出日時 | 2020-10-12 21:35:06 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
RE
|
実行時間 | - |
コード長 | 400 bytes |
コンパイル時間 | 91 ms |
コンパイル使用メモリ | 12,416 KB |
実行使用メモリ | 10,752 KB |
最終ジャッジ日時 | 2024-07-20 18:12:41 |
合計ジャッジ時間 | 2,031 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 RE * 1 |
other | AC * 19 WA * 3 RE * 7 |
ソースコード
# 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))