結果

問題 No.2924 <===Super Spaceship String===>
ユーザー Iroha_3856
提出日時 2024-10-12 17:19:42
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 173 ms / 2,000 ms
コード長 401 bytes
コンパイル時間 239 ms
コンパイル使用メモリ 82,560 KB
実行使用メモリ 129,044 KB
最終ジャッジ日時 2024-10-16 17:55:54
合計ジャッジ時間 1,835 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 12
権限があれば一括ダウンロードができます

ソースコード

diff #

S = input()
cur = []
for c in S:
    if c == '=':
        if len(cur) and cur[-1][0]=='=':
            cur[-1][1]+=1
        else:
            cur.append([c, 1])
    else:
        cur.append([c, 1])
        if len(cur)>=3 and cur[-3][0] == '<' and cur[-2][0] == '=' and cur[-1][0] == '>':
            cur.pop()
            cur.pop()
            cur.pop()
ans = 0
for (c, l) in cur: ans += l
print(ans)
0