码迷,mamicode.com
首页 >  
搜索关键字:ugly number    ( 27156个结果
HDU 1058 Humble Numbers(DP,数)
题意 所有只能被2,3,5,7这4个素数整除的数称为Humble Number 输入n 输出第n个Humble Number 1是第一个humble number 对于一个Humble Number a 有2*a,3*a,5*a,7*a都是Humble Number 可以以1为基数 依次展开即可得到一定范围内的Humble Number 用i,j,k,l分别记录 2,3,5,7分别乘到了第几个Humble Number 当前在计算第cnt个Humble Number 那么有 hum[c...
分类:其他好文   时间:2014-08-12 10:20:23    阅读次数:202
ACM 矩阵题目整理
先从最基础的矩阵快速幂加速递推开始。HDU 1005 Number Sequence|f[n-2],f[n-1]|* |0 B| =|f[n-1], B*f[n-2]+A*f[n-1]|=|f[n-1],f[n]| |1 A|建立矩阵如上然后利用快速幂求解即可。答案是mat[0][1...
分类:其他好文   时间:2014-08-12 10:04:03    阅读次数:267
hdu 1394 Minimum Inversion Number(线段树之 单点更新求逆序数)
Minimum Inversion Number                                                                           Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Problem D...
分类:其他好文   时间:2014-08-12 09:04:33    阅读次数:264
【leetcode】ZigZag Conversion
题目: The string "PAYPALISHIRING" is written in a zigzag pattern on a given number of rows like this: (you may want to display this pattern in a fixed font for better legibility) P A H N A P L S I I G Y I R And then read line by line: "PAHNAPLSIIG...
分类:其他好文   时间:2014-08-12 00:47:43    阅读次数:196
【HDOJ】2487 Ugly Windows
暴力解。 1 #include 2 #include 3 4 #define MAXN 105 5 6 char map[MAXN][MAXN]; 7 char visit[27]; 8 int n, m; 9 10 bool check(char c) {11 int i, j;1...
分类:Windows程序   时间:2014-08-12 00:14:23    阅读次数:289
[LeetCode] 3Sum Closest
Given an array S of n integers, find three integers in S such that the sum is closest to a given number, target. Return the sum of the three integers....
分类:其他好文   时间:2014-08-12 00:03:33    阅读次数:269
hdu 1711 Number Sequence(KMP)
# include # include # include using namespace std; int n,m,next[10010],a[1000010],b[10010]; void Getnext() { int i=0,j=-1; next[0]=-1; while(i<m) { if(j==-1||b[i]==b[j]) ...
分类:其他好文   时间:2014-08-11 21:27:33    阅读次数:240
POJ 3259 Wormholes(SPFA)
Description While exploring his many farms, Farmer John has discovered a number of amazing wormholes. A wormhole is very peculiar because it is a one-way path that delivers you to its destination a...
分类:其他好文   时间:2014-08-11 21:26:02    阅读次数:310
CUGBACM_Summer_Tranning5
A.Number Assignment UvaLive6434 简单题 #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using ...
分类:其他好文   时间:2014-08-11 21:24:12    阅读次数:393
ExtJS Grid Column Number
{xtype:'numbercolumn',text:'亏盈数量',width:130,dataIndex:'LossOrProfitNum',editor:{xtype:'numberfield',minValue:0,decimalPrecision:2},renderer:function(v...
分类:Web程序   时间:2014-08-11 21:05:32    阅读次数:171
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!