QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#751528 | #7894. Many Many Heads | AzusidNya | WA | 0ms | 3840kb | C++17 | 820b | 2024-11-15 19:15:58 | 2024-11-15 19:16:01 |
Judging History
answer
#include<bits/stdc++.h>
#define int long long
#define eb emplace_back
#define mp make_pair
#define DEBUG
using namespace std;
using pii = pair<int, int>;
using piii = pair<int, pii>;
using piiii = pair<pii, pii>;
using i64 = long long;
using u64 = unsigned long long;
using u32 = unsigned int;
const int P = 998244353;const i64 inf = 0x3f3f3f3f3f3f3f3f;
namespace azus{
int n;
string s;
int main(){
cin >> s; n = s.length(); s = " " + s;
for(int i = 1; i <= n / 2; i ++){
if(s[i] == ')') s[i] = '(';
if(s[i] == ']') s[i] = '[';
if(s[i] == s[i - 1]) return cout << "No\n", 0;
}
cout << "Yes\n";
return 0;
}
}
signed main(){
#ifndef DEBUG
ios::sync_with_stdio(0);
cin.tie(0), cout.tie(0);
#endif
int T = 1;
cin >> T;
while(T --)
azus::main();
return 0;
}
詳細信息
Test #1:
score: 100
Accepted
time: 0ms
memory: 3532kb
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: 3840kb
input:
2 (([([[([ ]]))])]])]
output:
No No
result:
wrong answer expected YES, found NO [1st token]