当前位置:网站首页>Proof of the third scene (f) in 22 years
Proof of the third scene (f) in 22 years
2022-07-28 17:16:00 【Wonderful sauce with pepper】
F topic
The question : Given an undirected graph , Ask two points each time x, y, Ask whether there is one n Permutation , Make the first element x, The last element is y, And any prefix of the arrangement 、 Any suffix is connected .
solution
( I found that I can't order double , Quickly get started with graph theory 555
It's not hard to think of something related to cutting points , But only part of it qaq
This question should start with a bit of dual nature
Disorderly classification and discussion
If uv Double at the same point , Bipartite property , Deleting any point can keep the connection , So direct yes.
If uv At different points, double , And a total of two points are double and adjacent .( Let's not consider the disconnected situation ).
It is also possible to construct permutations p 1 p 2 . . . p n p_1p_2...pn p1p2...pn Of , among p 1.. p i p1..pi p1..pi Belong to a dot double , p i + 1 . . . p n p_{i+1}...pn pi+1...pn Belong to another , u = p 1 , v = p n u=p_1,v=p_n u=p1,v=pn
If there are more pairs, consider how to construct , After using double shrinking points , It's a tree . because uv Must be at the beginning and end of the array , This tree must be in the form of a chain ,uv The point pair must be at the beginning and end of the chain . The conclusion feels good .
The counter evidence method randomly proves that this tree is a chain :
Suppose it's not a chain , There are at least three leaves , set up uv The dot pairs are U,V(U≠V), The other leaf is T. Might as well set U And T Of lca by LCA, We will first UV Path construction to permutation p in ,
p 1 . . . p i The corresponding is U − > L C A Points on this path are double p_1...p_i The corresponding is U->LCA Points on this path are double p1...pi The corresponding is U−>LCA Points on this path are double , p i + 1 . . . p n The corresponding is U − > L C A Points on this path are double p_{i+1}...p_n The corresponding is U->LCA Points on this path are double pi+1...pn The corresponding is U−>LCA Points on this path are double ,( Omission does not mean a series of consecutive subscripts )
There is still T->LCA The dot pairs on this path are not added to the arrangement , Consider if there is only T and LCA Two points , How to construct .
Because a point may belong to multiple point pairs at the same time , Suppose dot double LCA Middle link U, Connect T The point of (LCA,U,T It's a set of points !) Belong to at the same time LCA,U and T( But when shrinking, it can only be temporarily placed in a set , Let's say that now LCA This collection ), Because this situation can increase the connectivity between point pairs , Thus, it is easier to construct the arrangement ( Poor expression qaq), We set this key point as k spot .
Now? U To V This path has been placed in the arrangement , Consider joining T. Consider keeping the prefixes of the permutation connected , The best way is to join k after , Just put T In the point , hypothesis k There's one in the back T In the point q, Let's look at the permutation suffix , Suffix at this time V To T The paths are disconnected , because k stay q front !!!
Then the reasoning to the worse case can not be constructed !
Certificate completion
If uv If the dot pair is at the beginning and end , We need to make a special judgment uv It's the case of cutting points . After all, the above can only guarantee the construction of uv Separate arrangement , And make sure that uv Connectivity between .
Pay attention to special judgment n=2 The situation of , Always be yes.
边栏推荐
- Read excel xlsx format file in unity
- net框架
- Visual Studio 2012/2015发布Web应用连同.cs源码一起发布
- Question making note 3 (two point search)
- SUSE CEPH add nodes, reduce nodes, delete OSD disks and other operations – storage6
- Microservice Architecture - service registry and service gateway (6.8) (Reprint)
- Easypoi multi sheet export by template
- Atcoder beginer contest 240 g.reporting Takahashi (classical problems of Combinatorial Mathematics)
- Add differential pairs and connections in Ad
- After paying $1.8 billion in royalties to Qualcomm, Huawei reportedly ordered 120million chips from MediaTek! Official response
猜你喜欢

kubernetes service 原理解析

DGL Chapter 1 (official tutorial) personal notes

Problem solution of code heartstrings Junior Group (official competition) of Dalian University of Technology (Development Zone campus) in 2021

零基础利用Unity3D开发AR应用并远程下载3D模型

Unity editor learning (I) using features to change the display of fields in components

net框架

Games101 section 13 ray tracing notes

全链路灰度在数据库上我们是怎么做的?

Goweb开发之Beego框架实战:第一节 Beego框架介绍

Alibaba cloud MSE supports go language traffic protection
随机推荐
System clock failure of database fault tolerance
Unity shader uses rendered texture to achieve glass effect
飞马D200S无人机与机载激光雷达在大比例尺DEM建设中的应用
Visual Studio 2012/2015发布Web应用连同.cs源码一起发布
华为Mate 40系列曝光:大曲率双曲面屏,5nm麒麟1020处理器!还将有天玑1000+的版本
Technology sharing | MySQL shell customized deployment MySQL instance
Some attention code explanations
Rsync 服务部署与参数详解
SUSE Ceph 增加节点、减少节点、 删除OSD磁盘等操作 – Storage6
技术分享 | MySQL Shell 定制化部署 MySQL 实例
Goweb开发之Beego框架实战:第一节 Beego框架介绍
Create a self-organizing / safe / controllable Lora network! Semtech responded for the first time to the impact of the "new regulations of the Ministry of industry and information technology"
Unity shader texture animation
How to use fail2ban to protect WordPress login page
kubenertes 1.16集群部署问题总结
Learn about service discovery in kubernetes
Realize the reset function of steering wheel UI with touch rotation and finger departure in unity
Jupyter notebook win installation record
UNIQUE VISION Programming Contest 2022(AtCoder Beginner Contest 248)G. GCD cost on the tree
Algorithm learning: leetcode interview question 09. implement queue with two stacks