結果
| 問題 | 
                            No.436 ccw
                             | 
                    
| コンテスト | |
| ユーザー | 
                             | 
                    
| 提出日時 | 2020-02-27 07:46:57 | 
| 言語 | Python3  (3.13.1 + numpy 2.2.1 + scipy 1.14.1)  | 
                    
| 結果 | 
                             
                                WA
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 290 bytes | 
| コンパイル時間 | 81 ms | 
| コンパイル使用メモリ | 12,288 KB | 
| 実行使用メモリ | 17,572 KB | 
| 最終ジャッジ日時 | 2024-10-13 15:44:38 | 
| 合計ジャッジ時間 | 7,667 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge3 / judge4 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 2 | 
| other | AC * 18 WA * 1 TLE * 2 -- * 3 | 
ソースコード
import re
N = input()
cnt = 0
if "ccw" in N:
    p = N.find("ccw")
    if p < len(N)//2:
        while "ccw" in N:
            N = re.sub("^(c|w)","",N)
            cnt += 1
    else:
        while "ccw" in N:
            N = re.sub("(c|w)$","",N)
            cnt += 1
        
print(cnt)