結果

問題 No.345 最小チワワ問題
ユーザー akihito0000
提出日時 2016-09-15 23:05:55
言語 Python2
(2.7.18)
結果
WA  
実行時間 -
コード長 361 bytes
コンパイル時間 57 ms
コンパイル使用メモリ 6,784 KB
実行使用メモリ 6,272 KB
最終ジャッジ日時 2024-11-17 06:16:02
合計ジャッジ時間 1,429 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 15 WA * 14
権限があれば一括ダウンロードができます

ソースコード

diff #

#!/usr/bin/python
# -*- coding: utf-8 -*-

str = raw_input()
flag = 0
count = 0
for i in str:
	if i == "c" and flag == 0:
		flag = 1
		count += 1
	elif i == "w" and flag == 1:
		flag = 2
		count += 1
	elif i == "w" and flag == 2:
		count += 1
		print count
		exit()
	elif i != "c" and i != "w" and flag > 0:
		count += 1
	else:
		flag = 0
		count = 0
print '-1'
0