QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#559458#8829. AibohphobiaAChievedreaM#WA 0ms3604kbC++17922b2024-09-11 22:09:392024-09-11 22:09:40

Judging History

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

  • [2024-09-11 22:09:40]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3604kb
  • [2024-09-11 22:09:39]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
using ll=long long;
int main()
{
	ios::sync_with_stdio(0),cin.tie(0),cout.tie(0);
	ll t,n;
	t=1;
	cin>>t;
	while(t--)
	{
		string s;
		cin>>s;
		ll n=s.size();
		map<char,ll>mp;
		for(ll i=0;i<n;i++)
		{
			mp[s[i]]++;
		}
		ll m=mp.size();
		char c='#';
		ll d=0;
		for(auto q:mp)
		{
			if(q.second==1)
				c=q.first;
			else d++;
		}
		if(c!='#')
		{
			cout<<"YEq\n";
			cout<<c;
			for(auto q:mp)
			{
				if(q.first!=c)
				{
					for(ll i=1;i<=q.second;i++)
						cout<<q.first;
				}
			}
			cout<<'\n';
		}
		else 
		{
			if(d==2||d==1)
				cout<<"NO\n";
			else
			{
				cout<<"YEq\n";
				while(1)
				{
					ll f=0;
					for(auto q:mp)
					{
						if(q.second>0)
						{
							cout<<q.first;
							mp[q.first]--;
							f=1;
						}
					}
					if(f==0)break;
				}
				cout<<'\n';
			}
		}
	}
}

详细

Test #1:

score: 0
Wrong Answer
time: 0ms
memory: 3604kb

input:

5
a
sos
abba
icpc
tenet

output:

YEq
a
YEq
oss
NO
YEq
pcci
YEq
neett

result:

wrong answer Token parameter [name=yes/no] equals to "YEq", doesn't correspond to pattern "[yY][eE][sS]|[nN][oO]" (test case 1)