Skip to content

提出#106

Open
tsuuuru wants to merge 10 commits into
algd2022:mainfrom
tsuuuru:main
Open

提出#106
tsuuuru wants to merge 10 commits into
algd2022:mainfrom
tsuuuru:main

Conversation

@tsuuuru

@tsuuuru tsuuuru commented Jun 27, 2022

Copy link
Copy Markdown

関数名に悩みました
二分探索のコードがとても覚えやすかったです

@nanashima nanashima left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

spear.c works.c が正しく動いていません.
また,array.cは正しく動いているのですが,講義や資料の二分探索の(特にubとlbについての)解説を参考に余分な条件分岐を消してください.

Comment thread src/array.c Outdated
Comment thread src/spear.c Outdated
}

lb = 0;
ub = 1000000000;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

初期値が不適切です.

Comment thread src/works.c Outdated
}

lb = 0;
ub = 1000000;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

初期値が不適切です.

tsuuuru added 3 commits July 3, 2022 22:52
再提出しました。
よろしくお願いします。
修正しました。関数を新たに追加しました。よろしくお願いします。
こちらも初期値を修正しました。よろしくお願いします。
@tsuuuru

tsuuuru commented Jul 3, 2022

Copy link
Copy Markdown
Author

spear.c works.c array.cの修正をしました。
確認よろしくお願いいたします。

@nanashima nanashima left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

arrayが正しい答えを返していないです.
他は合ってます.

Comment thread src/array.c Outdated
ub = n;
while(ub - lb > 1){
int mid = (lb + ub)/2;
if(A[mid] > k) ub = mid;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

条件が違います.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

17行目
if(A[mid] >= k) ub = mid;
に修正しました。確認よろしくお願いします。

@tsuuuru
tsuuuru requested a review from nanashima August 8, 2022 19:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants