Submission #15400

#TimeUsernameProblemLanguageResultExecution timeMemory
15400cki86201님 무기가 좀 나쁘시네여 (kriii3_S)C++98
29 / 29
0 ms1084 KiB
#define _CRT_SECURE_NO_WARNINGS #include<stdio.h> #include<algorithm> using namespace std; double p[4][5]; double Get(double a, double b, double c, double d, double e){ return a * (1 + b / 100.0) * ((1 - min(c, 1.0)) + min(c, 1.0) * d) * (1 + e); } double ABS(double x){ return x > 0 ? x : -x; } void print(double x, double y){ if (ABS(x - y) < 1e-10)printf("0\n"); else if (x < y)printf("+\n"); else printf("-\n"); } int main(){ for (int i = 0; i < 4; i++){ for (int j = 0; j < 5; j++)scanf("%lf", p[i] + j); p[i][2] /= 100; p[i][3] /= 100; p[i][4] /= 100; } double q[5]; for (int i = 0; i < 5; i++)q[i] = p[2][i] - p[3][i]; double K1 = Get(p[0][0], p[0][1], p[0][2], p[0][3], p[0][4]); double K2 = Get(p[0][0] - q[0], p[0][1] - q[1], p[0][2] - q[2], p[0][3] - q[3], p[0][4] - q[4]); double K3 = Get(p[1][0], p[1][1], p[1][2], p[1][3], p[1][4]); double K4 = Get(p[1][0] + q[0], p[1][1] + q[1], p[1][2] + q[2], p[1][3] + q[3], p[1][4] + q[4]); print(K1, K2); print(K3, K4); return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...