QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#725717#7683. Hard Brackets Problemrqoi031WA 0ms1492kbC++20329b2024-11-08 19:34:472024-11-08 19:34:47

Judging History

你现在查看的是最新测评结果

  • [2024-11-08 19:34:47]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:1492kb
  • [2024-11-08 19:34:47]
  • 提交

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)