結果

問題 No.2398 ヒドラ崩し
ユーザー gew1fw
提出日時 2025-06-12 18:05:47
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 271 bytes
コンパイル時間 194 ms
コンパイル使用メモリ 82,976 KB
実行使用メモリ 74,664 KB
最終ジャッジ日時 2025-06-12 18:07:26
合計ジャッジ時間 2,589 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 17 WA * 14
権限があれば一括ダウンロードができます

ソースコード

diff #

H = input().strip()

stack = []
depths = []

for c in H:
    if c == '(':
        stack.append(len(stack) + 1)
    else:
        if stack:
            depth = stack.pop()
            depths.append(depth)

xor = 0
for d in depths:
    xor ^= d

print(0 if xor != 0 else 1)
0