aryam_agarwal's blog

By aryam_agarwal, history, 24 hours ago, In English

Hello Codeforces Community,

I’m seeking assistance with a problem I’m currently tackling. Here’s the issue:

Problem Statement:

In a factory, N workers are involved in a streamlined process of assembling M laptops in a conveyor belt system. The laptops have to be assembled in sequence from laptop 1 to laptop M. On each laptop, the workers have to do their job in sequence from worker 1 to worker N. Every laptop to be assembled has a factor of complexity, F. Each worker is responsible for a specific stage of the laptop assembly process, and the time taken (in minutes) by a worker to complete their part of the job on a laptop of complexity 1 is denoted by T. Therefore, the time needed for worker i to finish their part of the job on laptop j is computed as the product Tifj

To avoid any dust pileup on open laptops, as soon as worker i completes their part, the laptop has to be immediately passed on to worker i+1 without any delay. Tierefore, the starting time of assembling each laptop has to be managed such that all workers will be available when it is their turn to work on the laptop. Your task is to write a program to determine the shortest possible time in which all laptops can be assembled, by determining the optimal assembly start time for each laptop, while following all the assembly line rules. Read the input from STDIN and print the output to STDOUT. Do not print arbitrary strings anywhere in the program, as these contribute to the standard output and test cases will fail. Constraints:

i. 1 ≤ M ≤ 100000

ii. 1 ≤ N ≤ 100000

iii. 1 ≤ T; ≤ 10000

iv. 1 ≤ Fj ≤ 10000

sample test case:>

2 3

5 8

4 1 6

O/P- 130

Full text and comments »

  • Vote: I like it
  • +2
  • Vote: I do not like it

By aryam_agarwal, history, 2 months ago, In English

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”.

Full text and comments »

  • Vote: I like it
  • 0
  • Vote: I do not like it

By aryam_agarwal, history, 5 months ago, In English

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?

Full text and comments »

  • Vote: I like it
  • 0
  • Vote: I do not like it

By aryam_agarwal, history, 7 months ago, In English

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.

Full text and comments »

  • Vote: I like it
  • 0
  • Vote: I do not like it