摘要:        
参考:https://blog.csdn.net/zqh_wz/article/details/52953516 妙啊 看成分段问题,因为火车只能一批一批的走(易证= =)设f[i]为到i为止的车都走完来回了,转移显然是 $$ f[i]=min{max(f[j]+i j 1,a[i])+i j 1+    阅读全文
posted @ 2018-04-25 21:15
lokiii
阅读(163)
评论(0)
推荐(0)
        
            
        
        
摘要:        
参考:https://www.cnblogs.com/iwtwiioi/p/4986316.html 注意区间长度为1e5级别。 则假设n个数不全相同,那么他们的gcd小于最大数 最小数,证明:则gcdk2−gcdk1=gcd(k2−k1) d 所以特判一下全相等的情况就行利润 然后把区间除以k,这    阅读全文
posted @ 2018-04-25 19:35
lokiii
阅读(130)
评论(0)
推荐(0)
        
            
        
        
摘要:        
就是后缀自动机的板子嘛..构造完自动机之后拓扑一下,记录size,对于size大于k的点和ans取max cpp include include include include using namespace std; const int N=100005; int n,m,a[N],cur=1,c    阅读全文
posted @ 2018-04-25 17:26
lokiii
阅读(129)
评论(0)
推荐(0)
        
            
        
        
摘要:        
二分答案,然后把边权大于二分值的的边赋值为1,其他边赋值为0,然后跑spfa最短路看是否满足小于等于k条边在最短路上    阅读全文
posted @ 2018-04-25 14:19
lokiii
阅读(156)
评论(0)
推荐(0)
        
            
        
        
摘要:        
注意输出是80字符个一行!! 首先贪心很显然,就是两头尽量拿小的。 然后需要处理两头一样的情况,显然是选字典序小的一串,把数组反着接在原数组后面,然后跑sa,判断的时候直接比较rk数组 cpp include include include using namespace std; const in    阅读全文
posted @ 2018-04-25 11:40
lokiii
阅读(139)
评论(0)
推荐(0)
        
            
        
        
摘要:        
floyd传递关系,一个牛能确定排名的条件是能和所有牛确定关系 cpp include include using namespace std; const int N=105; int n,m,a[N][N],ans; int main() { scanf("%d%d",&n,&m); for(i    阅读全文
posted @ 2018-04-25 10:06
lokiii
阅读(205)
评论(0)
推荐(0)
        
            
        
        
摘要:        
要求三边和大于第四边,所以任意一条边的长度都是小于n/2 设f[i][j]为前i条长为j,转移的时候用n/2限制 cpp include include using namespace std; int n,mx,f[5][2505]; int main() { f[0][0]=1; scanf("    阅读全文
posted @ 2018-04-25 09:37
lokiii
阅读(133)
评论(0)
推荐(0)
        
            
        
        
摘要:        
在线段树上记录长度、区间01翻转标记、当前1个数。传递tag的时候用长度 1个数即可 cpp include include using namespace std; const int N=100005; int n,m; struct qwe { int l,r,len,v,tg; }t[N'9    阅读全文
posted @ 2018-04-25 08:53
lokiii
阅读(137)
评论(0)
推荐(0)
        
            
        
        
摘要:        
设f[i][j]为第i分钟疲劳j,从三种情况转移,记得休息的时候判断从i开始休息到n能不能恢复到疲劳0 cpp include include using namespace std; const int N=10005,M=505; int n,m,a[N],f[N][M]; int main()    阅读全文
posted @ 2018-04-25 08:16
lokiii
阅读(137)
评论(0)
推荐(0)
        
            
        
        
摘要:        
裸的01背包    阅读全文
posted @ 2018-04-25 07:51
lokiii
阅读(98)
评论(0)
推荐(0)
        
            
        
        
摘要:        
要求区间取min和max,可以用st表或线段树维护 st表 cpp include include using namespace std; const int N=100005; int n,q,b[N],mn[N][20],mx[N][20]; int read() { int r=0,f=1;    阅读全文
posted @ 2018-04-25 07:47
lokiii
阅读(172)
评论(0)
推荐(0)
        
            
        
        
摘要:        
设up[i][j]为第i位升序为j的最小修改数,down为降序 cpp include include using namespace std; int n,a[30005],up[30005][4],down[30005][4]; int main() { scanf("%d",&n); for(    阅读全文
posted @ 2018-04-25 07:21
lokiii
阅读(100)
评论(0)
推荐(0)
        
 
                    
                     
                    
                 
                    
                
 
         浙公网安备 33010602011771号
浙公网安备 33010602011771号