結果

問題 No.2924 <===Super Spaceship String===>
ユーザー ktsn-ud
提出日時 2024-10-12 15:40:58
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 574 bytes
コンパイル時間 201 ms
コンパイル使用メモリ 82,456 KB
実行使用メモリ 121,844 KB
最終ジャッジ日時 2024-10-12 15:41:01
合計ジャッジ時間 1,680 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 7 WA * 2 RE * 2
権限があれば一括ダウンロードができます

ソースコード

diff #

from sys import stdin


def main():
    s = stdin.readline().rstrip()
    last_str = []
    flag = False
    for c in s:
        last_str.append(c)
        if len(last_str) < 2:
            continue
        if not flag and last_str[-2] == '<' and last_str[-1] == '=':
            flag = True
        if flag and last_str[-1] == '<':
            flag = False
        if flag and last_str[-1] == '>':
            while last_str[-1] != '<':
                last_str.pop()
            last_str.pop()

    print(len(last_str))

    return


if __name__ == "__main__":
    main()
0