Submission #15499

# Submission time Handle Problem Language Result Execution time Memory
15499 2015-07-12T08:31:52 Z ttgame 님 무기가 좀 나쁘시네여 (kriii3_S) C++
0 / 29
0 ms 1720 KB
#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 time Memory Grader output
1 Incorrect 0 ms 1720 KB Output isn't correct
2 Halted 0 ms 0 KB -