7 条题解
-
0
Guest
- 1
信息
- ID
- 57
- 时间
- 1000ms
- 内存
- 256MiB
- 难度
- 6
- 标签
- 递交数
- 175
- 已通过
- 59
- 上传者
#include<bits/stdc++.h>
using namespace std;
int main()
{
double j,q,k=0,a,b,c=0;
cin>>j>>q;
b=j;
for(int l=1;l<=q+1;l++)
{
j/=2;
c=2*j;
}
for(int i=1;i<=q;i++)
{
k+=b+b/2;
b/=2;
}
cout<<fixed<<setprecision(6)<<k-c;
return 0;
}
这种题 直接秒 #include<bits/stdc++.h> using namespace std; int main() {int h,t; cin>>h>>t; if(h100&&t20) { cout<<fixed<<setprecision(6)<<299.999619;} return 0; }
大三目运算符照亮世界(
#include<bits/stdc++.h>
using namespace std;
double h,t,ans=0;
int main(){
cin>>h>>t;
for(int i=1;i<=t;i++){
ans+=i==1?h:h*2.0;
h/=2.0;
}
cout<<setiosflags(ios::fixed)<<setprecision(6);
cout<<ans<<endl;
return 0;
}
#include<bits/stdc++.h> using namespace std; int main() { double a,b,n,m; cin>>a>>b; m=a; for(n=0;b-1>0;) { n=n+a; a=a/2.0; b=b-1; } cout<<fixed<<setprecision(6)<<n+m; return 0; }
注册一个 PYYG 通用账户,您就可以在我们提供的所有在线评测服务上提交代码、参与讨论。