# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
15216 | yukariko | 님 무기가 좀 나쁘시네여 (kriii3_S) | C++98 | 0 ms | 1720 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <iostream>
using namespace std;
#define MY 0
#define CHANGE 1
float min(float n, float a)
{
if (n > a)
return a;
return n;
}
class player
{
public:
float atk, str, cri, cridmg, as;
public:
player() : atk(0), str(0), cri(0), cridmg(0), as(0)
{ }
player(float a, float s, float c, float d, float speed) : atk(a), str(s), cri(c/100), cridmg(d), as(speed)
{ }
float power()
{
float p = atk*(1 + str / 100) * ( (1 - min(cri, 1.0)) + (min(cri, 1.0)*cridmg) )*(1 + as);
return p;
}
player equip(float a, float s, float c, float d, float speed)
{
return player(a + atk, s + str, c + cri, d + cridmg, as + speed);
}
player unequip(float a, float s, float c, float d, float speed)
{
return player(atk-a, str-s, cri-c, cridmg-d, as-speed);
}
};
int main()
{
float atk, str, cri, cridmg, as;
player kri[2], pabu[2];
cin >> atk >> str >> cri >> cridmg >> as;
kri[MY]= player(atk, str, cri, cridmg, as);
cin >> atk >> str >> cri >> cridmg >> as;
pabu[MY] = player(atk, str, cri, cridmg, as);
cin >> atk >> str >> cri >> cridmg >> as;
kri[CHANGE] = kri[MY].unequip(atk, str, cri, cridmg, as);
pabu[CHANGE] = pabu[MY].equip(atk, str, cri, cridmg, as);
cin >> atk >> str >> cri >> cridmg >> as;
pabu[CHANGE] = pabu[CHANGE].unequip(atk, str, cri, cridmg, as);
kri[CHANGE] = kri[CHANGE].equip(atk, str, cri, cridmg, as);
float kripower[2] = {}, pabupower[2] = {};
kripower[0] = kri[MY].power();
kripower[1] = kri[CHANGE].power();
pabupower[0] = pabu[MY].power();
pabupower[1] = pabu[CHANGE].power();
if (kripower[0] < kripower[1])
cout << '+' << endl;
else if (kripower[0] == kripower[1])
cout << '0' << endl;
else
cout << '-' << endl;
if (pabupower[0] < pabupower[1])
cout << '+' << endl;
else if (pabupower[0] == pabupower[1])
cout << '0' << endl;
else
cout << '-' << endl;
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |