結果
問題 | No.345 最小チワワ問題 |
ユーザー | iad_2889 |
提出日時 | 2019-04-30 07:33:53 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 29 ms / 2,000 ms |
コード長 | 447 bytes |
コンパイル時間 | 203 ms |
コンパイル使用メモリ | 12,544 KB |
実行使用メモリ | 10,624 KB |
最終ジャッジ日時 | 2024-10-01 05:17:49 |
合計ジャッジ時間 | 2,071 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 29 |
ソースコード
S = input() lens = len(S) length = -1 for i,c in enumerate(S): if c == "c": if i + 2 <= lens: count = 1 wcnt = 0 for w in S[i + 1:]: count+=1 if w == "w": wcnt+=1 if wcnt == 2: if length == -1 or length > count: length = count break print(length)