当前位置:网站首页>[learning notes] differential constraint
[learning notes] differential constraint
2022-06-28 08:14:00 【Ants looking up at the stars】
The perfect combination of graph theory and inequality .
- If you find the maximum value of the difference between two variables , Then find the shortest path , Form like x i + d ≥ x j x_i+d\geq x_j xi+d≥xj
- If you find the minimum value of the difference between two variables , Then find the longest way , Form like x i + d ≤ x j x_i+d\leq x_j xi+d≤xj
Talk nonsense
Wannafly challenge round 9E - Group by group
There's a long one for n Sequence of numbers A, Among them is m There are two restrictions , There are two conditions :
1、 For interval [l,r], Its interval elements are bitwise or equal to x.
2、 For interval [l,r], Its interval elements are bitwise AND and equal to x.
Find a sequence of numbers A, To satisfy a given m Conditions , Make sure there's a solution .
1<=n,m<=10^5, 1<=l<=r<=n, 0<=x<2^20
sol: Obviously, in terms of position . Then find the shortest path .
wait … direct spfa Too slow will T .
We can make the upper bound a little smaller .
For or for 0 Arithmetic , We know s[l~r]=0 .
For prefixes and sum[i] , hypothesis s[1~i] Yes x individual 0 . that sum[i]<=i-x .
We connect one directly from the source i-x The edge of , It can effectively reduce the number of iterations .
[POI2015] PUS
POI
First of all, the complexity problem is not considered , This is a difference constraint .
Then consider optimizing .
One is when building a map , The problem of too many edges , We use the segment tree to optimize the drawing .
The second problem is that the data is too large to run . We Optimize according to the particularity of the graph .
First of all d[i]=x , We throw away the negative side , That is, only the lower bound is preserved , Final back inspection .
This is the right side .
Second, if you have a positive ring , Output has no solution .
direct DAG Just run topology sorting .
边栏推荐
- 同花顺注册开户靠谱吗?安全吗?
- SQL analysis (query interception analysis for SQL optimization)
- Configuring multiple instances of MySQL under Linux
- 设置网页的标题部分的图标
- Configuring MySQL multi instance master-slave synchronization for Linux
- 关于如何在placeholder中使用字体图标
- Unity 获取当前物体正前方,一定角度、距离的坐标点
- 安装nrm后,使用nrm命令报错internal/validators.js:124 throw new ERR_INVALID_ARG_TYPE(name, ‘string‘, value)
- Solve NPM err! Unexpected end of JSON input while parsing near
- 匿名页的反向映射
猜你喜欢

SQL master-slave replication setup

redis02——一篇终结redis的五种数据类型操作命令(可学习、复习、面试、收藏备用)

Today's notes 22/1/7

Airflow2 configuration windows azure SSO details based on oauth2 protocol

Airflow2.1.1 summary of the pits stepped on in actual combat!!

asp. Net datalist to display product information and pictures

城联优品向英德捐赠抗洪救灾爱心物资

B_QuRT_User_Guide(27)

Connaissez - vous le protocole TCP (2)?

关于在cmd中MySQL不能插中文数据的原因
随机推荐
Unity - use of API related to Pico development input system ---c
js运算符的优先级
ROS 笔记(08)— 服务数据的定义与使用
块级元素上下左右居中的两个小技巧
B_ QuRT_ User_ Guide(26)
Dataset filling data, and the use of rows and columns
Prometheus deployment alarm docking QQ mailbox
Resolution of Rac grid failure to start after server restart
The micro kernel zephyr is supported by many manufacturers!
Introduction to Devops Basics
Jacobian matrix J commonly used in slam
Doris学习笔记之介绍、编译安装与部署
Idea package together, using compact middle packages to solve &
Trigonometric transformation formula
MySQL two table connection principle (understand join buf)
SQL master-slave replication setup
【js】-【DFS、BFS应用】-学习笔记
B_ QuRT_ User_ Guide(27)
B_ QuRT_ User_ Guide(28)
Soft exam -- software designer -- afternoon question data flow diagram DFD