Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- bool check(int S){
- sliding_window w;
- for(int sum = 2; sum <= n+m; ++sum){
- int x = sum-S+2;
- w.clear();
- if(x<2) continue;
- for(int r1 = 1; r1 <= min(n,sum-1); ++r1){
- int r2 = sum-r1;
- int len = r2-(x-r1)+1;
- if(len<1) break;
- //if(S==5) cout << sum << ": " << r1 << " " << r2 << " " << r1 << " " << x-r1 << " " << w.getmax() << endl;
- if(r2<=m && a[r1]+b[r2]+hypotl(W,a[r1]-b[r2])-w.getmax()<=L) return true;
- if(!(x-r1<=0)) w.push(d[x][r1]);
- if(w.size()>len) w.pop();
- if(r2<=m && a[r1]+b[r2]+hypotl(W,a[r1]-b[r2])-w.getmax()<=L) return true;
- }
- }
- return false;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement