/ Randle /

记录详情

Wrong Answer


  
# 状态 耗时 内存占用
#1 Accepted 3ms 328.0 KiB
#2 Accepted 1ms 328.0 KiB
#3 Accepted 1ms 316.0 KiB
#4 Accepted 1ms 336.0 KiB
#5 Wrong Answer 1ms 320.0 KiB
#6 Accepted 1ms 332.0 KiB
#7 Accepted 1ms 328.0 KiB
#8 Accepted 1ms 328.0 KiB
#9 Accepted 1ms 324.0 KiB
#10 Accepted 1ms 332.0 KiB

代码

#include<bits/stdc++.h>
int main()
{
	char c[1001];
	std::string s,x,targ;
	std::cin>>s>>x;
	std::map<char,char> ex,er;
	int lens=s.size()-1;
	for(int i=0;i<=lens;i++)
	{
		if(!ex.count(x[i])||(ex.count(x[i])&&ex[x[i]]==s[i]))
		{
			if(!er.count(s[i])||(er.count(s[i])&&er[s[i]]==x[i])){ex[x[i]]=s[i];er[s[i]]=x[i];}
			else{std::cout<<"ERROR";exit(0);}
		}
		else {std::cout<<"ERROR";exit(0);}
	}
	std::cin>>targ;int lent=targ.size()-1;
	for(int i=0;i<=lent;i++)
		if(ex.count(targ[i]))c[i]=ex[targ[i]];
		else {std::cout<<"ERROR";exit(0);}
	for(int i=0;i<=lent;i++)std::cout<<c[i];
	return 0;
}

信息

递交者
类型
递交
题目
字符串问题 T1
题目数据
下载
语言
C++
递交时间
2017-10-19 19:47:25
评测时间
2017-10-19 19:47:25
评测机
分数
90
总耗时
19ms
峰值内存
336.0 KiB