結果
問題 |
No.3144 Parentheses Modification and Rotation (01 Ver.)
|
ユーザー |
![]() |
提出日時 | 2025-05-17 03:15:12 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 40 ms / 2,000 ms |
コード長 | 246 bytes |
コンパイル時間 | 430 ms |
コンパイル使用メモリ | 82,236 KB |
実行使用メモリ | 54,296 KB |
最終ジャッジ日時 | 2025-09-07 17:34:00 |
合計ジャッジ時間 | 3,713 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
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)