Diff
checker
Texto
Texto
Imágenes
Documentos
Excel
Carpetas
Legal
Enterprise
Aplicación de escritorio
Precios
Iniciar sesión
Descargar Diffchecker Desktop
Comparar texto
Encuentra la diferencia entre dos archivos de texto
Herramientas
Historial
Editor live
Ocultar espacios en blanco
Ocultar sin cambios
Sin ajuste de línea
Vista
Dividido
Unificado
Nivel de detalle
Inteligente
Palabra
Letra
Estilos de texto
Cambiar apariencia
Resaltado de sintaxis
Elegir sintaxis
Ignorar
Transformar texto
Ir al primer cambio
Editar entrada
Diffchecker Desktop
La forma más segura de usar Diffchecker. ¡Obtén la app de Diffchecker Desktop: tus diffs nunca salen de tu computadora!
Obtener Desktop
Untitled diff
Creado
hace 11 años
El diff nunca expira
Borrar
Exportar
Compartir
Explicar
0 eliminaciones
Líneas
Total
Eliminado
Caracteres
Total
Eliminado
Para continuar usando esta función, actualice a
Diff
checker
Pro
Ver precios
47 líneas
Copiar todo
12 adiciones
Líneas
Total
Añadido
Caracteres
Total
Añadido
Para continuar usando esta función, actualice a
Diff
checker
Pro
Ver precios
55 líneas
Copiar todo
Copiar
Copiado
Copiar
Copiado
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;
}
}
Copiar
Copiado
Copiar
Copiado
/* 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;
Copiar
Copiado
Copiar
Copiado
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;
}
}
Diferencias guardadas
Texto original
Abrir archivo
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; }
Texto modificado
Abrir archivo
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; }
Encontrar la diferencia