两个AC其他全是TLE24分
查看原帖
两个AC其他全是TLE24分
1386569
pubgm楼主2025/2/4 08:52
#include<bits/stdc++.h>
using namespace std;
long double a,b,p,ans;
int main(){
	cin>>a>>b>>p;
	ans=pow(a,b);
	while(ans>=0){
		ans-=p;
	}
	ans+=p;
	cout<<a<<"^"<<b<<" mod "<<p<<"="<<ans;
	return 0;
}

2025/2/4 08:52
加载中...