結果
| 問題 | No.345 最小チワワ問題 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-05-09 20:06:44 |
| 言語 | Python3 (3.14.3 + numpy 2.4.4 + scipy 1.17.1) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 272 bytes |
| 記録 | |
| コンパイル時間 | 365 ms |
| コンパイル使用メモリ | 20,824 KB |
| 実行使用メモリ | 15,488 KB |
| 最終ジャッジ日時 | 2026-05-26 17:55:17 |
| 合計ジャッジ時間 | 4,973 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge3_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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)