QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#747580 | #7894. Many Many Heads | surenjamts# | WA | 0ms | 3580kb | C++17 | 490b | 2024-11-14 17:35:09 | 2024-11-14 17:35:17 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define pb push_back
#define F first
#define S second
signed main(){
int t;
cin >> t;
while( t -- ){
string s, ans = "Yes";
cin >> s;
int lst = -1, curr;
for(int i = 0; i < s.size() / 2; i ++ ){
if( s[i] == '(' || s[i] == ')' ){
curr = 0;
}else{
curr = 1;
}
if( lst == curr ){
ans = "No";
break;
}
lst = curr;
}
cout << ans << "\n";
}
}
詳細信息
Test #1:
score: 100
Accepted
time: 0ms
memory: 3580kb
input:
6 )) ((() [()] ()[()]() ([()]) ([])([])
output:
Yes No Yes No Yes No
result:
ok 6 token(s): yes count is 3, no count is 3
Test #2:
score: -100
Wrong Answer
time: 0ms
memory: 3468kb
input:
2 (([([[([ ]]))])]])]
output:
No No
result:
wrong answer expected YES, found NO [1st token]