Welcome back to what’s going to be the last “official” part of this series – I’ll do more GPU-related posts in the future, but this series is long eno...
分类:
其他好文 时间:
2014-08-05 02:56:18
阅读次数:
427
二维动规是如果只用到本层的和上一层的数据就可以用滚动数组
比如 dp[i,j]=max(dp[i-1,j],dp[i,j-1]);
max的意思就不多说了...
具体例子的话,比较经典的就是最长公共子序列,就是 abcde 和 aecd的最长公共子序列就是acd。
如果不是滚动数组的话就是
for i:=1 to length(st1) do
for j:=1 to length(st2)d...
分类:
其他好文 时间:
2014-08-05 00:48:38
阅读次数:
266
#include "stdio.h"
void main(){
int i=0, a[]={3,4,5,4,3};
do
{
a[i]++;
}while(a[++i]<5);
for(i=0;i<5;i++)
printf("%d\n",a[i]) ;
}...
分类:
其他好文 时间:
2014-08-05 00:46:38
阅读次数:
254
Welcome back. This time we’re actually gonna see triangles being rasterized – finally! But before we can rasterize triangles, we need to do triangl...
分类:
其他好文 时间:
2014-08-05 00:25:38
阅读次数:
476
Given preorder and inorder traversal of a tree, construct the binary tree.Note: You may assume that duplicates do not exist in the tree./** * Definiti...
分类:
其他好文 时间:
2014-08-05 00:01:38
阅读次数:
271
Given inorder and postorder traversal of a tree, construct the binary tree.Note: You may assume that duplicates do not exist in the tree.class Solutio...
分类:
其他好文 时间:
2014-08-04 23:57:18
阅读次数:
476
http://poj.org/problem?id=1384
Piggy-Bank
Time Limit: 1000MS
Memory Limit: 10000K
Total Submissions: 7900
Accepted: 3813
Description
Before ACM can do anything...
分类:
其他好文 时间:
2014-08-04 21:35:58
阅读次数:
393
Message Flood Time Limit:1500MS Memory Limit:65536KB 64bit IO Format:%lld & %lluDescriptionWell, how do you f...
分类:
其他好文 时间:
2014-08-04 21:01:57
阅读次数:
295
Problem DescriptionThere is an old country and the king fell in love with a devil. The devil always asks the king to do some crazy things. Although th...
分类:
其他好文 时间:
2014-08-04 17:32:07
阅读次数:
290