3 solutions
-
1
#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; }
Information
- ID
- 2698
- Time
- 1000ms
- Memory
- 256MiB
- Difficulty
- 3
- Tags
- # Submissions
- 16
- Accepted
- 9
- Uploaded By