当前位置: 首页 > news >正文

企业网站 设代理平台注册网站建设

企业网站 设,代理平台注册网站建设,wordpress md5工具,前端网页设计流程problem luogu-P3755 solution 这题第一眼矩阵内的点权值和#xff0c;马上就是 K-D tree\text{K-D tree}K-D tree 不过脑子的敲。 这其实就是个二维数点问题#xff0c;完全可以树状数组。 将矩阵差分成四个以原点为左下角的矩阵。 然后将基站按 xxx 轴排序#xff0…problem luogu-P3755 solution 这题第一眼矩阵内的点权值和马上就是 K-D tree\text{K-D tree}K-D tree 不过脑子的敲。 这其实就是个二维数点问题完全可以树状数组。 将矩阵差分成四个以原点为左下角的矩阵。 然后将基站按 xxx 轴排序矩阵按右上角的 (x,y)(x,y)(x,y) 的 xxx 排序。 树状数组维护 yyy 轴信息即可。 code-树状数组 #include bits/stdc.h using namespace std; #define int long long #define maxn 1000005 int n, m, cnt, tot; struct point { int x, y, w; }p[maxn]; struct node { int x, y, k, id; }g[maxn]; int val[maxn], ret[maxn];void read( int x ) {x 0; int f 1; char s getchar();while( s 0 or s 9 ) {if( s - ) f -1;s getchar();}while( 0 s and s 9 ) {x ( x 1 ) ( x 3 ) ( s ^ 48 );s getchar();}x * f; }void print( int x ) {if( x 0 ) putchar(-), x -x;if( x 9 ) print( x / 10 );putchar( x % 10 0 ); }namespace BIT {int t[maxn];void add( int x, int y ) {for( ;x cnt;x x -x ) t[x] y;} int ask( int x ) {int ans 0;for( ;x;x - x -x ) ans t[x];return ans;} }signed main() {read( n ), read( m );for( int i 1;i n;i ) {read( p[i].x ), read( p[i].y ), read( p[i].w );val[ cnt] p[i].y;}for( int i 1, xi, yi, xj, yj, w;i m;i ) {read( xi ), read( yi ), read( xj ), read( yj );g[ tot] (node){ xj, yj, 1, i };g[ tot] (node){ xi - 1, yj, -1, i };g[ tot] (node){ xj, yi - 1, -1, i };g[ tot] (node){ xi - 1, yi - 1, 1, i };val[ cnt] yj;val[ cnt] yi - 1;}sort( val 1, val cnt 1 );cnt unique( val 1, val cnt 1 ) - val - 1;for( int i 1;i n;i ) p[i].y lower_bound( val 1, val cnt 1, p[i].y ) - val;for( int i 1;i tot;i )g[i].y lower_bound( val 1, val cnt 1, g[i].y ) - val;sort( p 1, p n 1, []( point a, point b ) { return a.x b.x; } );sort( g 1, g tot 1, []( node a, node b ) { return a.x b.x; } );for( int i 1, j 1;i tot;i ) {for( ;j n and p[j].x g[i].x;j ) BIT :: add( p[j].y, p[j].w );ret[g[i].id] BIT :: ask( g[i].y ) * g[i].k;}for( int i 1;i m;i ) print( ret[i] ), putchar(\n);return 0; }code-KDtree #include bits/stdc.h using namespace std; #define maxn 100005 #define int long long struct point { int x, y, p; }g[maxn]; struct node { point Max, Min, id; int lson, rson, sum; }t[maxn]; int n, m, dim, X1, Y1, X2, Y2, ans;void read( int x ) {x 0; int f 1; char s getchar();while( s 0 or s 9 ) {if( s - ) f -1;s getchar();}while( 0 s and s 9 ) {x ( x 1 ) ( x 3 ) ( s ^ 48 );s getchar();}x * f; }void print( int x ) {if( x 0 ) putchar( - ), x -x;if( x 9 ) print( x / 10 );putchar( x % 10 0 ); }bool cmp( point a, point b ) {if( dim 0 ) return a.x b.x;if( dim 1 ) return a.y b.y; }void chkmin( point a, point b ) {a.x min( a.x, b.x );a.y min( a.y, b.y ); }void chkmax( point a, point b ) {a.x max( a.x, b.x );a.y max( a.y, b.y ); }void pushup( int now ) {t[now].sum t[now].id.p;if( t[now].lson ) {chkmin( t[now].Min, t[t[now].lson].Min );chkmax( t[now].Max, t[t[now].lson].Max );t[now].sum t[t[now].lson].sum;}if( t[now].rson ) {chkmin( t[now].Min, t[t[now].rson].Min );chkmax( t[now].Max, t[t[now].rson].Max );t[now].sum t[t[now].rson].sum;} }int build( int l, int r, int d ) {if( l r ) return 0;dim d; int mid l r 1;nth_element( g l, g mid, g r 1, cmp );t[mid].Max t[mid].Min t[mid].id g[mid];t[mid].lson build( l, mid - 1, d ^ 1 );t[mid].rson build( mid 1, r, d ^ 1 );pushup( mid );return mid; }void query( int now ) {if( ! now ) return;if( t[now].Max.x X1 or t[now].Min.x X2 or t[now].Max.y Y1 or t[now].Min.y Y2 ) return;if( X1 t[now].Min.x and t[now].Max.x X2 andY1 t[now].Min.y and t[now].Max.y Y2 ) {ans t[now].sum; return;}if( X1 t[now].id.x and t[now].id.x X2 andY1 t[now].id.y and t[now].id.y Y2 ) ans t[now].id.p;query( t[now].lson );query( t[now].rson ); }signed main() {read( n ), read( m );for( int i 1;i n;i ) read( g[i].x ), read( g[i].y ), read( g[i].p );int root build( 1, n, 0 );for( int i 1;i m;i ) {read( X1 ), read( Y1 ), read( X2 ), read( Y2 );ans 0, query( root );print( ans );putchar( \n );}return 0; }
http://www.zqtcl.cn/news/536725/

