답안 #15185

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
15185 2015-07-12T03:29:35 Z ddaafftt 님 무기가 좀 나쁘시네여 (kriii3_S) C++14
0 / 29
0 ms 1720 KB
#include <iostream>
#include <vector>
using namespace std;

int main(void)
{
	vector< vector<int> > vv;
	vector<int> v;

	int t;

	double k;
	double p;

	double k_fix;
	double p_fix;

	for (int i = 0; i < 4; ++i)
	{
		for (int j = 0; j < 5; ++j)
		{
			cin >> t;
			v.push_back(t);
		}

		vv.push_back(v);

		v.clear();
	}

	k = (vv[0][0]) * (1 + vv[0][1] / 100) * ((1 - (vv[0][2] >= 100 ? 1 : vv[0][2] * 0.01)) + (vv[0][2] >= 100 ? 1 : vv[0][2] * 0.01) * (vv[0][3] * 0.01)) * (1 + (vv[0][4] * 0.01));
	p = (vv[1][0]) * (1 + vv[1][1] / 100) * ((1 - (vv[1][2] >= 100 ? 1 : vv[1][2] * 0.01)) + (vv[1][2] >= 100 ? 1 : vv[1][2] * 0.01) * (vv[1][3] * 0.01)) * (1 + (vv[1][4] * 0.01));

	k_fix = (vv[0][0] - vv[2][0] + vv[3][0]) * (1 + (vv[0][1] - vv[2][1] + vv[3][1]) / 100) * ((1 - ((vv[0][2] - vv[2][2] + vv[3][2]) >= 100 ? 1 : (vv[0][2] - vv[2][2] + vv[3][2]) * 0.01)) + ((vv[0][2] - vv[2][2] + vv[3][2]) >= 100 ? 1 : (vv[0][2] - vv[2][2] + vv[3][2]) * 0.01) * ((vv[0][3] - vv[2][3] + vv[3][3]) * 0.01)) * (1 + ((vv[0][4] - vv[2][4] + vv[3][4]) * 0.01));
	p_fix = (vv[1][0] - vv[3][0] + vv[2][0]) * (1 + (vv[1][1] - vv[3][1] + vv[2][1]) / 100) * ((1 - ((vv[1][2] - vv[3][2] + vv[2][2]) >= 100 ? 1 : (vv[1][2] - vv[3][2] + vv[2][2]) * 0.01)) + ((vv[1][2] - vv[3][2] + vv[2][2]) >= 100 ? 1 : (vv[1][2] - vv[3][2] + vv[2][2]) * 0.01) * ((vv[1][3] - vv[3][3] + vv[2][3]) * 0.01)) * (1 + ((vv[1][4] - vv[3][4] + vv[2][4]) * 0.01));

	if (k > k_fix)
		cout << "-" << endl;

	else if (k == k_fix)
		cout << "0" << endl;

	else
		cout << "+" << endl;


	if (p > p_fix)
		cout << "-" << endl;

	else if (p == p_fix)
		cout << "0" << endl;

	else
		cout << "+" << endl;


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