結果

問題 No.2398 ヒドラ崩し
ユーザー lam6er
提出日時 2025-03-31 17:48:45
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 334 bytes
コンパイル時間 163 ms
コンパイル使用メモリ 82,100 KB
実行使用メモリ 63,844 KB
最終ジャッジ日時 2025-03-31 17:49:49
合計ジャッジ時間 2,362 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 19 WA * 12
権限があれば一括ダウンロードができます

ソースコード

diff #

def count_units(s):
    stack_depth = 0
    count = 0
    for c in s:
        if c == '(':
            stack_depth += 1
        else:
            stack_depth -= 1
            if stack_depth == 0:
                count += 1
    return count

H = input().strip()
units = count_units(H)
if units % 2 == 1:
    print(0)
else:
    print(1)
0