随笔分类 -  二分

摘要:E1 #include<cstdio> #include<cstring> #include<iostream> #include<algorithm> #include<map> using namespace std; #define int long long const int N=1e6+ 阅读全文
posted @ 2020-07-02 10:08 晴屿 编辑
摘要:#include<map> #include<queue> #include<time.h> #include<limits.h> #include<cmath> #include<ostream> #include<iterator> #include<set> #include<stack> # 阅读全文
posted @ 2020-06-28 10:27 晴屿 编辑
摘要:#include<map> #include<queue> #include<time.h> #include<limits.h> #include<cmath> #include<ostream> #include<iterator> #include<set> #include<stack> # 阅读全文
posted @ 2020-06-21 12:07 晴屿 编辑
摘要://存在一个k,i<j<k,且q[k]<q[i]<q[j] //就不能放在一个栈内 //然后枚举一下所有的i j //如果满足上面的条件,就连一条边 //然后判断是不是二分图 //左边是第一个栈,右边是第二个栈 #include<cstdio> #include<cstring> #include< 阅读全文
posted @ 2020-05-29 02:06 晴屿 编辑
摘要:#include <bits/stdc++.h> using namespace std; typedef long long ll; const int maxn=1e6+7; #define int long long int a[107]; int n,m; int check(int x) 阅读全文
posted @ 2020-05-25 16:01 晴屿 编辑
摘要:``` #include #include #include #include #include using namespace std; typedef long long ll; const int N=500005; const int inf=1e9; ll num[N],pos[N]; ll dp[N]; ll q[N]; int n,d,lim; bool check(int mind 阅读全文
posted @ 2020-05-18 23:20 晴屿 编辑
摘要:``` //k可能是负数,所以斜率不在有单调性 //新加的点的横坐标还是单调递增的,但可能不是严格的 //在查询的时候:只能二分查找 //在插入的时候:将队尾不在凸包上的点删掉 //f[j]=(sumt[i]+s)*sumc[j]+f[i]-sumt[i]*sumc[i]-s*sumc[n] //f[i]=f[j]-(sumt[i]+s)sumc[j]+sumt[i]*sumc[i]+s*sumc 阅读全文
posted @ 2020-05-18 11:40 晴屿 编辑
摘要:``` #include #include #include #include #include #include using namespace std; const int N=50000*2; const int mod=100000000; int n,m,b; int e[N],ne[N],idx,h[N],w[N]; int fi[N]; const int inf=0x3f3f3f3 阅读全文
posted @ 2020-05-14 13:46 晴屿 编辑
摘要:``` #include #include #include #include using namespace std; const int N = 500010; int arr[N]; int city,box; bool check(int mid) { int sum = 0; for (int i = 0; i >1; if(check(mid)) r=mid; else l=mid+1 阅读全文
posted @ 2020-05-07 16:24 晴屿 编辑
摘要:``` #include #include #include #include using namespace std; typedef long long LL; const int N=1e5+10; int n,ans[N],tr[N],hi[N]; struct node { int h,k,id; } po[N]; int cmp(node a,node b) { return a.h> 阅读全文
posted @ 2020-05-07 16:12 晴屿 编辑
摘要:``` #include #include #include #include using namespace std; const double eps=1e-9; const double pie=3.1415926535; int T; double br,tr,H,v; double getV(double h) { double rr=(tr-br)*h/H+br; //相似三角形 re 阅读全文
posted @ 2020-05-07 14:11 晴屿 编辑
摘要:``` #include #include #include #include #include using namespace std; typedef long long ll; mapmp1; int cnt; void init() { cnt=2; mp1[1]=2; mp1[2]=7; while(mp1[cnt]>n; int ans=0; while(n>=2) { int l=1 阅读全文
posted @ 2020-05-07 12:33 晴屿 编辑
摘要:``` #include #include #include #include #include #define pi acos(-1.0) using namespace std; const int maxn = 10005; int r[maxn]; double v[maxn]; int n,f; bool check(double x) { int cnt = 0; int t = lo 阅读全文
posted @ 2020-05-07 01:20 晴屿 编辑
摘要:```#include#include#include#includeusing namespace std;const int maxx = 50000 + 500;int ll,n,m;int pos[maxx];bool check(int num) //判断当最小距离为num的时候是否要拿走的石头多于M{ int cnt = 0; int last = 0; pos[0] = 0; pos... 阅读全文
posted @ 2020-05-07 01:12 晴屿 编辑
摘要:```#include#include#include#includeusing namespace std;const int maxn = 100000+5;int n,a[maxn],m;bool check(int d){ int cnt=0; for(int i = 0; i =m) return 1; else return 0;}int main(){ while(scan... 阅读全文
posted @ 2020-05-07 00:59 晴屿 编辑
摘要:```#include#include#include#include#includeconst int maxn = 1e5+10;using namespace std;long long k;int n;long long a[maxn];long long ans=0;long long maxt=0;bool check(int mid){ long long hott=0; for(i... 阅读全文
posted @ 2020-05-07 00:48 晴屿 编辑
摘要:``` #include #include #include #include #include #include #include #define pi acos(-1.0) #define ll long long int using namespace std; const int M=(int)1e5; const ll mod=(ll)1e9 + 7; const ll inf=0x3f 阅读全文
posted @ 2020-05-07 00:36 晴屿 编辑
摘要:``` #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; #define rep_1(i,m,n) for(int i=m;i>re; for(int i=0; i>num[ 阅读全文
posted @ 2020-05-06 22:02 晴屿 编辑
摘要:``` #include #include #include #include using namespace std; const int N = 2e5+10; typedef long long ll; ll t, n1, n2, n3; ll a[N], b[N], c[N]; //分别固定一个数 设为a[i] //然后从 b 和 c 中找一个小于等于他的 和 一个大于等于他的 //然后枚 阅读全文
posted @ 2020-04-16 20:48 晴屿 编辑
摘要:``` //#include #include #include #include #include #include #include #define int long long using namespace std; #define rep_1(i,m,n) for(int i=m;i='0'&&ch='0'&&ch pii; typedef unsigned long long ull; 阅读全文
posted @ 2020-04-13 11:01 晴屿 编辑

点击右上角即可分享
微信分享提示