题解:UVA10916 Factstone Benchmark
题意概括
在
请你求出一个最大的
思路分析
这其实就是一道数学题,首先有一个方程:
两边同时取对数,可得:
因为
令
而我们可以枚举
代码解析
#include<bits/stdc++.h>
#define sjh0626s return
#define code 0
#define ll long long
#define PII pair<int,int>
using namespace std;
int x,now,sum;
double maxx;
int main(){
cin>>x;
while(x!=0){
maxx=pow(2,((x-1940)/10));
now=0;
while(maxx>=0){
maxx-=log2(++now);
}
cout<<now-1<<"\n";
cin>>x;
}
sjh0626s code;
}
提交记录