結果
| 問題 | 
                            No.2924 <===Super Spaceship String===>
                             | 
                    
| コンテスト | |
| ユーザー | 
                             | 
                    
| 提出日時 | 2024-10-28 13:48:20 | 
| 言語 | PyPy3  (7.3.15)  | 
                    
| 結果 | 
                             
                                TLE
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 276 bytes | 
| コンパイル時間 | 413 ms | 
| コンパイル使用メモリ | 82,580 KB | 
| 実行使用メモリ | 236,732 KB | 
| 最終ジャッジ日時 | 2024-10-28 13:48:25 | 
| 合計ジャッジ時間 | 5,327 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge3 / judge1 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 2 | 
| other | AC * 11 TLE * 1 | 
ソースコード
import re
S = str(input())
if len(S) % 3 == 0 and S[:2 * len(S) // 3] == "<=" * (len(S) // 3) and S[2 * len(S) // 3 + 1:] == ">" * (len(S) // 3):
	print(0)
	exit()
new_S = re.sub("<=+>", "", S)
while new_S != S:
  S = new_S
  new_S = re.sub("<=+>", "", S)
print(len(new_S))