Submission #15445

#TimeUsernameProblemLanguageResultExecution timeMemory
15445tlwpdus님 무기가 좀 나쁘시네여 (kriii3_S)C++98
29 / 29
0 ms1084 KiB
#include<stdio.h> #include<math.h> using namespace std; double arr[4][5]; double cri, pab; double mini(double a, double b) { if (a < b) return a; return b; } double calc(double a, double b, double c, double d, double e) { return a*(1 + b / 100)*(1 - mini(1, c) + mini(1, c)*d)*(1 + e); } void input() { int i, j; for (i = 0; i < 4; i++) { scanf("%lf %lf %lf %lf %lf",&arr[i][0],&arr[i][1],&arr[i][2],&arr[i][3],&arr[i][4]); arr[i][3] /= 100; arr[i][4] /= 100; arr[i][2] /= 100; } for (j = 0; j < 5; j++) { double t = arr[0][j] - arr[2][j] + arr[3][j]; arr[3][j] = arr[1][j] - arr[3][j] + arr[2][j]; arr[2][j] = t; } double a, b; a = calc(arr[0][0], arr[0][1], arr[0][2], arr[0][3], arr[0][4]), b = calc(arr[2][0], arr[2][1], arr[2][2], arr[2][3], arr[2][4]); if (a - b<1e-7&&a - b>-1e-7) printf("0\n"); else if (a - b>1e-7) printf("-\n"); else printf("+\n"); a = calc(arr[1][0], arr[1][1], arr[1][2], arr[1][3], arr[1][4]), b = calc(arr[3][0], arr[3][1], arr[3][2], arr[3][3], arr[3][4]); if (a - b<1e-7&&a - b>-1e-7) printf("0\n"); else if (a - b>1e-7) printf("-\n"); else printf("+\n"); } int main() { input(); return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...