結果
問題 |
No.345 最小チワワ問題
|
ユーザー |
|
提出日時 | 2024-05-09 20:06:44 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
WA
|
実行時間 | - |
コード長 | 272 bytes |
コンパイル時間 | 131 ms |
コンパイル使用メモリ | 12,544 KB |
実行使用メモリ | 10,752 KB |
最終ジャッジ日時 | 2024-12-17 13:30:05 |
合計ジャッジ時間 | 2,189 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 10 WA * 19 |
ソースコード
s = input() cww = "" idx = [] for i, v in enumerate(s): if v == "c": cww += v idx.append(i) elif v == "w": cww += v idx.append(i) if len(cww) == 3 and cww == "cww": print(idx[2] - idx[0] + 1) else: print(-1)