結果

問題 No.345 最小チワワ問題
ユーザー morina8823
提出日時 2016-03-22 21:29:23
言語 Python2
(2.7.18)
結果
WA  
実行時間 -
コード長 363 bytes
コンパイル時間 489 ms
コンパイル使用メモリ 7,040 KB
実行使用メモリ 6,400 KB
最終ジャッジ日時 2024-10-01 13:09:58
合計ジャッジ時間 1,589 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 15 WA * 14
権限があれば一括ダウンロードができます

ソースコード

diff #

cww_str = ['c',
           'w',
           'w']

input_str = raw_input()

cww_counter = 0
result = 0

for i in range(len(input_str)):
    if cww_str[cww_counter] == input_str[i]:
        cww_counter += 1
        if cww_counter == 3:
            result = i + 1 - input_str.index('c')
            break

if cww_counter == 3 :
    print(result)
else:
    print(-1)
0