Submission #15539

#TimeUsernameProblemLanguageResultExecution timeMemory
15539indosm님 무기가 좀 나쁘시네여 (kriii3_S)C++98
0 / 29
0 ms1084 KiB
#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 timeMemoryGrader output
Fetching results...