結果

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

ソースコード

diff #

s = []
N_flg = 1
m = 0
for i, n in enumerate(input()):
    if n == "c":
        m = i
        N_flg = 2
    elif n == "w" and N_flg == 2:
        N_flg = 3
    elif n == "w" and N_flg == 3:
        s += [i - m + 1]
        N_flg = 1
print(min(s) if len(s) != 0 else -1)
0