結果

問題 No.2924 <===Super Spaceship String===>
ユーザー cologne
提出日時 2025-04-28 13:33:14
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 564 bytes
コンパイル時間 500 ms
コンパイル使用メモリ 82,392 KB
実行使用メモリ 78,844 KB
最終ジャッジ日時 2025-04-28 13:33:21
合計ジャッジ時間 5,984 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample WA * 2
other WA * 5 OLE * 1 -- * 6
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys


def input():
    return sys.stdin.readline().strip()


def main():
    s = input()
    z = []
    noneq = []
    for c in s:
        if (
            c == ">"
            and len(z) > 0
            and z[-1] == "="
            and len(noneq) > 0
            and noneq[-1] == "<"
        ):
            while z[-1] == "=":
                z.pop()
            z.pop()
            noneq.pop()
        else:
            z.append(c)
            if c != "=":
                noneq.append(c)
        print("".join(z))


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