[出售]Lenovo IdeaPad Yoga 2 Pro 13.3 (转载)# PDA - 掌中宝
z*8
1 楼
Candy AC Rate: 25/267 My Submissions
There are N children standing in a line. Each child is assigned a rating
value.
You are giving candies to these children subjected to the following
requirements:
Each child must have at least one candy.
Children with a higher rating get more candies than their neighbors.
What is the minimum candies you must give?
大家讨论一下
There are N children standing in a line. Each child is assigned a rating
value.
You are giving candies to these children subjected to the following
requirements:
Each child must have at least one candy.
Children with a higher rating get more candies than their neighbors.
What is the minimum candies you must give?
大家讨论一下