Submission #15556

#TimeUsernameProblemLanguageResultExecution timeMemory
15556comet님 무기가 좀 나쁘시네여 (kriii3_S)C++98
29 / 29
0 ms1712 KiB
#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,y,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++){ if(i>1)t[i]+=(-a[2][i]+a[3][i])/100.0; else 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 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++){ if(i>1)t[i]+=(a[2][i]-a[3][i])/100.0; else 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 cout<<"-"<<endl; }
#Verdict Execution timeMemoryGrader output
Fetching results...