当前位置:网站首页>[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 .
边栏推荐
- Detailed explanation of IP address and preparation of DOS basic commands and batch processing
- Mingfeng medical sprint technology innovation board: annual revenue of 350million yuan, proposed to raise 624million yuan
- 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
- 物联网应用技术专业是属于什么类
- 关于Apache Mesos的一些想法
- 判断变量是否为数组
- 怎么叫一手一机的功能方式
- [buuctf.reverse] 152-154
- R language ggplot2 visualization: use ggplot2 to visualize the scatter diagram, and use the labs parameter to customize the X axis label text (customize X axis labels)
- C - Divisors of the Divisors of An Integer Gym - 102040C
猜你喜欢

魅族新任董事長沈子瑜:創始人黃章先生將作為魅族科技產品戰略顧問

TiFlash 源码解读(四) | TiFlash DDL 模块设计及实现分析

Tdengine biweekly selection of community issues | phase III

What are the advantages and characteristics of SAS interface

非技术部门,如何参与 DevOps?

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

神经网络物联网未来发展趋势怎么样

Thymeleaf th:classappend属性追加 th:styleappend样式追加 th:data-自定义属性

Thymeleaf 模板的创建与使用

Current situation, trend and view of neural network Internet of things in the future
随机推荐
LeetCode_ 69 (square root of x)
Use the word "new" to attract curious people
根据CronSequenceGenerator计算cron表达式的时间
R language ggplot2 visualization: use ggplot2 to visualize the scatter diagram, and use the labs parameter to customize the X axis label text (customize X axis labels)
What is the ranking of GF futures? Is it safe and reliable to open an account for GF futures online?
Detailed explanation of SSH password free login
广发期货排名多少?网上办理广发期货开户安全可靠吗?
总量分析 核算方法和势方法 - 分摊分析
最简单不用证书也可以多开功能的方式
Discussion on memset assignment
IP packet header analysis and static routing
最长公共子序列 - 动态规划
WebRTC的学习(二)
Postman简介、安装、入门使用方法详细攻略!
Enjoy what you want. Zhichuang future
R语言使用nnet包的multinom函数构建无序多分类logistic回归模型、使用coef函数获取模型中每个变量(自变量改变一个单位)对应的对数优势比(log odds ratio)
tidb-dm报警DM_sync_process_exists_with_error排查
What is the future development trend of neural network Internet of things
SAS接口有什么优势特点
TDengine 社区问题双周精选 | 第三期
