Children of the Candy CornTime Limit: 1000msMemory Limit: 65536KBThis problem will be judged onPKU. Original ID:308364-bit integer IO format:%lld Java...
分类:
其他好文 时间:
2014-09-07 23:39:25
阅读次数:
275
题目大概就是考察,如何找到山峰的峰值。从左到右扫一遍,再从右到左扫一遍,确定每个位置的峰值。 1 class Solution { 2 public: 3 int Max(int a,int b) 4 { 5 return a>b?a:b; 6 } 7 ...
分类:
其他好文 时间:
2014-09-06 00:58:22
阅读次数:
352
leetcode Candy 很好精巧回溯算法思想,锻炼思维。...
分类:
其他好文 时间:
2014-09-05 10:07:11
阅读次数:
182
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 on...
分类:
其他好文 时间:
2014-09-04 23:43:20
阅读次数:
184
三种解法:推荐第一种和最后一种,
方法一:遍历2次,时间复杂度:O(n),看见复杂度:o(n)
方法三:遍历一次,时间复杂度:o(n), 空间复杂大:o(1)
/* There are N children standing in a line. Each child is assigned a rating value.
You are giving candies to these c...
分类:
其他好文 时间:
2014-09-04 10:32:09
阅读次数:
200
昨天晚上 在csdn上做了一道分糖果的题目,我自个测的是没有问题,但是提交答案后,老失败,提示你的程序正常运行并输出了结果,但是答案错误你的程序输出结果与测试数据中的输出结果不符我先把自个思路说一下,再把我的代码贴出来,你们帮忙看看,哪里出了问题,或者有更好的思路分享下。题目是这样的:地址:http...
分类:
其他好文 时间:
2014-09-02 11:55:14
阅读次数:
162
本文为senlie原创,转载请保留此地址:http://blog.csdn.net/zhengsenlie
Candy
Total Accepted: 16494 Total
Submissions: 87468My Submissions
There are N children standing in a line. Each child is ...
分类:
其他好文 时间:
2014-08-29 02:54:17
阅读次数:
228
1 Candy题目:There areNchildren standing in a line. Each child is assigned a rating value.You are giving candies to these children subjected to the follo...
分类:
其他好文 时间:
2014-08-28 16:08:29
阅读次数:
294
原题戳我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...
分类:
其他好文 时间:
2014-08-28 12:59:49
阅读次数:
254
原题戳我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...
分类:
其他好文 时间:
2014-08-25 22:46:14
阅读次数:
307