結果

問題 No.345 最小チワワ問題
ユーザー Fullmoon85072Fullmoon85072
提出日時 2020-08-01 21:03:06
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 380 bytes
コンパイル時間 292 ms
コンパイル使用メモリ 87,112 KB
実行使用メモリ 71,560 KB
最終ジャッジ日時 2023-09-22 16:05:22
合計ジャッジ時間 3,949 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 73 ms
71,480 KB
testcase_01 AC 72 ms
71,260 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 AC 71 ms
71,468 KB
testcase_05 WA -
testcase_06 AC 73 ms
71,092 KB
testcase_07 AC 70 ms
71,308 KB
testcase_08 AC 73 ms
71,232 KB
testcase_09 AC 72 ms
71,436 KB
testcase_10 AC 71 ms
71,408 KB
testcase_11 AC 71 ms
71,236 KB
testcase_12 AC 69 ms
71,388 KB
testcase_13 AC 71 ms
71,332 KB
testcase_14 AC 72 ms
71,336 KB
testcase_15 AC 73 ms
71,480 KB
testcase_16 AC 73 ms
71,556 KB
testcase_17 WA -
testcase_18 WA -
testcase_19 AC 73 ms
71,356 KB
testcase_20 AC 71 ms
71,360 KB
testcase_21 AC 71 ms
71,260 KB
testcase_22 AC 73 ms
71,424 KB
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 AC 72 ms
71,448 KB
testcase_29 WA -
testcase_30 WA -
testcase_31 AC 72 ms
71,504 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

S = input()

c_flg = False
finish_flg = False
w_count = 0
length = 0
for ch in S:

    if ch == "c":
        c_flg = True
        length = 1
        continue

    if c_flg:
        length += 1

        if ch == "w":
            w_count += 1

            if w_count == 2:
                finish_flg = True
                break

if finish_flg:
    print(length)
else:
    print(-1)
0