二分查找模板 #include <iostream> using namespace std; int find(int l, int r, int x){ int mid; while(l < r){ mid = l + (r - l) / 2; if( check