QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#378405 | #7683. Hard Brackets Problem | karuna | WA | 3ms | 3812kb | C++20 | 314b | 2024-04-06 12:32:24 | 2024-04-06 12:32:26 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
int main() {
cin.tie(0); ios_base::sync_with_stdio(0);
int T; cin >> T;
while (T--) {
string S; cin >> S;
int s = 0;
for (char c : S) {
s += (c == '(') ? 1 : -1;
}
if (s <= 0) cout << S << '\n';
else cout << "impossible\n";
}
}
詳細信息
Test #1:
score: 100
Accepted
time: 0ms
memory: 3812kb
input:
3 ((())) ( )))()
output:
((())) impossible )))()
result:
ok 3 cases (3 test cases)
Test #2:
score: -100
Wrong Answer
time: 3ms
memory: 3540kb
input:
100000 ())(()()() ()())())) )()()()() ())()(())( ((())())) )(())()))( )()))()))) )))))(((() ()))((()(( ()((()())) (()())()) ())(()))() (())(()))) ))))(()(() ()))(())(( ()((())()) ()))()))() ()((())()) ()()))((() ()))(())) (()(()))) ())((())) ())()((()) (()(()))) ()(((()()) ))))())))( ((((()()() (()(...
output:
())(()()() ()())())) )()()()() ())()(())( ((())())) )(())()))( )()))()))) )))))(((() impossible ()((()())) (()())()) ())(()))() (())(()))) ))))(()(() ()))(())(( ()((())()) ()))()))() ()((())()) ()()))((() ()))(())) (()(()))) ())((())) ())()((()) (()(()))) impossible ))))())))( impossible impossible ...
result:
wrong answer the result string is incorrect (test case 1)