結果

問題 No.436 ccw
ユーザー lam6er
提出日時 2025-03-20 21:04:38
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 38 ms / 2,000 ms
コード長 210 bytes
コンパイル時間 311 ms
コンパイル使用メモリ 82,160 KB
実行使用メモリ 59,952 KB
最終ジャッジ日時 2025-03-20 21:04:44
合計ジャッジ時間 1,807 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 24
権限があれば一括ダウンロードができます

ソースコード

diff #

S = input().strip()

n_c = 0
for c in S:
    if c == 'c':
        n_c += 1
    else:
        break  # since the input is guaranteed to start with c's followed by w's
n_w = len(S) - n_c

print(min(n_c - 1, n_w))
0