Diff
checker
テキスト
テキスト
画像
ドキュメント
Excel
フォルダ
Legal
Enterprise
デスクトップ
料金
ログイン
Diffchecker デスクトップのダウンロード
テキスト比較
2 つのテキスト ファイルの違いを見つける
ツール
履歴
ライブエディター
空白の変更を非表示
未変更行を折りたたむ
折り返しなし
レイアウト
分割
統合
比較精度
スマート
単語
文字
テキストスタイル
外観を変更
シンタックスハイライト
構文を選択
無視
テキスト変換
最初の差分へ移動
入力を編集
Diffchecker Desktop
Diffcheckerを実行する最も安全な方法。Diffchecker Desktopアプリを入手:あなたの差分はコンピューターから出ることはありません!
Desktopを入手
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; }
違いを見つける