結果
| 問題 | 
                            No.2398 ヒドラ崩し
                             | 
                    
| コンテスト | |
| ユーザー | 
                             lam6er
                         | 
                    
| 提出日時 | 2025-04-15 21:52:52 | 
| 言語 | PyPy3  (7.3.15)  | 
                    
| 結果 | 
                             
                                WA
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 352 bytes | 
| コンパイル時間 | 483 ms | 
| コンパイル使用メモリ | 82,096 KB | 
| 実行使用メモリ | 63,176 KB | 
| 最終ジャッジ日時 | 2025-04-15 21:54:14 | 
| 合計ジャッジ時間 | 2,142 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge2 / judge3 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 19 WA * 12 | 
ソースコード
def main():
    import sys
    s = sys.stdin.read().strip()
    balance = 0
    cnt = 0
    for c in s[::-1]:
        if c == ')':
            balance += 1
        else:
            balance -= 1
            if balance == 0:
                cnt += 1
    if cnt % 2 == 1:
        print(0)
    else:
        print(1)
if __name__ == "__main__":
    main()
            
            
            
        
            
lam6er