結果
問題 |
No.345 最小チワワ問題
|
ユーザー |
|
提出日時 | 2021-09-10 09:55:44 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 40 ms / 2,000 ms |
コード長 | 208 bytes |
コンパイル時間 | 184 ms |
コンパイル使用メモリ | 11,904 KB |
実行使用メモリ | 10,368 KB |
最終ジャッジ日時 | 2025-01-02 16:30:20 |
合計ジャッジ時間 | 2,411 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 29 |
ソースコード
S = input() L = len(S) import re cand = [] for i in range(L-1): for j in range(i+1, L+1): if re.match(".*c.*w.*w.*",S[i:j]): cand += [j-i] if cand: print(min(cand)) else: print(-1)