QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#275381#5422. Perfect PalindromeFirystalWA 0ms3592kbC++14497b2023-12-04 17:36:502023-12-04 17:36:52

Judging History

你现在查看的是最新测评结果

  • [2023-12-04 17:36:52]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3592kb
  • [2023-12-04 17:36:50]
  • 提交

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();
	}
}

詳細信息

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