QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#425902 | #7894. Many Many Heads | Repeater# | WA | 0ms | 3612kb | C++20 | 483b | 2024-05-30 18:43:20 | 2024-05-30 18:43:20 |
Judging History
answer
#include <bits/stdc++.h>
using i64 = long long;
void repeater()
{
std::string s; std::cin >> s;
for(auto &i : s)
{
if(i == ')') i = '(';
if(i == ']') i = '[';
}
int cnt = 0;
for(int i = 1; i < s.size(); i++)
if(s[i] == s[i - 1]) cnt++;
if(cnt >= 2) std::cout << "No\n";
else std::cout << "Yes\n";
}
int main()
{
std::ios::sync_with_stdio(false);
std::cin.tie(nullptr);
int t; std::cin >> t;
while(t--) repeater();
return 0;
}
详细
Test #1:
score: 100
Accepted
time: 0ms
memory: 3612kb
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: 3548kb
input:
2 (([([[([ ]]))])]])]
output:
No No
result:
wrong answer expected YES, found NO [1st token]