結果
| 問題 | 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 |
ソースコード
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