码迷,mamicode.com
首页 >  
搜索关键字:return    ( 60766个结果
Remove Duplicates from Sorted Array
Given a sorted array, remove the duplicates in place such that each element appear onlyonceand return the new length.Do not allocate extra space for a...
分类:其他好文   时间:2014-05-07 14:07:56    阅读次数:345
Leetcode | Subsets I & II
Subsets IGiven a set of distinct integers, S, return all possible subsets.Note:Elements in a subset must be in non-descending order.The solution set m...
分类:其他好文   时间:2014-05-07 11:13:33    阅读次数:299
hdu1222
思路:m和n如果有公约数,则安全洞存在,无公约数或公约数为1,则无   #include int gcd(int a,int b) { if(b==0)return a; else { int r; while(b!=0) { r=a%b; a=b; ...
分类:其他好文   时间:2014-05-07 02:54:02    阅读次数:283
leetcode题目:Copy List with Random Pointer
题目: A linked list is given such that each node contains an additional random pointer which could point to any node in the list or null. Return a deep copy of the list. 思路: 主要是深层复制的问题: 本题比较简...
分类:其他好文   时间:2014-05-07 02:44:38    阅读次数:344
C++ 数字转字符串
#include string num2str( int i){ stringstream ss; ss<<i; return ss.strs();}
分类:编程语言   时间:2014-05-07 02:17:33    阅读次数:268
python异常介绍
1、异常 例如: def fetcher(obj,index): return obj[index] def catcher(): ...
分类:编程语言   时间:2014-05-07 01:51:04    阅读次数:460
Merge Two Sorted Lists
Merge Two Sorted ListsMerge two sorted linked lists and return it as a new list. The new list should be made by splicing together the nodes of the fir...
分类:其他好文   时间:2014-05-06 23:54:10    阅读次数:469
判断数据是否为整数
public class IsInteger { private IsInteger(){}; public static boolean isInteger(String value) { try { Integer.parseInt(value); return true; } catch (N...
分类:其他好文   时间:2014-05-06 23:27:37    阅读次数:348
FZOJ 1157 Crazy Tea Party
OJ题目:click here~~ 题目分析:1……n按顺序围成一个圈,1与n相邻。交换相邻两个数算1步。至少需要多少步,得到一个逆方向的1……n的圈。 分两半,使用冒泡排序,排成逆序的交换次数之和即为结果。 AC_CODE int f(int n){ return n*(n - 1)/2; } int main(){ int n , t; cin >> t; ...
分类:其他好文   时间:2014-05-06 23:15:55    阅读次数:301
算法竞赛_入门经典_刘汝佳__(2)
1,有几位数字 #include int main_2_1_digit(){ int n; while(scanf("%d",&n)){ int count = 0; if(n==0) count = 1; while(n){ count++; n/=10; } printf("%d\n",count); } return 0; } ...
分类:其他好文   时间:2014-05-06 21:20:19    阅读次数:374
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!