Submission #15499

#TimeUsernameProblemLanguageResultExecution timeMemory
15499ttgame님 무기가 좀 나쁘시네여 (kriii3_S)C++98
0 / 29
0 ms1720 KiB
#include <iostream> using namespace std; int min(int a, int b) { if (100<=a && a < 200) return b + ((a - 100)*(1 / 100)); else if (a == 200) return 2; else return a*(1 / 100); } int fight(double attack, double power, double cri, double crip, double speed) { double fight = (attack*(1 + (power / 100))) *((1 - min(cri, 1)) + min(cri, 1)*crip)*(1 + speed); return fight; } int main(void) { double kri[5]; double pa[5]; double kriW[5]; double paW[5]; for (int i = 0; i < 5; i++) { cin >> kri[i]; } for (int i = 0; i < 5; i++) { cin >> pa[i]; } for (int i = 0; i < 5; i++) { cin >> kriW[i]; } for (int i = 0; i < 5; i++) { cin >> paW[i]; } double krifight1 = fight(kri[0], kri[1], kri[2], kri[3], kri[4]); double pafight1 = fight(pa[0], pa[1], pa[2], pa[3], pa[4]); for (int i = 0; i < 5; i++) { kri[i] -= kriW[i]; pa[i] -= paW[i]; } for (int i = 0; i < 5; i++) { kri[i] += paW[i]; pa[i] += kriW[i]; } double krifight2 = fight(kri[0], kri[1], kri[2], kri[3], kri[4]); double pafight2 = fight(pa[0], pa[1], pa[2], pa[3], pa[4]); if (krifight1>krifight2) { cout << "-"<<endl; } else if (krifight1 < krifight2) { cout << "+"<<endl; } else { cout << "0"<<endl; } if (pafight1>pafight2) { cout << "-"<<endl; } else if (pafight1 <pafight2) { cout << "+"<<endl; } else { cout << "0"<<endl; } }
#Verdict Execution timeMemoryGrader output
Fetching results...