码迷,mamicode.com
首页 >  
搜索关键字:lowest    ( 451个结果
hdu 1196 Lowest Bit
#include int main() { int i,n,a[10000],sum,j; while(~scanf("%d",&n)&&n) { sum=1; for(i=0;;i++) { a[i]=n%2; n=n/2; if(a[i]...
分类:其他好文   时间:2015-03-11 21:42:47    阅读次数:129
(hdu 简单题 128道)Lowest Bit(求一个数的二进制的最后一个非零位对应的十进制数)
题目:Lowest BitTime Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 8722    Accepted Submission(s): 6428Problem DescriptionGiven an positive integer A ...
分类:其他好文   时间:2015-03-11 17:11:56    阅读次数:140
1036. Boys vs Girls
This time you are asked to tell the difference between the lowest grade of all the male students and the highest grade of all the female students. Input Specification: Each input file contains o...
分类:其他好文   时间:2015-03-04 09:55:46    阅读次数:133
LeetCode Next Permutation
Implement next permutation, which rearranges numbers into the lexicographically next greater permutation of numbers. If such arrangement is not possible, it must rearrange it as the lowest possible...
分类:其他好文   时间:2015-02-24 21:04:51    阅读次数:218
HDOJ 1196 Lowest Bit
【题意】:给一个数,找其二进制的最低位n,输出2^n。比如 11010为10输出2,11000 is 1000输出8。 思路:按照二进制算法来就行。 【AC代码】: #include #include #include #include #include #include using namespace std; #define MAX 30 int main() {...
分类:其他好文   时间:2015-02-22 12:16:55    阅读次数:164
POJ 1258
一水,最小生成树,缓解心情#include #include #include #include using namespace std;const int inf=(1lowest[k]){ minc=lowest[k]; pos=k; } } // coutmap[pos][k]) ...
分类:其他好文   时间:2015-02-12 17:58:44    阅读次数:108
Lowest Common Ancestor in Binary Tree
The problem:Given node P and node Q in a binary tree T.Find out the lowest common ancestor of the two nodes.Analysis:The answer of this problem could ...
分类:其他好文   时间:2015-02-11 01:46:29    阅读次数:114
hdu_2028_Lowest Common Multiple Plus
原题链接:http://acm.hdu.edu.cn/showproblem.php?pid=2028解题思路:求多个数的最小公倍数,先求第一、二个数的最小公倍数,再与第三个数求它的最小公倍数,重复此过程,第n个数则停止。即可输出结果。 注意两个32位的整数相乘会溢出。。。(不太明白数位溢出现象。。。)#include using namespace std; int lowCom(in...
分类:其他好文   时间:2015-02-07 16:00:19    阅读次数:122
leetcode——Next Permutation
题目: Implement next permutation, which rearranges numbers into the lexicographically next greater permutation of numbers. If such arrangement is not possible, it must rearrange it as the lowest...
分类:其他好文   时间:2015-02-04 14:44:10    阅读次数:136
Lowest Common Multiple Plus
这么水的水题,我足足WA了四次,最后还是靠参考别人来AC……深深受到了打击。思路是,求第一个与第二个的最小公倍数,再求与第三个的,……与第N个的。a,b的最大公约数N与最小公倍数的关系是,aXb=最大公约数(k)X最小公倍数;需要注意的是,a*b/k的写法是不行的,要写成a/k*b,因为a*b分分钟...
分类:其他好文   时间:2015-02-04 12:22:44    阅读次数:165
451条   上一页 1 ... 39 40 41 42 43 ... 46 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!