結果
問題 |
No.345 最小チワワ問題
|
ユーザー |
|
提出日時 | 2020-10-12 21:38:30 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
WA
|
実行時間 | - |
コード長 | 407 bytes |
コンパイル時間 | 223 ms |
コンパイル使用メモリ | 12,544 KB |
実行使用メモリ | 10,752 KB |
最終ジャッジ日時 | 2024-07-20 18:13:15 |
合計ジャッジ時間 | 2,006 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 18 WA * 11 |
ソースコード
# coding=utf-8: import re s = str(input()) c = re.compile(r'.*c.*w.*w') if "cww" in s: print(3) if re.search(c, s) == None: print(-1) elif len(s) >= 4: 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))