結果

問題 No.345 最小チワワ問題
ユーザー ABKZABKZ
提出日時 2021-07-04 20:53:43
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 78 ms / 2,000 ms
コード長 357 bytes
コンパイル時間 919 ms
コンパイル使用メモリ 86,744 KB
実行使用メモリ 76,256 KB
最終ジャッジ日時 2023-09-14 01:38:07
合計ジャッジ時間 4,380 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 70 ms
71,028 KB
testcase_01 AC 69 ms
71,300 KB
testcase_02 AC 72 ms
71,148 KB
testcase_03 AC 70 ms
71,148 KB
testcase_04 AC 70 ms
71,176 KB
testcase_05 AC 69 ms
71,304 KB
testcase_06 AC 71 ms
71,028 KB
testcase_07 AC 70 ms
71,020 KB
testcase_08 AC 69 ms
71,024 KB
testcase_09 AC 72 ms
71,300 KB
testcase_10 AC 70 ms
71,072 KB
testcase_11 AC 71 ms
71,172 KB
testcase_12 AC 73 ms
75,836 KB
testcase_13 AC 70 ms
71,136 KB
testcase_14 AC 75 ms
75,836 KB
testcase_15 AC 70 ms
71,176 KB
testcase_16 AC 70 ms
71,364 KB
testcase_17 AC 70 ms
70,988 KB
testcase_18 AC 78 ms
76,256 KB
testcase_19 AC 72 ms
71,216 KB
testcase_20 AC 70 ms
71,296 KB
testcase_21 AC 71 ms
71,172 KB
testcase_22 AC 72 ms
71,024 KB
testcase_23 AC 73 ms
71,064 KB
testcase_24 AC 70 ms
71,128 KB
testcase_25 AC 71 ms
71,228 KB
testcase_26 AC 72 ms
71,068 KB
testcase_27 AC 73 ms
71,124 KB
testcase_28 AC 71 ms
71,368 KB
testcase_29 AC 75 ms
75,708 KB
testcase_30 AC 72 ms
71,168 KB
testcase_31 AC 70 ms
70,868 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

S = input()

cww_seq = []
for i in range(len(S)):
    if S[i] != "c":
        continue
    for j in range(i + 1, len(S)):
        if S[j] != "w":
            continue
        for k in range(j + 1, len(S)):
            if S[k] == "w":
                cww_seq.append(S[i: k+1])

if len(cww_seq) == 0:
    print(-1)
else:
    print(len(min(cww_seq, key=len)))
0