为什么都是50分(本蒟蒻也是)
查看原帖
为什么都是50分(本蒟蒻也是)
563217
luogu_orz楼主2023/7/16 09:24

模拟,但是很暴力。

#include <bits/stdc++.h>
using namespace std;

string s;
string c;
long long chengji1;
long long chengji2;
int main(){
	chengji1=1;
	chengji2=1;
	cin>>s>>c;
	for(int i=0;i<s.size();i++){
		//cout<<'['<<s[i]-'A'+1<<']'<<endl;
		chengji1*=(s[i]-'A'+1);
		chengji1%=47;
	}
	//cout<<'['<<chengji1<<']'<<endl<<endl<<endl;
	
	for(int i=0;i<s.size();i++){
		//cout<<'['<<c[i]-'A'+1<<']'<<endl;
		chengji2*=(c[i]-'A'+1);
		chengji2%=47;
	}
	//cout<<'['<<chengji2<<']'<<endl;
	
	
	if(chengji1==chengji2){
		cout<<"GO";
	}else{
		cout<<"STAY";
	}
	
	return 0;
}

这么简单的代码,dalao应该看得懂吧,我就不做解释了

2023/7/16 09:24
加载中...