3 solutions

  • 1
    @ 2026-7-23 15:03:47
    #include<bits/stdc++.h>
    using namespace std;
    typedef long long LL;
    int k;
    LL trans(string s)
    {
    	reverse(s.begin(),s.end());
    	LL res=0;
    	int p=1;
    	for(char x:s)
    	{
    		res=res+(x-'0')*p;
    		p=p*k;
    	}
    	return res;
    }
    int main()
    {
    	cin>>k;
    	string s1,s2;
    	cin>>s1>>s2;
    	LL a=trans(s1);
    	LL b=trans(s2);
    	cout<<a*b;
    	return 0;
    }
    
    

    A0749A0749 请点👍请点👍 随手点👍,手有余香随手点👍,手有余香

    Information

    ID
    2698
    Time
    1000ms
    Memory
    256MiB
    Difficulty
    3
    Tags
    # Submissions
    16
    Accepted
    9
    Uploaded By