本题卡了
查看原帖
本题卡了
482623
一洛本谷通楼主2021/10/4 14:01
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
ll n;
double x;
double ans;
int main(){
	cin>>x>>n;
	for(ll i=1;i<=n;i++) ans+=pow(x,i)/i;
	cout<<fixed<<setprecision(4)<<ans;
	return 0;
} 

这道题如何减小时间复杂度,本代码为O(2) 该怎么减小

2021/10/4 14:01
加载中...