結果
| 問題 |
No.3144 Parentheses Modification and Rotation (01 Ver.)
|
| コンテスト | |
| ユーザー |
norioc
|
| 提出日時 | 2025-05-17 03:15:12 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 41 ms / 2,000 ms |
| コード長 | 246 bytes |
| コンパイル時間 | 279 ms |
| コンパイル使用メモリ | 82,448 KB |
| 実行使用メモリ | 54,316 KB |
| 最終ジャッジ日時 | 2025-10-26 00:03:20 |
| 合計ジャッジ時間 | 3,351 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 39 |
ソースコード
N = int(input())
S = input()
R, M = map(int, input().split())
def solve():
if N % 2 == 1: return -1
lt = S.count('(')
rt = S.count(')')
if lt == rt:
return 0
return abs(lt - rt) * M // 2
ans = solve()
print(ans)
norioc