# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
15539 | indosm | 님 무기가 좀 나쁘시네여 (kriii3_S) | C++98 | 0 ms | 1084 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 <stdio.h>
#include <stdlib.h>
int main(){
int i, j, k;
int cri[2][5], pib[2][5];
double a, b, c, d, e;
double crij[2], pibj[2];
for(i = 0; i<2; i++)
{
for(j = 0; j < 5; j++)
{
scanf("%d", &cri[i][j]);
}
for(j = 0; j<5; j++)
{
scanf("%d", &pib[i][j]);
}
}
if(cri[0][2] >100) cri[0][2] = 100;
if(cri[1][2] >100) cri[1][2] = 100;
if(pib[0][2] >100) pib[0][2] = 100;
if(pib[1][2] >100) pib[1][2] = 100;
a = (double)cri[0][0];
b = 1.0 + ((double)cri[0][1] / 100.0);
c = 1 - ((double)cri[0][2] / 100.0);
d = ((double)cri[0][2] / 100.0) * (double)cri[0][3] / 100.0;
e = 1 + ((double)cri[0][4] / 100.0);
crij[0] = a * b * (c+d) * e;
for(i = 0; i<5; i++)
{
cri[0][i] = cri[0][i] - cri[1][i];
cri[0][i] = cri[0][i] + pib[1][i];
}
a = (double)cri[0][0];
b = 1.0 + ((double)cri[0][1] / 100.0);
c = 1 - ((double)cri[0][2] / 100.0);
d = ((double)cri[0][2] / 100.0) * (double)cri[0][3] / 100.0;
e = 1 + ((double)cri[0][4] / 100.0);
crij[1] = a * b * (c+d) * e;
a = (double)pib[0][0];
b = 1.0 + ((double)pib[0][1] / 100.0);
c = 1 - ((double)pib[0][2] / 100.0);
d = ((double)pib[0][2] / 100.0) * (double)pib[0][3] / 100.0;
e = 1 + ((double)pib[0][4] / 100.0);
pibj[0] = a * b * (c+d) * e;
for(i = 0; i<5; i++)
{
pib[0][i] = pib[0][i] - pib[1][i];
pib[0][i] = pib[0][i] + cri[1][i];
}
a = (double)pib[0][0];
b = 1.0 + ((double)pib[0][1] / 100.0);
c = 1 - ((double)pib[0][2] / 100.0);
d = ((double)pib[0][2] / 100.0) * (double)pib[0][3] / 100.0;
e = 1 + ((double)pib[0][4] / 100.0);
pibj[1] = a * b * (c+d) * e;
if(crij[0] < crij[1])
{
printf("-\n");
}
else if(crij[0] == crij[1])
{
printf("0\n");
}
else
{
printf("+\n");
}
if(pibj[0] < pibj[1])
{
printf("-\n");
}
else if(pibj[0] == pibj[1])
{
printf("0\n");
}
else
{
printf("+\n");
}
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |