Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add C code in chapter_greedy #755

Merged
merged 15 commits into from
Sep 21, 2023
Merged

feat: add C code in chapter_greedy #755

merged 15 commits into from
Sep 21, 2023

Conversation

Nigh
Copy link
Contributor

@Nigh Nigh commented Sep 13, 2023

  • I've tested the code and ensured the outputs are the same as the outputs of reference codes.
  • I've checked the codes (formatting, comments, indentation, file header, etc) carefully.
  • The code does not rely on a particular environment or IDE and can be executed on a standard system (Win, macOS, Ubuntu).

Console output:

不超过背包容量的最大物品价值为 277.50
最大容量为 28
最大切分乘积为 1549681956

@vercel
Copy link

vercel bot commented Sep 13, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
hello-algo ⬜️ Ignored (Inspect) Visit Preview Sep 19, 2023 6:20pm

@Nigh Nigh changed the title WIP: add fractional_knapsack.c WIP: add C code for fractional knapsack Sep 13, 2023
@Nigh
Copy link
Contributor Author

Nigh commented Sep 14, 2023

@krahets 使用 docker 构建的页面中,没有渲染出对应的代码。贪心章节未渲染出任何代码。是否有额外配置需要编辑?

@Nigh Nigh changed the title WIP: add C code for fractional knapsack add C code for fractional knapsack Sep 14, 2023
@Nigh Nigh changed the title add C code for fractional knapsack feat: add C code for fractional knapsack Sep 14, 2023
@Nigh Nigh changed the title feat: add C code for fractional knapsack feat: add C code in chapter_greedy Sep 14, 2023
@krahets
Copy link
Owner

krahets commented Sep 15, 2023

@krahets 使用 docker 构建的页面中,没有渲染出对应的代码。贪心章节未渲染出任何代码。是否有额外配置需要编辑?

不需要哦,会自动构建的

@Nigh
Copy link
Contributor Author

Nigh commented Sep 15, 2023

@krahets

不需要哦,会自动构建的

166cfcd780388785ea0282d194bafe6

如上图,docker构建的页面,代码部分都只渲染出来模板。而官网的页面上面,同样的部分是有正常渲染出代码的。目前这个PR只有本地构建页面测试没有通过了。

Copy link
Contributor

@Gonglja Gonglja left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @Nigh, thank you for your contribution, please complete the above modifications.

codes/c/chapter_greedy/fractional_knapsack.c Outdated Show resolved Hide resolved
codes/c/chapter_greedy/max_capacity.c Outdated Show resolved Hide resolved
codes/c/chapter_greedy/max_capacity.c Outdated Show resolved Hide resolved
codes/c/chapter_greedy/max_capacity.c Outdated Show resolved Hide resolved
codes/c/chapter_greedy/max_capacity.c Outdated Show resolved Hide resolved
codes/c/chapter_greedy/max_capacity.c Outdated Show resolved Hide resolved
codes/c/chapter_greedy/max_capacity.c Outdated Show resolved Hide resolved
codes/c/chapter_greedy/max_product_cutting.c Outdated Show resolved Hide resolved
codes/c/chapter_greedy/max_product_cutting.c Outdated Show resolved Hide resolved
@Nigh
Copy link
Contributor Author

Nigh commented Sep 16, 2023

@Gonglja All modifications above have been resolved.

Copy link
Contributor

@Gonglja Gonglja left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please make a simple modification. @Nigh
It can be merged after modification. @krahets

codes/c/chapter_greedy/fractional_knapsack.c Outdated Show resolved Hide resolved
codes/c/utils/greedy.h Outdated Show resolved Hide resolved
Copy link
Owner

@krahets krahets left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @Nigh !

@krahets krahets merged commit d225b41 into krahets:main Sep 21, 2023
@krahets krahets added the code Code-related label Sep 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
code Code-related
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants