80分,求助!
查看原帖
80分,求助!
1003350
huanghaoxuan楼主2024/11/2 18:37
#include<bits/stdc++.h>
using namespace std;
map<char,int>mp;
int main()
{
	string a,b,c;
	cin>>a>>b>>c;
	for(int i=0;i<c.size();i++)
	{
		char op='!';
		for(int j=0;j<=a.size();j++)
		{
			if(a[j]==c[i])
			{
				if(op!='!'&&op!=b[j])
				{
					cout<<"Failed"<<endl;
					return 0;
				}
				op=b[j];
			}
			if(!mp[a[j]])mp[a[j]]++;
		}
		if(mp.size()!=27)
		{
			cout<<"Failed"<<endl;
			return 0; 
		}
		if(op=='!')
		{
			cout<<"Failed"<<endl;
			return 0;
		}
		cout<<op;
	}
	return 0;
}

https://www.luogu.com.cn/record/186388478

2024/11/2 18:37
加载中...