当前位置:网站首页>[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 .
边栏推荐
- C语言中限定符的作用
- Qingda KeYue rushes to the science and Innovation Board: the annual revenue is 200million, and it is proposed to raise 750million
- Enjoy what you want. Zhichuang future
- 不相交集
- LeetCode_ 67 (binary sum)
- 03_Solr之dataimport
- How to make a second clip of our media video without infringement
- Detailed explanation of IP address and preparation of DOS basic commands and batch processing
- Judge whether the variable is an array
- Sorter evolution of ticdc 6.0 principle
猜你喜欢

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

ASP.NET大型外卖订餐系统源码 (PC版+手机版+商户版)

Thymeleaf 模板的创建与使用

Financial one account Hong Kong listed: market value of 6.3 billion HK $Ye wangchun said to be Keeping true and true, long - term work

tidb-dm报警DM_sync_process_exists_with_error排查

Tiflash compiler oriented automatic vectorization acceleration

Mingfeng medical sprint technology innovation board: annual revenue of 350million yuan, proposed to raise 624million yuan

What category does the Internet of things application technology major belong to

TiCDC 6.0原理之Sorter演进

Getting started with rce
随机推荐
快消品行业SaaS多租户解决方案,构建全产业链数字化营销竞争力
The forked VM terminated without saying properly goodbye
How to make a second clip of our media video without infringement
强联通分量
Oneconnect listed in Hong Kong: with a market value of HK $6.3 billion, ye Wangchun said that he was honest and trustworthy, and long-term success
展现强大。这样手机就不会难前进
软件测试人在深圳有哪些值得去的互联网公司【软件测试人员专供版】
01 、Solr7.3.1 在Win10平台下使用jetty的部署及配置
LeetCode_ 3 (longest substring without repeated characters)
Geom of R language using ggplot2 package_ Histogram function visual histogram (histogram plot)
Time to calculate cron expression based on cronsequencegenerator
Tiflash compiler oriented automatic vectorization acceleration
Fault analysis | analysis of an example of MySQL running out of host memory
POI set the data format of the column (valid)
Catch all asynchronous artifact completable future
What is the ranking of GF futures? Is it safe and reliable to open an account for GF futures online?
世界环境日 | 周大福用心服务推动减碳环保
R语言使用原生包(基础导入包、graphics)中的boxplot函数可视化箱图(box plot)
R language ggplot2 visual density map: Visual density map by group and custom configuration geom_ The alpha parameter in the density function sets the image transparency (to prevent multiple density c
How to introduce devsecops into enterprises?