相关文章:

  • 咋么做进网站跳转加群代理记账公司如何寻找客户
  • 可以做pos机的网站app网站建设制作
  • 手机移动端网站影视摄影传媒公司
  • 做化工资讯的网站湖南省做网站的
  • 廊坊哪些公司做网站做网站域名是什么意思
  • 印刷网络商城网站建设上海那家公司做响应式网站建设
  • 四川省建设厅职称查询网站购物网站页面设计
  • 网站开发导航可以进不良网站的浏览器
  • 一个中介平台网站的建设费wordpress 文章列表只显示标题
  • 网站建设包括两个方面聊城建设路小学网站
  • 怎么样做一个自己的网站遵义软件制作平台
  • 推广网站实例建设厅的证在哪里查询
  • 分类网站建设方案做学校教务处网站
  • 如何做链接淘宝客的网站只做画册的网站
  • docker可以做网站吗专业的营销型网站
  • 重庆市建设工程安全网站上海制造网站公司
  • 咨询网站公司建设计划书安卓软件开发软件
  • 手机网站建设文章直播平台开发多少钱
  • 站长综合查询工具常用的网站开发语言有哪些
  • 免费网站看v片在线第一次做乌市seo网络营销流程
  • 社交网站模板下载柬埔寨网赌网站开发
  • 网站开发合同是否要交印花税杭州集团网站建设
  • 企业网站建设排名资讯一个公司做两个网站可以吗
  • 简单门户网站开发灰色行业seo大神
  • 网站开发学那种语言外贸推广网站建设
  • 公司网站建设及推广中国优秀企业网站欣赏
  • 个人代做网站建设京东类的网站需要什么流程
  • 建设一个地方门户网站厦门网站开发排名
  • 网站建设公司广告标题语网站设计主题有哪些
  • 网站推广方式主要通过做网站所需的知识技能