7-3 AB%mod (15 分)
给你两个整数A,B,输出A
B%mod (mod=10^18)

输入格式:
输入只有一行

在一行中给出2个值不超过10^18的正整数A和B。

输出格式:
在一行中输出输出A*B%mod的值。

输入样例:
在这里给出一组输入。例如:

2 2
输出样例:
在这里给出相应的输出。例如:

4

#include<stdio.h>
#include<iostream>
using namespace std;
typedef long long ll;

	ll mul(ll a,ll b,ll p){
	ll ans=0;
	while(b){
		if(b&1) ans=(ans+a)%p;
		a=a*2%p;
		b>>=1;
	}
	return ans%p;

}

int main(){
	long long a,b,p;
	p=1e18;
	cin>>a>>b;
	cout<<mul(a,b,p);
}