View Code of Problem 32

#include<bits/stdc++.h>
using namespace std;

struct di{
	double x,y,hp;
};

int main() {

	double x,y;
	while(cin>>x>>y){
		di hero[5];
		for(int i=0;i<5;i++){
			cin>>hero[i].x>>hero[i].y>>hero[i].hp;
		}
		double l,r;
		cin>>l>>r;
		int num=0;
		for(int i=0;i<5;i++){
			double len=sqrt(pow(hero[i].x-x,2)+pow(hero[i].y-y,2));
			if(len*r>=hero[i].hp&&len<=l){
				num++;
				break;
			}
		}
		if(num==0){
			cout<<"No"<<endl;
		}else{
			cout<<"Yes"<<endl;
		}
	}

	return 0;
}

Double click to view unformatted code.


Back to problem 32