結果

問題 No.345 最小チワワ問題
ユーザー nebukuro09nebukuro09
提出日時 2016-10-21 03:09:58
言語 Python2
(2.7.18)
結果
RE  
実行時間 -
コード長 229 bytes
コンパイル時間 80 ms
コンパイル使用メモリ 6,600 KB
実行使用メモリ 6,140 KB
最終ジャッジ日時 2023-08-15 09:41:18
合計ジャッジ時間 1,565 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 RE -
testcase_01 RE -
testcase_02 WA -
testcase_03 WA -
testcase_04 RE -
testcase_05 RE -
testcase_06 RE -
testcase_07 AC 10 ms
5,948 KB
testcase_08 AC 10 ms
6,048 KB
testcase_09 AC 11 ms
5,892 KB
testcase_10 RE -
testcase_11 AC 10 ms
5,948 KB
testcase_12 AC 10 ms
6,052 KB
testcase_13 RE -
testcase_14 RE -
testcase_15 RE -
testcase_16 RE -
testcase_17 WA -
testcase_18 RE -
testcase_19 RE -
testcase_20 RE -
testcase_21 AC 10 ms
5,912 KB
testcase_22 RE -
testcase_23 RE -
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 RE -
testcase_29 RE -
testcase_30 RE -
testcase_31 AC 10 ms
5,948 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

a = 0
b = float('inf')
c = 0
for i, c in enumerate(raw_input()):
    if c == 'c':
        a = 1
        c = i
    elif c == 'w':
        a += 1
        if a == 3:
            b = min(b, i-c+1)
print b if b != float('inf') else -1
0