不说了,爆内存好几次,后来醒起状态有重复。。。状压+TSP#include #include #include #include #include #define LL long longusing namespace std;//#pragma comment(linker, "/STACK:10...            
                
                    
                        
                                                            
                                                                        
                                                                                        转载
                                                                                    
                            2015-09-23 11:01:00
                            
                                73阅读
                            
                                                                                    
                                2评论
                            
                                                 
                 
                
                             
         
            
            
            
            题目链接 https://codeforces.ml/contest/1517/problem/D 题目截图 题解 自从那场字符串场掉了180多分,从1649掉到了1400+后已经很久没更新了。。。之后连打了五场都上分了,这场更是直接让我到了1738。 这场是div1+div2的合场,abcd都是幸 ...            
                
                    
                        
                                                            
                                                                        
                                                                                        转载
                                                                                    
                            2021-04-24 11:52:00
                            
                                145阅读
                            
                                                                                    
                                2评论
                            
                                                 
                 
                
                             
         
            
            
            
            题解:刚拿到这个题目的时候我就想,就线段树维护区间gcd,这不就成了吗,tree[rt].gcd = gcd(tree[lson].gcd, tree[rson].gcd) ,又是单点修改,连lazy标记都不用,然后我又仔细想了想发现不对劲,因为gcd对模没有和加减一样类似的性质,也就是说。。。我的以上思路不对。。。。(cf网站中一些大佬给出了AC了的线段树代码,暂时还没研究) 看了一下官方题解,            
                
                    
                        
                                                            
                                                                        
                                                                                        转载
                                                                                    
                            2021-03-08 19:03:48
                            
                                247阅读
                            
                                                                                    
                                2评论
                            
                                                 
                 
                
                             
         
            
            
            
            Mahmoud wants to write a new dictionary that contains n words and relations between them. There are two types of relations: synonymy (i. e. the two wo            
                
                    
                        
                                                            
                                                                        
                                                                                        转载
                                                                                    
                            2017-07-26 01:32:00
                            
                                140阅读
                            
                                                                                    
                                2评论
                            
                                                 
                 
                
                             
         
            
            
            
            All our characters have hobbies. The same is true for Fedor. He enjoys shopping in the neighboring supermarket. The goods in the supermarket have uniq            
                
                    
                        
                                                            
                                                                        
                                                                                        转载
                                                                                    
                            2017-07-24 01:11:00
                            
                                91阅读
                            
                                                                                    
                                2评论
                            
                                                 
                 
                
                             
         
            
            
            
            There are n people taking part in auction today. The rules of auction are classical. There were n bids made, though it's not guaranteed they were from            
                
                    
                        
                                                            
                                                                        
                                                                                        转载
                                                                                    
                            2017-07-23 00:08:00
                            
                                103阅读
                            
                                                                                    
                                2评论
                            
                                                 
                 
                
                             
         
            
            
            
            Description Inzane finally found Zane with a lot of money to spare, so they together decided to establish a country of their own. Ruling a country is            
                
                    
                        
                                                            
                                                                        
                                                                                        转载
                                                                                    
                            2017-04-12 23:08:00
                            
                                132阅读
                            
                                                                                    
                                2评论
                            
                                                 
                 
                
                             
         
            
            
            
            Description Little Nastya has a hobby, she likes to remove some letters from word, to obtain another word. But it turns out to be pretty hard for her,            
                
                    
                        
                                                            
                                                                        
                                                                                        转载
                                                                                    
                            2017-02-26 23:41:00
                            
                                126阅读
                            
                                                                                    
                                2评论
                            
                                                 
                 
                
                             
         
            
            
            
            一道贪心题。
可以分两种情况
1 、是没有把对面的牌全打败,那么只要用最大的可能去打攻击状态的牌。
2、 是将对面的牌全打败,那么只要保证打对面防守状态的花费最小,就可以保证最后的结果最大
两种情况下的最大值就我们要的答案.
 
D. Ciel and Duel
time limit per test
2 seconds
memory limit per test
256 megabyte            
                
                    
                        
                                                            
                                                                        
                                                                                        转载
                                                                                    
                            2013-06-30 17:28:00
                            
                                84阅读
                            
                                                                                    
                                2评论
                            
                                                 
                 
                
                             
         
            
            
            
            A You are given ????n integers ????1,????2,…,????????a1,a2,…,an. Find the maximum value of ????????????(????????,????????+1,…,????????)⋅????????????(????????,????????+1,…,????????)max(a ...            
                
                    
                        
                                                            
                                                                        
                                                                                        转载
                                                                                    
                            2021-07-30 12:46:00
                            
                                200阅读
                            
                                                                                    
                                2评论
                            
                                                 
                 
                
                             
         
            
            
            
            题目链接https://codeforces.com/contest/1372/problem/D题面题意给定n(n≤2e5)n(n\leq2e5)n(n≤2e5)个数字,组成一个p[i][0]dp[i][0]d            
                
                    
                        
                                                            
                                                                        
                                                                                        原创
                                                                                    
                            2022-09-23 10:30:34
                            
                                85阅读
                            
                                                                             
                 
                
                                
                     
                                    
                             
         
            
            
            
            点击跳转A. Fence思路:手模一下,将最小值和最大值当成对边,中间值放在底部,顶边就是要求的边。根据三角形两            
                
                    
                        
                                                            
                                                                        
                                                                                        原创
                                                                                    
                            2022-07-15 09:18:35
                            
                                101阅读
                            
                                                                             
                 
                
                             
         
            
            
            
            Description The crowdedness of the discotheque would never stop our friends from having fun, but a bit more spaciousness won't hurt, will it? The disc            
                
                    
                        
                                                            
                                                                        
                                                                                        转载
                                                                                    
                            2017-06-08 23:27:00
                            
                                101阅读
                            
                                                                                    
                                2评论
                            
                                                 
                 
                
                             
         
            
            
            
            给n个圆要么包含,要么相分离,没有两个公共点,当成一棵树,把包含的面积大的放在上面 如图最上面的par记为-1,level记为0,当par 1||level==1时就加否则减, 就是第一,二层先加,第三层减,然后后面的一直交替就行了 #include<map> #include<set> #incl            
                
                    
                        
                                                            
                                                                        
                                                                                        转载
                                                                                    
                            2017-06-18 23:29:00
                            
                                158阅读
                            
                                                                             
                 
                
                             
         
            
            
            
            Description The map of Berland is a rectangle of the size n × m, which consists of cells of size 1 × 1. Each cell is either land or water. The map is            
                
                    
                        
                                                            
                                                                        
                                                                                        转载
                                                                                    
                            2016-10-03 23:31:00
                            
                                118阅读
                            
                                                                                    
                                2评论
                            
                                                 
                 
                
                             
         
            
            
            
            Description There are three points marked on the coordinate plane. The goal is to make a simple polyline, without self-intersections and self-touches,            
                
                    
                        
                                                            
                                                                        
                                                                                        转载
                                                                                    
                            2016-01-28 22:24:00
                            
                                123阅读
                            
                                                                                    
                                2评论
                            
                                                 
                 
                
                             
         
            
            
            
            比赛链接:Here A题挺水的就不写了 1304B - Longest Palindrome 题意: 输入 \(m\) 个长度为 \(n\) 的字符串,问这些字符串能组成的最长回文串有多长。 思路: 贪心的思想,我们只需要用当前字符串以及寻找该字符串的反向串是否存在,如果存在的话,就把该字符串与它的 ...            
                
                    
                        
                                                            
                                                                        
                                                                                        转载
                                                                                    
                            2021-08-23 18:59:00
                            
                                95阅读
                            
                                                                                    
                                2评论
                            
                                                 
                 
                
                             
         
            
            
            
            纠结的一道dp。状态转移方程还是比较好想的,优化比较纠结 D. Ilya and Roadstime limit per test3 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputEverything is great about Ilya's city, except the roads. The thing is, the only ZooVille road is represented asnholes in a row....            
                
                    
                        
                                                            
                                                                        
                                                                                        转载
                                                                                    
                            2013-06-28 09:02:00
                            
                                87阅读
                            
                                                                                    
                                2评论
                            
                                                 
                 
                
                             
         
            
            
            
            这题太坑了,无奈了, 当n==30000时,在我的电脑上跑了3.5s,提交竟然过了。。。因为这个比较均匀散开的,所以最多只会散开成150*150(准确的来说是124*124)的一个矩阵,然后暴力即可!30000*100*100 在cf这题还是没有超时的D. Antstime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputIt has been noted that if some ants are put in the junctions of th            
                
                    
                        
                                                            
                                                                        
                                                                                        转载
                                                                                    
                            2013-06-15 14:00:00
                            
                                63阅读
                            
                                                                                    
                                2评论
                            
                                                 
                 
                
                             
         
            
            
            
            这题思路不难, 比赛的时候没时间想了,唉。。。而且我在做的时候还错误的理解了题意,我以为是在【a,b】的子串中,判断最长的【c,d】。结果想了很久,想到脑子都快炸了,想出来后发现样例有问题,然后才发现我个2B题意又读错了。其实是在【a,b】中删除一些元素得到最大的 【c,d】,这样子就更好做了。解法: 首先可以知道的是,如果要在一个字符串s中删除一些元素的得到最多的连续的t串,那么我们可以采用贪心的策略,从头到尾扫一遍,用两个指针分别指向s和t,如果s[i]==t[j],这i++,j++,否则i++.有了这个性质之后,就可以知道一个a可能有多个b,也可能没有b,但是可以知道的是,这个里面是有循            
                
                    
                        
                                                            
                                                                        
                                                                                        转载
                                                                                    
                            2013-06-10 15:48:00
                            
                                112阅读
                            
                                                                                    
                                2评论