#include<iostream>
#include<algorithm>
#include<cmath>
using namespace std;
double a[4][5];
int main(){
ios::sync_with_stdio(0);
for(int i=0;i<4;i++)
for(int j=0;j<5;j++)cin>>a[i][j];
double x=0.0,y=0.0,t[5];
for(int i=0;i<5;i++){
t[i]=a[0][i];
if(i>1)t[i]/=100.0;
}
x=t[0]*(1+t[1]/100.0)*((1-min(1.0,t[2]))+min(1.0,t[2])*t[3])*(1+t[4]);
for(int i=0;i<5;i++)t[i]+=-a[2][i]+a[3][i];
y=t[0]*(1+t[1]/100.0)*((1-min(1.0,t[2]))+min(1.0,t[2])*t[3])*(1+t[4]);
if(fabs(x-y)<1e-9)cout<<"0"<<endl;
else if(x+1e-9<y)cout<<"+"<<endl;
else if(x>y+1e-9)cout<<"-"<<endl;
for(int i=0;i<5;i++){
t[i]=a[1][i];
if(i>1)t[i]/=100.0;
}
x=t[0]*(1+t[1]/100.0)*((1-min(1.0,t[2]))+min(1.0,t[2])*t[3])*(1+t[4]);
for(int i=0;i<5;i++)t[i]+=a[2][i]-a[3][i];
y=t[0]*(1+t[1]/100.0)*((1-min(1.0,t[2]))+min(1.0,t[2])*t[3])*(1+t[4]);
if(fabs(x-y)<1e-9)cout<<"0"<<endl;
else if(x+1e-9<y)cout<<"+"<<endl;
else if(x>y+1e-9)cout<<"-"<<endl;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
1712 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |