QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#299571 | #7894. Many Many Heads | ucup-team191# | WA | 0ms | 3588kb | C++23 | 610b | 2024-01-07 02:06:23 | 2024-01-07 02:06:23 |
Judging History
answer
#include <bits/stdc++.h>
#define x first
#define y second
using namespace std;
using ll=long long;
using pii=pair<int,int>;
using vi=vector<int>;
using vl=vector<ll>;
#define pb push_back
#define all(a) begin(a),end(a)
const int N=300010,MOD=1e9+7;
const char en='\n';
const ll LLINF=1ll<<60;
int t,n;
string s;
int main()
{
ios_base::sync_with_stdio(0);
cin.tie(0);
cin>>t;
while (t--)
{
cin>>s;
n=s.size();
bool ok=1;
for (int i=0;i<n/2-1;++i) if ((s[i]=='(' || s[i]==')')==(s[i+1]=='(' || s[i+1]==')')) ok=0;
if (ok) cout<<"Yes\n";
else cout<<"No\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: 3588kb
input:
2 (([([[([ ]]))])]])]
output:
No No
result:
wrong answer expected YES, found NO [1st token]