結果
問題 |
No.684 Prefix Parenthesis
|
ユーザー |
![]() |
提出日時 | 2025-06-12 14:08:27 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 191 bytes |
コンパイル時間 | 276 ms |
コンパイル使用メモリ | 82,216 KB |
実行使用メモリ | 69,276 KB |
最終ジャッジ日時 | 2025-06-12 14:08:32 |
合計ジャッジ時間 | 2,558 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 14 WA * 17 |
ソースコード
n = int(input()) s = input().strip() total = 0 left = 0 right = 0 for c in s: if c == '(': left += 1 else: right += 1 total += min(left, right) print(total * 2)