Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
为什么用float能过,double就超时ans用float用时只有90ms,double却超时,想不通。。。 #include<iostream> #include<cstdio> #include<cmath> using namespace std; int main() { int m,n,t; int i; scanf("%d",&t); for(i=0;i<t;i++) { scanf("%d%d",&m,&n); float ans=m*n; if (m*n%2) { ans=ans-1+sqrt(2.0); } printf("Scenario #%d:\n",i+1); printf("%.2f\n\n",ans); } return 0; } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator