Open
Conversation
nanashima
requested changes
Jul 2, 2022
nanashima
left a comment
There was a problem hiding this comment.
apple.c spear.c works.c が正しく動いていません.
src/apple.c
Outdated
| for(int j = 0; j < n; j++){ | ||
| sum += A[j]; | ||
| } | ||
| return sum; |
src/spear.c
Outdated
| for(int j = 0; j < n; j++){ | ||
| sum += A[j]; | ||
| } | ||
| return sum; |
| } | ||
|
|
||
| //人の入れ替わりがk-1回起こるようにする | ||
| int p(int m){ |
There was a problem hiding this comment.
原因までは特定してないですが,資料中のケースでも正しく動いていないのでは?
Author
|
二分探索 再提出 |
nanashima
requested changes
Jul 16, 2022
nanashima
left a comment
There was a problem hiding this comment.
spearは境界値で正しい答えを返しません.
worksはほとんどのランダムケースで正しい答えを返していないです.(大きめの解を出しています)
src/spear.c
Outdated
|
|
||
|
|
||
| lb = 0; | ||
| ub = m(A); |
src/works.c
Outdated
| int people = 1; | ||
| for(int a = 0; a < n-1; a++){ | ||
| if(A[a] + A[a+1] <= m){ | ||
| A[a+1] = A[a] + A[a+1]; |
There was a problem hiding this comment.
Aに直接操作するのはあまり良い方法ではないです.
何度もpを呼ぶわけなので.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.