結果
| 問題 | No.3142 Balancing with O=>X Flip |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2026-09-01 12:27:24 |
| 言語 | PyPy3 (7.3.23 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 62 ms / 2,000 ms |
| + 487µs | |
| コード長 | 163 bytes |
| 記録 | |
| コンパイル時間 | 233 ms |
| コンパイル使用メモリ | 95,824 KB |
| 実行使用メモリ | 83,420 KB |
| 最終ジャッジ日時 | 2026-09-01 12:27:29 |
| 合計ジャッジ時間 | 3,713 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 25 |
ソースコード
N = int(input())
S = input()
m = 0
s = 0
for c in S:
if c == "(":
s += 1
else:
s -= 1
m = min(m,s)
if s == 0 and m >= 0:
print("Yes")
else:
print("No")