結果

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

ソースコード

diff #

import sys

S = input()

for i in range(3, len(S)+1):
    for j in range(0, len(S)+1-i):
        subs = S[j:j+i]
        c = subs.find("c")
        w = subs.find("w")
        if c == -1 or w == -1:
            continue
        if c > w:
            continue
        if subs.count("w") >= 2:
            print(i)
            sys.exit(1)
print(-1)
0