結果
| 問題 | No.3144 Parentheses Modification and Rotation (01 Ver.) |
| コンテスト | |
| ユーザー |
norioc
|
| 提出日時 | 2025-05-17 03:15:12 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
AC
|
| 実行時間 | 64 ms / 2,000 ms |
| + 565µs | |
| コード長 | 246 bytes |
| 記録 | |
| コンパイル時間 | 254 ms |
| コンパイル使用メモリ | 95,856 KB |
| 実行使用メモリ | 78,976 KB |
| 最終ジャッジ日時 | 2026-07-16 08:06:43 |
| 合計ジャッジ時間 | 5,571 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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