Пожалуйста, прочтите новое правило об ограничении использования AI-инструментов. ×

Блог пользователя aryam_agarwal

Автор aryam_agarwal, история, 3 недели назад, По-английски

I was recently attempting a problem titled Path finder and had hit a roadblock. I would really appreciate if you can suggest your approach to the problem. Below is a rough outline of what I remember from the problem statement. Problem statement- You are given a point P(x,y) and a set of n circles. You have to find if there exists a path from origin(0,0) to P without crossing any of the circles (you can not touch the circle as well). The path must be only entirely within first quadrant Q NOTE: There will be no case where the circles form a train of circles enclosing the point among themselves. You can also assume that the point is to the right and above all circles if none of the circles contain the point.

Input: n: The number of circles. For each circle: three values (c_x, c_y, r) representing the center coordinates and the radius. Two values x and y representing the coordinates of point P.

Output: Print “YES” if a path exists; otherwise, print “NO”.

  • Проголосовать: нравится
  • 0
  • Проголосовать: не нравится

»
3 недели назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

Is it 2002C - Black Circles, if yes you can read the editorial

»
3 недели назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

find the distances between the center of the circles and the point P, also find the distance of the origin with the point P, you will find the answer