Diff
checker
텍스트
텍스트
이미지
문서
Excel
폴더
Legal
Enterprise
데스크톱
요금제
로그인
데스크톱 앱 다운로드
텍스트 비교
두 텍스트 파일의 차이점을 찾아보세요
도구
기록
실시간 편집
공백 변경 숨기기
변경 없는 행 숨기기
줄바꿈 비활성화
레이아웃
나란히 보기
합쳐 보기
비교 단위
스마트
단어
글자
텍스트 스타일
모양 변경
구문 강조
언어 선택
제외
텍스트 변환
첫 변경으로
수정
Diffchecker Desktop
가장 안전하게 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; }
비교하기