結果
| 問題 | No.345 最小チワワ問題 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-10-12 21:34:14 |
| 言語 | Python3 (3.14.3 + numpy 2.4.4 + scipy 1.17.1) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 396 bytes |
| 記録 | |
| コンパイル時間 | 304 ms |
| コンパイル使用メモリ | 21,280 KB |
| 実行使用メモリ | 20,660 KB |
| 最終ジャッジ日時 | 2026-08-20 09:10:00 |
| 合計ジャッジ時間 | 7,451 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 RE * 1 |
| other | AC * 10 WA * 3 RE * 16 |
ソースコード
# 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))