nexthexonextbutterflyvolantisyearnyiliashokaindigoapollolandscapecactusmateryicarusfluidmaterial ###nameTypewriter ###descirptionOne day, Jerry found a strange typewriter. This typewriter has 2 input modes: pay p coins to append an arbitrary single letter to the back, or q coins to copy a substring...

nexthexonextbutterflyvolantisyearnyiliashokaindigoapollolandscapecactusmateryicarusfluidmaterial 二分图的最小顶点覆盖定义:假如选了一个点就相当于覆盖了以它为端点的所有边。最小顶点覆盖就是选择最少的点来覆盖所有的边。 方法:最小顶点覆盖等于二分图的最大匹配。 我们用二分图来构造最小顶点覆盖。 二分图的最大独立集定义:选出一些顶点使得这些顶点两两不相邻,则这些点构成的集合称为独立集。找出一个包含顶点数最多的独立集称为最大独立集。 方法:最大独立集=所有顶点数-最小顶点覆盖。 二分图...

nexthexonextbutterflyvolantisyearnyiliashokaindigoapollolandscapecactusmateryicarusfluidmaterial 先bb一堆dij算法很简单,就是通过不断的松弛离源最近的点,说白了,就是一个bfs变种,或者叫做启发式搜索?启发函数就是当前的距离。搜索过程中松弛点 A*算法也不难,本质上就是启发式搜索,核心就在启发函数f+g上面,其中f为当前走过的路径长度,g为估值函数,估计下还有多远到终点 在一般的A*搜索中,可以解决迷宫问题,用曼哈顿距离来作为g函数,可以跑的飞快 我们可以根据dij算法求出的信息来计算第k短路...

nexthexonextbutterflyvolantisyearnyiliashokaindigoapollolandscapecactusmateryicarusfluidmaterial ###namePath ###descirptionYears later, Jerry fell in love with a girl, and he often walks for a long time to pay visits to her. But, because he spends too much time with his girlfriend, Tom feels...

nexthexonextbutterflyvolantisyearnyiliashokaindigoapollolandscapecactusmateryicarusfluidmaterial ###nameVacation ###descirptionTom and Jerry are going on a vacation. They are now driving on a one-way road and several cars are in front of them. To be more specific, there are n cars in front of them....

nexthexonextbutterflyvolantisyearnyiliashokaindigoapollolandscapecactusmateryicarusfluidmaterial ###nameOperation ###descirptionThere is an integer sequence a of length n and there are two kinds of operations:0 l r: select some numbers from $a_l…a_r$ so that their xor sum is maximum, and print the...

nexthexonextbutterflyvolantisyearnyiliashokaindigoapollolandscapecactusmateryicarusfluidmaterial ###nameBlank ###descriptionThere are N blanks arranged in a row. The blanks are numbered 1,2,…,N from left to right.Tom is filling each blank with one number in {0,1,2,3}. According to his thought, the...

nexthexonextbutterflyvolantisyearnyiliashokaindigoapollolandscapecactusmateryicarusfluidmaterial 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031...

nexthexonextbutterflyvolantisyearnyiliashokaindigoapollolandscapecactusmateryicarusfluidmaterial ###namepath ###descripptionYou have a directed weighted graph with n vertexes and m edges. The value of a path is the sum of the weight of the edges you passed. Note that you can pass any edge any times...

nexthexonextbutterflyvolantisyearnyiliashokaindigoapollolandscapecactusmateryicarusfluidmaterial 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475// tree 节点0不准使用int head[maxn];// pointint...