結果
| 問題 | 
                            No.345 最小チワワ問題
                             | 
                    
| コンテスト | |
| ユーザー | 
                             | 
                    
| 提出日時 | 2024-08-08 20:37:34 | 
| 言語 | PyPy3  (7.3.15)  | 
                    
| 結果 | 
                             
                                WA
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 344 bytes | 
| コンパイル時間 | 258 ms | 
| コンパイル使用メモリ | 82,560 KB | 
| 実行使用メモリ | 54,348 KB | 
| 最終ジャッジ日時 | 2024-08-08 20:37:37 | 
| 合計ジャッジ時間 | 2,895 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge5 / judge4 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 15 WA * 14 | 
ソースコード
s = input()
flag_c, flag_w = False, False
start = 0
for i, v in enumerate(s):
    if v == "c" and flag_c == False:
        flag_c = True
        start = i
    if v == "w" and flag_c == True:
        if flag_w == False:
            flag_w = True
        elif flag_w == True:
            print(i - start + 1)
            break
else:
    print(-1)