結果
| 問題 |
No.2398 ヒドラ崩し
|
| コンテスト | |
| ユーザー |
lam6er
|
| 提出日時 | 2025-04-16 15:37:59 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 352 bytes |
| コンパイル時間 | 293 ms |
| コンパイル使用メモリ | 81,964 KB |
| 実行使用メモリ | 63,008 KB |
| 最終ジャッジ日時 | 2025-04-16 15:43:25 |
| 合計ジャッジ時間 | 2,556 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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