Submission #15277

#TimeUsernameProblemLanguageResultExecution timeMemory
15277skeksk91님 무기가 좀 나쁘시네여 (kriii3_S)C++98
29 / 29
0 ms1084 KiB
#include<stdio.h> double min(double a, double b) { if (a < b) { return a; } return b; } struct node { double a; double b; double c; double d; double e; node(double a=0, double b=0, double c=0, double d=0, double e=0) :a(a), b(b), c(c), d(d), e(e) {} node operator+(const node& p){ return node(a + p.a, b + p.b, c + p.c, d + p.d, e + p.e); } node operator-(const node& p) { return node(a - p.a, b - p.b, c - p.c, d - p.d, e - p.e); } double ju() { return a*(1 + (b / 100))*((1 - min(c/100, 1)) + min(c/100, 1)*d/100)*(1 + e/100); } }; int main() { node cri, pabu, criW, pabuW; scanf("%lf%lf%lf%lf%lf", &cri.a, &cri.b, &cri.c, &cri.d, &cri.e); scanf("%lf%lf%lf%lf%lf", &pabu.a, &pabu.b, &pabu.c, &pabu.d, &pabu.e); scanf("%lf%lf%lf%lf%lf", &criW.a, &criW.b, &criW.c, &criW.d, &criW.e); scanf("%lf%lf%lf%lf%lf", &pabuW.a, &pabuW.b, &pabuW.c, &pabuW.d, &pabuW.e); if ((cri - criW + pabuW).ju()>cri.ju()) { printf("+\n"); } else if ((cri - criW + pabuW).ju()<cri.ju()) { printf("-\n"); } else { printf("0\n"); } if ((pabu - pabuW + criW).ju()>pabu.ju()) { printf("+\n"); } else if ((pabu - pabuW + criW).ju()<pabu.ju()) { printf("-\n"); } else { printf("0\n"); } }
#Verdict Execution timeMemoryGrader output
Fetching results...