runtime error for problem 1495A (Diamond miner div.1 round 706)

Revision en2, by goatgm03, 2021-05-24 12:51:29

Hi guys. I finished solving this problem yesterday and for some reason I am getting runtime error ron test 2. Does anyone know why this is the case? My solution basically uses the same principle as the editorial. Basically, I sorted the positions of miners and positions of the mines in ascending order. Then I matched each miner on the y-axis with the mine on the x-axis with the same array index. For example miner[1] with mine[1],miner[2] with mine[2 and so on. Then I got the euclidian distance between the two points which in this problem is stated to be the energy needed for the miner to travel to his mine.

Afterwards, I summed all the energies of each miner to find the minimum total energy for each test case.

Here is my solution. 117154208

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en2 English goatgm03 2021-05-24 12:51:29 1 Tiny change: 'ne[1],mine[2] with m' -> 'ne[1],miner[2] with m'
en1 English goatgm03 2021-05-24 12:50:51 879 Initial revision (published)