摘要: 有单调性一定可以二分,没有单调性有可能可以二分。 就像抽牌的时候,你总是从中间抽,而不是从头或者最后? 输入 5 2 1 2 3 4 5 1 6 求数的范围 #include<iostream> using namespace std; const int N=100010; int n,m; in 阅读全文
posted @ 2024-01-07 05:40 real-sunrise 阅读(1) 评论(0) 推荐(0) 编辑
摘要: #include<iostream>using namespace std;const int a=1e6+10;int q[a],t[a]; void margin_sort(int q[],int l,int r){ if(l>=r)return; int mid=(l+r)/2; mergin 阅读全文
posted @ 2024-01-06 04:31 real-sunrise 阅读(4) 评论(0) 推荐(0) 编辑
摘要: #include<iostream>using namespace std;const int N=1e6+10;int n;int q[N];void quck_sort(int q[], int l, int r){ if(l>=r)return; int i=l-1; int j=r+1; i 阅读全文
posted @ 2024-01-03 03:27 real-sunrise 阅读(1) 评论(0) 推荐(0) 编辑