Looks standard problem but how to approach? Please help.

Правка en3, от abhist2, 2020-11-23 16:14:21

Hi everyone,

I need help in a question. It came to one of the contest I gave around 4 days ago. It was a hiring contest of a good indian company.

My approach was to store ai and bi as pairs in vector and sort them. So for each query we can get the count of chocolates having sweetness greater than x using binary search on vector but now how to get the count of lifetime greater than y? I got stuck here. I still couldn't think of something. Can you tell me how to approach?

It'll be really great if anyone can help me or give me some insight.

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en3 Английский abhist2 2020-11-23 16:14:21 149
en2 Английский abhist2 2020-11-23 16:13:00 14
en1 Английский abhist2 2020-11-23 16:11:18 599 Initial revision (published)