답안 #15224

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
15224 2015-07-12T04:08:56 Z tonyjjw 님 무기가 좀 나쁘시네여 (kriii3_S) C++14
0 / 29
0 ms 1084 KB
#include<stdio.h>
#include<math.h>
#include<algorithm>
#pragma warning(disable:4996)
using namespace std;

struct WEAPON{
	double atk,str,cri,cd,as;
	WEAPON(){}
	WEAPON(double a_,double b_,double c_,double d_,double e_){
		atk=a_,str=b_,cri=c_,cd=d_,as=e_;
	}
	WEAPON operator +(WEAPON A)const{
		return WEAPON(atk+A.atk,str+A.str,cri+A.cri,cd+A.cd,as+A.as);
	}
	WEAPON operator -(WEAPON A)const{
		return WEAPON(atk-A.atk,str-A.str,cri-A.cri,cd-A.cd,as-A.as);
	}
	double val(){
		return atk*(1+str/100)*(1+min(1.0,cri)*(cd-1))*(1+as);
	}
}A,B,C,D;

void inp(WEAPON &A){
	scanf("%lf %lf %lf %lf %lf",&A.atk,&A.str,&A.cri,&A.cd,&A.as);
	A.cri/=100;
	A.cd/=100;
	A.as/=100;
}

int main(){
//	freopen("input.txt","r",stdin);
	double v1,v2;
	inp(A),inp(B),inp(C),inp(D);
	v1=A.val(),v2=B.val();
	double v3,v4;
	v3=(A-C+D).val();
	v4=(B-D+C).val();
	if(abs(v1-v3)<1e-9){
		puts("0");
	}
	else{
		puts(v1<v3?"+":"-");
	}
	if(abs(v2-v4)<1e-9){
		puts("0");
	}
	else{
		puts(v2<v4?"+":"-");
	}
	return 0;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 1084 KB Output is correct
2 Correct 0 ms 1084 KB Output is correct
3 Incorrect 0 ms 1084 KB Output isn't correct
4 Halted 0 ms 0 KB -