General
 
 
# Author Problem Lang Verdict Time Memory Sent Judged  
61512229 Practice:
Araz.G
1228C - 31 GNU C++14 Accepted 31 ms 4 KB 2019-09-29 19:20:52 2019-09-29 19:20:52
 
 
→ Source
#include <bits/stdc++.h>
using namespace std;
#define inta long long
#define ii pair<int,int>
#define mp make_pair
#define pb push_back

bool OF(long long a, long long b) 
{ 
	if ((a*b)/a==b) return false;
    return true; 
}

inta mo=1e9+7;
vector<inta>v;
inta ans=1,now=1,x,n;
// 11 647 2837



int main()
{
	ios_base::sync_with_stdio(0);
	inta d;
	cin>>x>>n;
	set<inta>se;
	d=x;
	for(int i=2;i*i<=x;i++)
	{
		if(d%i==0ll)
		{
			se.insert(i);
			d/=i;
			i--;
		}
	}
	for(auto i:se)
	{
		v.pb(i);
	}
	if(d!=1) v.pb(d);
	
	for(inta i:v)
	{
		inta d=i,sum=0;
		while(d<=n)
		{
			inta k=n/d;
			sum+=k;
			if(!OF(d,i)) d*=i;
			else break;
		}
		
		inta r=i;
		for(int j=0;j<63;j++) // 64?
		{

			if(sum&(1ll<<j))
			{
				ans*=r;
				ans%=mo;
			}
			r=(r*r);
			r%=mo;
		}
	}
	
	cout<<ans<<endl;
}
 
 
?
Time: ? ms, memory: ? KB
Verdict: ?
Input
?
Participant's output
?
Jury's answer
?
Checker comment
?
Diagnostics
?
Click to see test details