Diff
checker
Texte
Texte
Images
Documents
Excel
Dossiers
Legal
Enterprise
Application de bureau
Prix
Se connecter
Télécharger Diffchecker Desktop
Comparer le texte
Trouver la différence entre deux fichiers texte
Outils
Historique
Éditeur live
Masquer les espaces
Cacher identiques
Sans retour à la ligne
Vue
Divisé
Unifié
Niveau de précision
Intelligent
Mot
Caractère
Styles de texte
Modifier l’apparence
Coloration syntaxique
Choisir la syntaxe
Ignorer
Transformer le texte
Aller au premier écart
Modifier l'entrée
Diffchecker Desktop
La façon la plus sécurisée d'utiliser Diffchecker. Obtenez l'application Diffchecker Desktop : vos diffs ne quittent jamais votre ordinateur !
Obtenir Desktop
Untitled diff
Créé
il y a 11 ans
Le diff n'expire jamais
Effacer
Exporter
Partager
Expliquer
0 suppressions
Lignes
Total
Supprimé
Caractères
Total
Supprimé
Pour continuer à utiliser cette fonctionnalité, passez à
Diff
checker
Pro
Voir les prix
47 lignes
Copier tout
12 ajouts
Lignes
Total
Ajouté
Caractères
Total
Ajouté
Pour continuer à utiliser cette fonctionnalité, passez à
Diff
checker
Pro
Voir les prix
55 lignes
Copier tout
Copier
Copié
Copier
Copié
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;
}
}
Copier
Copié
Copier
Copié
/* 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;
Copier
Copié
Copier
Copié
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;
}
}
Différences enregistrées
Texte d'origine
Ouvrir un fichier
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; }
Texte modifié
Ouvrir un fichier
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; }
Trouver la différence