結果
問題 |
No.436 ccw
|
ユーザー |
![]() |
提出日時 | 2020-10-22 15:57:52 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 116 ms / 2,000 ms |
コード長 | 505 bytes |
コンパイル時間 | 98 ms |
コンパイル使用メモリ | 12,416 KB |
実行使用メモリ | 10,624 KB |
最終ジャッジ日時 | 2024-07-21 09:18:50 |
合計ジャッジ時間 | 1,855 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 24 |
ソースコード
first_s = input(); first_len = len(first_s) right_len = first_len left_c =0 right_c =0 result=0 for lef_n in range(first_len-1): right_len = right_len-1 if first_s[lef_n]==first_s[lef_n+1] and first_s[lef_n]=="c": left_c= left_c+1 if first_s[right_len]==first_s[right_len-1] and first_s[right_len]=="w": right_c= right_c+1 elif first_s[right_len]!=first_s[right_len-1] and first_s[right_len]=="w": right_c= right_c+1 if left_c > right_c: result =right_c else: result =left_c print(result)