QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#725717 | #7683. Hard Brackets Problem | rqoi031 | WA | 0ms | 1492kb | C++20 | 329b | 2024-11-08 19:34:47 | 2024-11-08 19:34:47 |
Judging History
answer
#include<stdio.h>
#include<algorithm>
#include<cstring>
char str[1000005];
inline void solve() {
scanf("%s",str);
const int n(std::strlen(str));
puts(std::count(str,str+n,'(')<<1>n?"Impossible":str);
}
int main() {
int t;
scanf("%d",&t);
while(t--) {
solve();
}
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Wrong Answer
time: 0ms
memory: 1492kb
input:
3 ((())) ( )))()
output:
((())) Impossible )))()
result:
wrong answer the output is too long (test case 2)