ACMCEG2C  Pick the candies
Pick the Candies
Many children went to a sweet shop. There were n candy varieties and each variety is kept in a separate bowl. The sweetness of each variety is written on the bowl. All the children wanted the candy with highest sweetness value. As there are only limited candies in each variety, the shop keeper makes a rule. According to the rule, the shopkeeper will show selectively chosen k varieties to every children. The children can pick any one of those varieties and move away. To make it easy for him, the shop keeper shows the
varieties 1,2,...,k to children1,
varieties 2,3,…,k+1 to children2,
varieties 3,4,…,k+2 to children3 and so on..
All the children are good at math. Find what variety each child will choose.
Hint: use deque
hide comments
aabdelhafeez55:
20190812 13:47:03
should i use deque??


techoscar:
20190409 20:54:22
Use Deque to keep track of elements of the variety of candies.


likhon5:
20180519 20:36:32
i came to this method and got ac


likhon5:
20180519 12:49:13
can anyone explain the [spoiler] technique for this problem


uvshuvo:
20180422 22:30:58
got AC, using concept : [spoiler] Last edit: 20190105 13:13:44 

aayush_987:
20170819 12:10:47
AC in one go!!! 

rohit9934:
20170717 10:05:36
O(spoiler) solution in 1 go.


shourav_007:
20170611 22:05:16
What about 3rd test case, I don't understand 

efrainq07:
20170412 01:54:47
[removed non English comment] Last edit: 20170802 13:19:00 

vengatesh15:
20170308 20:04:48
AC in 1 go :) 
Added by:  cegprakash 
Date:  20120330 
Time limit:  1s 
Source limit:  50000B 
Memory limit:  1536MB 
Cluster:  Cube (Intel G860) 
Languages:  All except: BF GOSU 