結果

問題 No.345 最小チワワ問題
ユーザー A A
提出日時 2024-03-11 00:33:54
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
WA  
実行時間 -
コード長 263 bytes
コンパイル時間 73 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 10,752 KB
最終ジャッジ日時 2024-09-29 21:47:47
合計ジャッジ時間 1,609 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 15 WA * 14
権限があれば一括ダウンロードができます

ソースコード

diff #

S = input()
first_c = S.find("c")
first_w = (S[(first_c + 1):].find("w")) + first_c + 1
second_w = (S[(first_w + 1):].find("w")) + first_w + 1

if (first_c >= 0) and (first_w != first_c) and (second_w != first_w):
  print(second_w - first_c + 1)
else:
  print(-1)
0