結果

問題 No.3144 Parentheses Modification and Rotation (01 Ver.)
ユーザー 👑 potato167
提出日時 2025-05-16 21:40:20
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 414 bytes
コンパイル時間 1,695 ms
コンパイル使用メモリ 195,000 KB
実行使用メモリ 7,848 KB
最終ジャッジ日時 2025-05-16 21:40:24
合計ジャッジ時間 2,891 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1 WA * 2
other AC * 17 WA * 22
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
#define all(p) p.begin(), p.end()
#define rep(i, a, b) for (int i = (int)(a); i < (int)(b); i++)


int main(){
    int N;
    cin >> N;
    string S;
    cin >> S;
    int R, M;
    cin >> R >> M;
    if (N % 2){
        cout << "-1\n";
    }
    else{
        int tmp = 0;
        for (auto c : S) tmp += (c == '(' ? -1 : 1);
        cout << abs(tmp) << "\n";
    }
}
0