当前位置:网站首页>[learning notes] stage test 1
[learning notes] stage test 1
2022-07-05 14:18:00 【Ants looking up at the starry sky】
Menci Sequence
Binary system + structure + greedy
At first glance dp . Think about 1.5h , Can't think of the state .
I'll mess around ! fool around with 80pts .
First, transform the original sequence . be aware 1000=010
After such construction, it is continuous + No more than 2 individual
Then we are greedy from high to low .
Obviously, we should use the least + To construct the .
So try not to carry the highest bit .
It is not difficult to think of a greedy plan : Traverse continuous... From left to right + paragraph , For each successive + Take only one , Each segment is continuous * Only take one , The prefix must be 1111…
If you encounter a suffix * Insufficient situation , So this paragraph * There must be a number of >=2 , Enough to isolate the influence of the later choice on the front ( In other words, it is impossible to carry ), Then we just need to let the latter + Contribute as much as possible to the answer .
It can be understood by adding two binary numbers .
You have to ask how this greed came to mind , I don't know either , Maybe it's a feeling .
Sort
Worship idsy …
The first feeling of this question is a fierce search .
Of course, this question is too boring if it can only be searched violently .
such as Limak and Shooting Points It can be called a search topic .
In fact, the positive solution is quite obvious .
consider <=i All operations are used , So for a length of 2 i − 1 2^{i-1} 2i−1 The internal order of the block has been determined , Rather as a whole .
If every paragraph is legal , The operation is not performed ; If a paragraph is illegal , Before and after the exchange ; If two paragraphs are illegal , Then classified discussion , At most 2 2 2 An exchange method .
Such a possible situation 2 n 2^n 2n Kind of , The sum O ( 4 n ) O(4^n) O(4n) .
Be careful not to forget factorial .
边栏推荐
- 治臻新能源冲刺科创板:年营收2.2亿 上汽创投是股东
- 鸿蒙第四次培训
- R language uses the polR function of mass package to build an ordered multi classification logistic regression model, and uses the coef function to obtain the log odds ratio corresponding to each vari
- tidb-dm报警DM_sync_process_exists_with_error排查
- How to introduce devsecops into enterprises?
- 享你所想。智创未来
- VC开发非MFC程序内存泄漏跟踪代码
- Postman简介、安装、入门使用方法详细攻略!
- Shen Ziyu, nouveau Président de Meizu: M. Huang Zhang, fondateur de Meizu, agira comme conseiller stratégique pour les produits scientifiques et technologiques de Meizu
- 日化用品行业智能供应链协同系统解决方案:数智化SCM供应链,为企业转型“加速度”
猜你喜欢

乌卡时代下,企业供应链管理体系的应对策略

openGauss数据库源码解析系列文章—— 密态等值查询技术详解(下)

为什么我认识的机械工程师都抱怨工资低?

Thymeleaf th:with局部变量的使用

Sorter evolution of ticdc 6.0 principle

如何深入理解“有限状态机”的设计思想?

Detailed explanation of IP address and preparation of DOS basic commands and batch processing

Qingda KeYue rushes to the science and Innovation Board: the annual revenue is 200million, and it is proposed to raise 750million

How to deeply understand the design idea of "finite state machine"?

无密码身份验证如何保障用户隐私安全?
随机推荐
01. Solr7.3.1 deployment and configuration of jetty under win10 platform
乌卡时代下,企业供应链管理体系的应对策略
The speed monitoring chip based on Bernoulli principle can be used for natural gas pipeline leakage detection
How to introduce devsecops into enterprises?
The function of qualifier in C language
R语言使用nnet包的multinom函数构建无序多分类logistic回归模型、使用coef函数获取模型中每个变量(自变量改变一个单位)对应的对数优势比(log odds ratio)
OSI and tcp/ip protocol cluster
Thymeleaf 模板的创建与使用
别不服气。手机功能升级就是强
Current situation, trend and view of neural network Internet of things in the future
网上电子元器件采购商城:打破采购环节信息不对称难题,赋能企业高效协同管理
矩阵链乘 - 动态规划实例
Fault analysis | analysis of an example of MySQL running out of host memory
3W principle [easy to understand]
How does redis implement multiple zones?
区间 - 左闭右开
Detailed explanation of SSH password free login
The simplest way to open more functions without certificates
关于Apache Mesos的一些想法
Assembly language
