Open
Conversation
nanashima
requested changes
Jul 2, 2022
src/array.c
Outdated
| for(i = 0; i < n; i++){ | ||
| scanf("%d", &A[i]); | ||
| } | ||
| lb = 0; |
src/apple.c
Outdated
| int i, lb, ub; | ||
| scanf("%d%d", &n, &k); | ||
| for(i = 0; i < n; i++){ | ||
| for(i = 1; i <= n; i++){ |
There was a problem hiding this comment.
配列は0から始まります.
(n=100000のときこれだと配列外参照します.)
src/apple.c
Outdated
| while(ub - lb > 1) { | ||
| int mid = (lb + ub) / 2; | ||
| siguma = 0; | ||
| for(i = 1; i <=n; i++){ |
src/spear.c
Outdated
| int i, lb, ub; | ||
| scanf("%d%d", &n, &k); | ||
| for(i = 0; i < n; i++){ | ||
| for(i = 1; i <= n; i++){ |
Author
|
修正しましたので確認お願いします。 |
nanashima
requested changes
Jul 16, 2022
src/spear.c
Outdated
| } | ||
|
|
||
|
|
||
| printf("%d\n", ub); |
There was a problem hiding this comment.
lb:k本の槍が作れると分かっている槍の長さ
ub:k本の槍が作れないと分かっている槍の長さ
としているならば,出力すべきはk本の槍が作れる槍の長さの最大値なのでlbです.
src/spear.c
Outdated
| scanf("%d", &A[i]); | ||
| } | ||
| lb = 0; | ||
| ub = 1000000000; |
There was a problem hiding this comment.
その場合長さ10^9の槍はまだ作れる可能性があるので,この初期値は不適切です.
(長さ10^9の木から長さ10^9の槍は作れる)
Author
|
再修正しましたので確認お願いいたします。 |
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.
仕事の配分が難しかったです。