Submission #15211

# Submission time Handle Problem Language Result Execution time Memory
15211 2015-07-12T03:57:15 Z aqaqaqz 님 무기가 좀 나쁘시네여 (kriii3_S) C++
0 / 29
0 ms 1720 KB
#include <iostream>

using namespace std;

double getAttackPoint(double* user);
void useWeapon(double* user, double* weapon);
void clearWeapon(double* user, double* weapon);
void print(double* user);

int main(){
	double user[2][5];
	double weapon[2][5];

	for(int i=0;i<2;i++)
		for(int j=0;j<5;j++)
			cin >> user[i][j];
	
	for(int i=0;i<2;i++)
		for(int j=0;j<5;j++)
			cin >> weapon[i][j];
		
	
	double originalPoint[2];
	originalPoint[0] = getAttackPoint(user[0]);
	originalPoint[1] = getAttackPoint(user[1]);

	double changePoint[2];
	clearWeapon(user[0], weapon[0]);
	clearWeapon(user[1], weapon[1]);
	useWeapon(user[0], weapon[1]);
	useWeapon(user[1], weapon[0]);

	changePoint[0] = getAttackPoint(user[0]);
	changePoint[1] = getAttackPoint(user[1]);

	for(int i=0;i<2;i++){
		if(originalPoint[i] > changePoint[i])
			cout << '-' << endl;
		else if(originalPoint[i] < changePoint[i])
			cout << '+' << endl;
		else
			cout << '0' << endl;
	}
	
	return 0;
}

double getAttackPoint(double* user){
	user[2] /= 100;
	user[3] /= 100;
	user[4] /= 100;
	double point = user[0] * (1+user[1]/100) * ((1-min(user[2], (double)1)) + min(user[2], (double)1)*user[3] ) * (1+user[4]);
	user[2] *= 100;
	user[3] *= 100;
	user[4] *= 100;

	return point;
}

void useWeapon(double* user, double* weapon){
	for(int i=0;i<5;i++)
		user[i] += weapon[i];
}
void clearWeapon(double* user, double* weapon){
	for(int i=0;i<5;i++)
		user[i] -= weapon[i];
}

void print(double* user){
	for(int i=0;i<5;i++)
		cout << user[i] << " ";
	cout << endl;
}
# Verdict Execution time Memory Grader output
1 Correct 0 ms 1720 KB Output is correct
2 Correct 0 ms 1720 KB Output is correct
3 Correct 0 ms 1720 KB Output is correct
4 Incorrect 0 ms 1720 KB Output isn't correct
5 Halted 0 ms 0 KB -