Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)
Total Submission(s): 650 Accepted Submission(s): 208
1 #include <iostream> 2 #include <stdio.h> 3 #include <string.h> 4 #include <math.h> 5 #include <algorithm> 6 #define eps1 0.000000001 7 using namespace std; 8 int main() 9 { 10 double ua,u0,u1,t1,c,k,y; 11 int n,i,t,x,cas=1; 12 scanf("%d",&t); 13 while(t--) 14 { 15 printf("Case %d:\n",cas++); 16 cin>>ua>>u0>>u1>>t1>>n; 17 c=log(u0-ua); 18 k=(log(u1-ua)-c)/t1; 19 for(i=0;i<n;i++) 20 { 21 cin>>x>>y; 22 if(x) 23 { 24 if(ua==u0) 25 printf("%.2lf\n",ua); 26 else 27 printf("%.2lf\n",ua+exp(k*y+c)); 28 } 29 else 30 { 31 if(ua==u0) 32 printf("%.2lf\n",0.0); 33 else 34 printf("%.2lf\n",(log(y-ua)-c)/k); 35 } 36 } 37 cout<<endl; 38 } 39 }
Temperature hdu 3477,布布扣,bubuko.com
原文:http://www.cnblogs.com/ERKE/p/3901611.html