I hereby claim:
- I am shun2439 on github.
- I am shun2439 (https://keybase.io/shun2439) on keybase.
- I have a public key ASBl3TWWPRasZA6GtF80mKWOus9fVgKFqsmCd8xHltrwRAo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
| #include <iostream> | |
| #include <vector> | |
| using namespace std; | |
| vector<int> a = {1, 14, 32, 51, 51, 51, 243, 419, 750, 910}; | |
| // 目的の値 key の index を返すようにする (ない場合は -1) | |
| int binary_search(int key) | |
| { | |
| int left = 0, right = (int)a.size() - 1; // 配列 a の左端と右端 |