1 solutions

  • 0
    @ 2025-12-15 11:58:22

    C++ :

    #include<bits/stdc++.h>
    using namespace std;
    int ji1=1,ji2=1; 
    string s1,s2;
    int main()
    {
    //	freopen("1034.in","r",stdin);
    //	freopen("1034.out","w",stdout);
    	cin>>s1>>s2;
    	for(int i=0;i<s1.size();i++)
    	{
    		int x=(int)s1[i]-64;
    		ji1*=x,ji1=ji1%47;
    	}
    	for(int i=0;i<s2.size();i++)
    	{
    		int x=(int)s2[i]-64;
    		ji2*=x,ji2=ji2%47;
    	}
    	if(ji1==ji2) cout<<"GO"<<endl,cout<<"r1=r2="<<ji1;
    	else cout<<"STAY"<<endl,cout<<"r1="<<ji1<<" "<<"r2="<<ji2;
    	return 0;	
    }
    
    • 1

    Information

    ID
    1061
    Time
    1000ms
    Memory
    128MiB
    Difficulty
    (None)
    Tags
    # Submissions
    0
    Accepted
    0
    Uploaded By