Пожалуйста, прочтите новое правило об ограничении использования 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
  • Проголосовать: не нравится

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

I have been solving Problem C from Codeforces Round #885(Div. 2),1848C - Vika and Price Tags. Below code gets accepted but adding a little change to the calc function gives TLE,

Accepted Submission: 266686268 .....TLE: 266686665

I changed

return calc(b ,rem ) + q + q/2; 

to

 return calc(rem , b-rem ) + q + q/2 + 1; 

in the calc function and it is giving a TLE after this change even though the overall complexity remains the same. Can anyone explain the same?

Полный текст и комментарии »

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

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

I have been looking for ICPC India Regional Past Year Questions but have been unable to find them. Please guide how to move forward preparing for the same.

Полный текст и комментарии »

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