QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#275381 | #5422. Perfect Palindrome | Firystal | WA | 0ms | 3592kb | C++14 | 497b | 2023-12-04 17:36:50 | 2023-12-04 17:36:52 |
Judging History
answer
#define _CRT_SECURE_NO_WARNINGS 1
#include<bits/stdc++.h>
using namespace std;
#define int long long
void solve(){
string s;
cin >> s;
for(int i = 0; i < s.size(); i ++)
if(s[i] == '(' || s[i] == ')') s[i] = 'l';
else s[i] = 'm';
if(s.find("ll") != s.rfind("ll") || s.find("mm") != s.rfind("mm")) cout << "No" << endl;
else cout << "Yes" << endl;
}
signed main(){
ios::sync_with_stdio(false), cin.tie(nullptr);
int t;
cin >> t;
while(t --){
solve();
}
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Wrong Answer
time: 0ms
memory: 3592kb
input:
2 abcb xxx
output:
No No
result:
wrong output format Expected integer, but "No" found