摘要: #include using namespace std; const int maxn=1e3+5; int val[maxn][maxn],l[maxn],r[maxn],h[maxn]; int ans,lmax,rmax,n,m,j; void solve(){ ans=0; for(int i=1;il[j])l[j]=lmax; }else h[j]=0,l[j]=1,r... 阅读全文
posted @ 2017-04-07 16:50 N维解析几何 阅读(327) 评论(0) 推荐(0) 编辑
摘要: #include using namespace std; const int maxn=1e5+5; char s[maxn]; int pre[maxn],Min[maxn>1; build(rt=r)return Min[rt]; int mid=(l+r)>>1; int res=INT_MAX; if(qlmid)res=min(res,query(rtv)swap(u,... 阅读全文
posted @ 2017-04-07 15:02 N维解析几何 阅读(224) 评论(0) 推荐(0) 编辑
摘要: #include using namespace std; typedef long long ll; const int maxn=2e5+5; const int mod=1e9+7; /* 因为是有向的无环图,要找(i,j)之间的路径数, 肯定是考虑toposort就可以了 然后就是考虑怎么统计cnt(i,j)*a[i]*b[j] 如果cnt[i]表示到达i的种类,res[i]表... 阅读全文
posted @ 2017-04-07 14:16 N维解析几何 阅读(175) 评论(0) 推荐(0) 编辑
摘要: 1 #include 2 using namespace std; 3 typedef long long ll; 4 const int maxn=3000; 5 6 /* 7 n m >n>>m){ 27 28 solve(n,cnt1); 29 solve(m,cnt2); 30 31 ll ... 阅读全文
posted @ 2017-04-07 14:15 N维解析几何 阅读(224) 评论(0) 推荐(0) 编辑