結果
| 問題 | No.2398 ヒドラ崩し |
| コンテスト | |
| ユーザー |
lam6er
|
| 提出日時 | 2025-03-31 17:48:45 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 334 bytes |
| 記録 | |
| コンパイル時間 | 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 |
ソースコード
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)
lam6er