結果
| 問題 |
No.2398 ヒドラ崩し
|
| コンテスト | |
| ユーザー |
lam6er
|
| 提出日時 | 2025-04-15 21:57:36 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 352 bytes |
| コンパイル時間 | 249 ms |
| コンパイル使用メモリ | 82,376 KB |
| 実行使用メモリ | 62,796 KB |
| 最終ジャッジ日時 | 2025-04-15 21:58:39 |
| 合計ジャッジ時間 | 2,601 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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