結果

問題 No.345 最小チワワ問題
ユーザー konabe
提出日時 2018-05-16 23:14:04
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
WA  
実行時間 -
コード長 396 bytes
コンパイル時間 86 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 10,752 KB
最終ジャッジ日時 2024-06-28 13:22:18
合計ジャッジ時間 2,115 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 15 WA * 14
権限があれば一括ダウンロードができます

ソースコード

diff #

S = input()
cww_col = ["c", "w", "w"]
t = 0
min_l = 999
cnt_l = 0
for Si in S:
    cnt_l += 1
    if cww_col[t] == Si:
        if t == 0:
            cnt_l = 1
        if t == len(cww_col)-1:
            if cnt_l < min_l:
                min_l = cnt_l
            cnt_l = 1
            t = 0
            continue
        t += 1

if min_l == 999:
    print(-1)
else:
    print(min_l)
        
    
0