結果

問題 No.345 最小チワワ問題
ユーザー a_ten
提出日時 2016-03-07 20:51:18
言語 Python2
(2.7.18)
結果
WA  
実行時間 -
コード長 265 bytes
コンパイル時間 148 ms
コンパイル使用メモリ 7,040 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-09-24 15:12:18
合計ジャッジ時間 1,803 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 8 WA * 14 RE * 7
権限があれば一括ダウンロードができます

ソースコード

diff #

#coding:utf-8

str=raw_input()
cww=str[str.index('c'):]

c_w=list(cww[:cww.index('w')+1])

s=[]
for i in cww[cww.index('w')+1:]:
	if 'w' not in i:
		s.append(i)
	else:
		s.append('w')
		break

if not c_w or not s or 'w' not in s:
	print -1
else:
	print len(c_w + s)
0