Diff
checker
文本
文本
图像
文档
Excel
文件夹
Legal
Enterprise
桌面版
定价
登录
下载 Diffchecker 桌面版
比较文本
查找两个文本文件之间的差异
工具
历史
实时编辑器
隐藏空白更改
折叠未更改行
关闭换行
视图
拆分
统一
比对精度
智能
单词
字符
文本样式
更改外观
语法高亮
选择语法
忽略
文本转换
转到第一个差异
编辑输入
Diffchecker Desktop
运行Diffchecker最安全的方式。获取Diffchecker桌面应用:您的差异永远不会离开您的电脑!
获取桌面版
Untitled diff
创建于
11年前
差异永不过期
清除
导出
分享
解释
0 删除
行
总计
删除
字符
总计
删除
要继续使用此功能,请升级到
Diff
checker
Pro
查看价格
47 行
全部复制
12 添加
行
总计
添加
字符
总计
添加
要继续使用此功能,请升级到
Diff
checker
Pro
查看价格
55 行
全部复制
复制
已复制
复制
已复制
DP_TABLE_ENTRY
CC(int amt,unsigned int denom_count)
DP_TABLE_ENTRY
DP_
CC(int amt,unsigned int denom_count)
{
{
unsigned int n = denom_count;
unsigned int n = denom_count;
DP_TABLE_ENTRY ret = {0};
DP_TABLE_ENTRY ret = {0};
/* Calls with a negative amount are not stored.
/* Calls with a negative amount are not stored.
* Just need to return count= 0.
* Just need to return count= 0.
*/
*/
if(amt <0)
if(amt <0)
{
{
ret.runtime = 1; /* constant runtime */
ret.runtime = 1; /* constant runtime */
ret.count = 0;
ret.count = 0;
}
}
复制
已复制
复制
已复制
/* Precomputed value, just need to update number of references
* to this value.
*/
else if(DP_TABLE[amt][n].references != 0)
{
DP_TABLE[amt][n].references++;
DP_TABLE[amt][n].runtime = 1; /* constant runtime. */
return DP_TABLE[amt][n];
}
else if(n==0)
else if(n==0)
{
{
DP_TABLE[amt][n].count = 0;
DP_TABLE[amt][n].count = 0;
DP_TABLE[amt][n].references++;
DP_TABLE[amt][n].references++;
DP_TABLE[amt][n].runtime = 1; /* constant runtime. */
DP_TABLE[amt][n].runtime = 1; /* constant runtime. */
ret = DP_TABLE[amt][n];
ret = DP_TABLE[amt][n];
}
}
else if(amt == 0 )
else if(amt == 0 )
{
{
DP_TABLE[amt][n].count = 1;
DP_TABLE[amt][n].count = 1;
DP_TABLE[amt][n].references++;
DP_TABLE[amt][n].references++;
DP_TABLE[amt][n].runtime = 1; /* constant runtime. */
DP_TABLE[amt][n].runtime = 1; /* constant runtime. */
ret = DP_TABLE[amt][n];
ret = DP_TABLE[amt][n];
}
}
else
else
{
{
DP_TABLE_ENTRY left,right = {0};
DP_TABLE_ENTRY left,right = {0};
int new_amt = amt- maxDenom(n);
int new_amt = amt- maxDenom(n);
int new_n = n-1;
int new_n = n-1;
复制
已复制
复制
已复制
left =
CC(amt,new_n);
left =
DP_
CC(amt,new_n);
right =
CC(new_amt,n);
right =
DP_
CC(new_amt,n);
DP_TABLE[amt][n].count = left.count + right.count;
DP_TABLE[amt][n].count = left.count + right.count;
DP_TABLE[amt][n].references++;
DP_TABLE[amt][n].references++;
DP_TABLE[amt][n].runtime=left.runtime + right.runtime + 1; /* Runtime of sub-problems + time to conbine their results. */
DP_TABLE[amt][n].runtime=left.runtime + right.runtime + 1; /* Runtime of sub-problems + time to conbine their results. */
ret = DP_TABLE[amt][n];
ret = DP_TABLE[amt][n];
}
}
return ret;
return ret;
}
}
已保存差异
原始文本
打开文件
DP_TABLE_ENTRY CC(int amt,unsigned int denom_count) { unsigned int n = denom_count; DP_TABLE_ENTRY ret = {0}; /* Calls with a negative amount are not stored. * Just need to return count= 0. */ if(amt <0) { ret.runtime = 1; /* constant runtime */ ret.count = 0; } else if(n==0) { DP_TABLE[amt][n].count = 0; DP_TABLE[amt][n].references++; DP_TABLE[amt][n].runtime = 1; /* constant runtime. */ ret = DP_TABLE[amt][n]; } else if(amt == 0 ) { DP_TABLE[amt][n].count = 1; DP_TABLE[amt][n].references++; DP_TABLE[amt][n].runtime = 1; /* constant runtime. */ ret = DP_TABLE[amt][n]; } else { DP_TABLE_ENTRY left,right = {0}; int new_amt = amt- maxDenom(n); int new_n = n-1; left = CC(amt,new_n); right = CC(new_amt,n); DP_TABLE[amt][n].count = left.count + right.count; DP_TABLE[amt][n].references++; DP_TABLE[amt][n].runtime=left.runtime + right.runtime + 1; /* Runtime of sub-problems + time to conbine their results. */ ret = DP_TABLE[amt][n]; } return ret; }
更改后文本
打开文件
DP_TABLE_ENTRY DP_CC(int amt,unsigned int denom_count) { unsigned int n = denom_count; DP_TABLE_ENTRY ret = {0}; /* Calls with a negative amount are not stored. * Just need to return count= 0. */ if(amt <0) { ret.runtime = 1; /* constant runtime */ ret.count = 0; } /* Precomputed value, just need to update number of references * to this value. */ else if(DP_TABLE[amt][n].references != 0) { DP_TABLE[amt][n].references++; DP_TABLE[amt][n].runtime = 1; /* constant runtime. */ return DP_TABLE[amt][n]; } else if(n==0) { DP_TABLE[amt][n].count = 0; DP_TABLE[amt][n].references++; DP_TABLE[amt][n].runtime = 1; /* constant runtime. */ ret = DP_TABLE[amt][n]; } else if(amt == 0 ) { DP_TABLE[amt][n].count = 1; DP_TABLE[amt][n].references++; DP_TABLE[amt][n].runtime = 1; /* constant runtime. */ ret = DP_TABLE[amt][n]; } else { DP_TABLE_ENTRY left,right = {0}; int new_amt = amt- maxDenom(n); int new_n = n-1; left = DP_CC(amt,new_n); right = DP_CC(new_amt,n); DP_TABLE[amt][n].count = left.count + right.count; DP_TABLE[amt][n].references++; DP_TABLE[amt][n].runtime=left.runtime + right.runtime + 1; /* Runtime of sub-problems + time to conbine their results. */ ret = DP_TABLE[amt][n]; } return ret; }
查找差异