码迷,mamicode.com
首页 >  
搜索关键字:step return    ( 64763个结果
【LeetCode】Add Two Numbers
You are given two linked lists representing two non-negative numbers. The digits are stored in reverse order and each of their nodes contain a single digit. Add the two numbers and return it as a link...
分类:其他好文   时间:2014-05-23 07:43:23    阅读次数:246
编程之美之格格取数
#include//??????????С???? ? С???? #include using namespace std; int lfh(int n) { return (n*(n+1)/2)*(n*(n+1)/2); } unsigned int js(int n) { unsigned int ms=0; unsigned int sum=0; uns...
分类:其他好文   时间:2014-05-22 12:08:06    阅读次数:245
LeetCode: Search in Rotated Sorted Array [032]
【题目】 Suppose a sorted array is rotated at some pivot unknown to you beforehand. (i.e., 0 1 2 4 5 6 7 might become 4 5 6 7 0 1 2). You are given a target value to search. If found in the array return its index, otherwise return -1. You may assume no du...
分类:其他好文   时间:2014-05-22 10:43:12    阅读次数:310
LeetCode: Search Insert Position [034]
【题目】 Given a sorted array and a target value, return the index if the target is found. If not, return the index where it would be if it were inserted in order. You may assume no duplicates in the array. Here are few examples. [1,3,5,6], 5 → 2 [1,3,5,6]...
分类:其他好文   时间:2014-05-22 09:41:59    阅读次数:195
leetcode Longest Common Prefix
找出单词的最长公共前缀 class Solution { public: string longestCommonPrefix(vector &strs) { int len=strs.size(); if(len==0) return ""; int length=strs[0].size(),j; ...
分类:其他好文   时间:2014-05-22 09:35:20    阅读次数:230
LeetCode: Search for a Range [033]
【题目】 Given a sorted array of integers, find the starting and ending position of a given target value. Your algorithm's runtime complexity must be in the order of O(log n). If the target is not found in the array, return [-1, -1]. For example, Given [5...
分类:其他好文   时间:2014-05-22 06:44:39    阅读次数:265
2014华为实习上级笔试题——三天打鱼两天晒网
#include using namespace std; int func(int year)//判断闰年的个数 {     int count=0;     for(int i=1990;i         if(year%4==0&&year%100!=0||year%400==0)             count++;         return cou...
分类:其他好文   时间:2014-05-22 06:34:15    阅读次数:252
JS常用表单验证总结
表单验证 function check_1(param){//不为空     if(param==""||param==null){return false;}else{return true;}     } function check_2(param){//长度限制,字母是10个,汉字也是10个     if(param.length>10){return false;}else...
分类:Web程序   时间:2014-05-20 17:15:45    阅读次数:414
javascript判断浏览器类型
window["MzBrowser"]={};(function() { if(MzBrowser.platform) return; var ua = window.navigator.userAgent; MzBrowser.platform = window.navigator.platform; MzBrowser.firefox = ua.indexOf("Firefox")>0; Mz...
分类:编程语言   时间:2014-05-20 14:38:05    阅读次数:239
博弈树,动态规划(计算好的子问题存储起来,以后直接取用)
public class GameTree { /** * 判断剩余球数,谁能取到最后谁赢, * ,一人取一次,默认我方先取,,能否必胜,能就返回true,否则false * @param x剩余球数 * @return */ static boolean f(int x){ int[] op={1,3,7,8};//每次取球只能有四种情况 for(int i=0;i if (...
分类:其他好文   时间:2014-05-20 14:09:29    阅读次数:263
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!