結果
| 問題 | No.3144 Parentheses Modification and Rotation (01 Ver.) |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2026-09-04 05:54:55 |
| 言語 | C++23(gcc16) (gcc 16.1.0 + boost 1.92.0 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 2 ms / 2,000 ms |
| + 989µs | |
| コード長 | 299 bytes |
| 記録 | |
| コンパイル時間 | 1,852 ms |
| コンパイル使用メモリ | 174,764 KB |
| 実行使用メモリ | 6,400 KB |
| 最終ジャッジ日時 | 2026-09-04 05:55:00 |
| 合計ジャッジ時間 | 5,607 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 39 |
ソースコード
#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
using ll = long long;
int main(void){
int n, r, m; string s; cin >> n >> s >> r >> m;
if(n&1){
cout << -1 << endl; return 0;
}
int l=0;
for(auto p:s) l+=(p=='(');
cout << abs(l-n/2) << endl;
return 0;
}