結果

問題 No.2398 ヒドラ崩し
コンテスト
ユーザー lam6er
提出日時 2025-03-31 17:48:45
言語 PyPy3
(7.3.17)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
WA  
実行時間 -
コード長 334 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 222 ms
コンパイル使用メモリ 96,108 KB
実行使用メモリ 83,216 KB
最終ジャッジ日時 2026-07-08 05:17:15
合計ジャッジ時間 3,829 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge2_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 19 WA * 12
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

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