Skip to content

提出#108

Open
tk399399 wants to merge 3 commits intoalgd2022:mainfrom
tk399399:main
Open

提出#108
tk399399 wants to merge 3 commits intoalgd2022:mainfrom
tk399399:main

Conversation

@tk399399
Copy link

終わりました。

Copy link

@nanashima nanashima left a comment

Choose a reason for hiding this comment

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

array.c apple.c spear.c works.c が正しく動いていません.
前半2つは逆だと思います.

src/spear.c Outdated
}

lb = 0;
ub = 1000000000;

Choose a reason for hiding this comment

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

初期値が不適切です.

src/works.c Outdated
int k;
int A[100000];

int p(int l1,int l2,int l3, int X[]){

Choose a reason for hiding this comment

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

多くのケースで正しい値返していないので,もう一度確認してみてください.

@tk399399
Copy link
Author

tk399399 commented Jul 5, 2022

前回の二分探索のプログラムを直したものを提出いたしました。
確認のほどよろしくお願いします。  外山

src/array.c Outdated
}
return sum > i2;
int p(int i1,int i2,int X[]){
return X[i2] > i1;

Choose a reason for hiding this comment

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

条件違います.

Copy link

@nanashima nanashima left a comment

Choose a reason for hiding this comment

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

変更分についてです
array: 正しい答えを返さないケースがあります.
apple: 初期値を改善出来ます.
spear: okです.

src/apple.c Outdated
if(p(k,mid,A)) ub = mid;
else lb = mid;
lb = 0;
ub = 1000000001;

Choose a reason for hiding this comment

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

初期値が改善出来ます.

int p(int i1,int i2,int X[]){
return X[i2] > i1;
int p(int i1, int i2, int i3,int X[]){
int sum = i1;

Choose a reason for hiding this comment

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

(これはただのコメントです)
結果的に式は同じになるのですが,個人的にどういう発想なのか気になりました.

@tk399399
Copy link
Author

tk399399 commented Aug 9, 2022

改善しました。確認のほどよろしくお願いします。

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