# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
15555 | comet | 님 무기가 좀 나쁘시네여 (kriii3_S) | C++98 | 0 ms | 1712 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#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;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |