답안 #15537

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
15537 2015-07-12T08:57:57 Z BothEarRim 님 무기가 좀 나쁘시네여 (kriii3_S) C++
0 / 29
0 ms 1720 KB
#include <iostream>
#include <sstream>
#include <iomanip>
#include <cstdio>
#include <string>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <utility>
#include <locale>
#include <algorithm>
#include <vector>
#include <queue>
#include <stack>
#include <list>
#include <set>
#include <climits>
#include <cfloat>
#include <map>
#include <functional>
using namespace std;
const long double PI=acos(-1);

class status
{
public:
	double g, h, c, cp, gs; // 공, 힘, 치, 치피, 공속

	status plus(status f)
	{
		status res;
		res.g = g + f.g;
		res.h = h + f.h;
		res.c = c + f.c;
		res.cp = cp + f.cp;
		res.gs = gs + f.gs;
		return res;
	}

	status minus(status f)
	{
		status res;
		res.g = g - f.g;
		res.h = h - f.h;
		res.c = c - f.c;
		res.cp = cp - f.cp;
		res.gs = gs - f.gs;
		return res;
	}

	double getPower()
	{
		h /= 100.0;
		c /= 100.0;
		cp /= 100.0;
		gs /= 100.0;
		return g*(1.0 + h) * ((1.0 - min(c, 1.0)) + min(c, 1.0) * cp) * (1.0 + gs);
	}
};

int main() // 제3회 kriiicon
{
	status cr_crWp, pm_pmWp, crWp, pmWp;
	scanf("%lf %lf %lf %lf %lf", &cr_crWp.g, &cr_crWp.h, &cr_crWp.c, &cr_crWp.cp, &cr_crWp.gs);
	scanf("%lf %lf %lf %lf %lf", &pm_pmWp.g, &pm_pmWp.h, &pm_pmWp.c, &pm_pmWp.cp, &pm_pmWp.gs);
	scanf("%lf %lf %lf %lf %lf", &crWp.g, &crWp.h, &crWp.c, &crWp.cp, &crWp.gs);
	scanf("%lf %lf %lf %lf %lf", &pmWp.g, &pmWp.h, &pmWp.c, &pmWp.cp, &pmWp.gs);

	status cr = cr_crWp.minus(crWp);
	status pm = pm_pmWp.minus(pmWp);
	status cr_pmWp = cr.plus(pmWp);
	status pm_crWp = pm.plus(crWp);

	double cr_crWp_power = cr_crWp.getPower();
	double cr_pmWp_power = cr_pmWp.getPower();
	if(cr_crWp_power < cr_pmWp_power) printf("+\n");
	else if(cr_crWp_power == cr_pmWp_power) printf("0\n");
	else printf("-\n");

	printf(">> %.2lf -> %.2lf\n", cr_crWp_power, cr_pmWp_power);

	double pm_pmWp_power = pm_pmWp.getPower();
	double pm_crWp_power = pm_crWp.getPower();
	if(pm_pmWp_power < pm_crWp_power) printf("+\n");
	if(pm_pmWp_power == pm_crWp_power) printf("0\n");
	else printf("-\n");

	printf(">> %.2lf -> %.2lf\n", pm_pmWp_power, pm_crWp_power);

    return 0;
}
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 1720 KB Output isn't correct
2 Halted 0 ms 0 KB -