摘要: 【传送门】https://nanti.jisuanke.com/t/31447 【题目大意】:有一个二分图,问能不能找到它的一个子图,使得这个子图中所有点的度数在区间【L,R】之内。 【题解】首先我们分这几种情况讨论: (1)如果集合U,V中存在某个点,它的度数小于L,那么肯定就不满足题意,直接输出 阅读全文
posted @ 2018-09-09 09:46 西风show码 阅读(182) 评论(0) 推荐(0) 编辑
摘要: 【前言】 背包问题是动态规划中的经典问题 ,特此总结三种背包问题的算法原理和一些基本实现,并且对每个问题提出了优化方案。目前只总结到初学者水平,以后拜读《背包九讲》之后如有新的体会再进行补充提升。欢迎读者批评指正。 【目录】 (1)0 - 1背包问题 (2)完全背包问题 (3)多重背包问题 (4)背 阅读全文
posted @ 2018-09-08 23:10 西风show码 阅读(183) 评论(0) 推荐(0) 编辑
摘要: 【传送门】:http://acm.hdu.edu.cn/showproblem.php?pid=2588 【题目大意】:给定N,M, 求有多少个x,1=<x<=N, 满足GCD(x,N)>= M 【题解】不妨设GCD(x,N)= k, x = pk, N = qk. 显然,p,q互质 这样GCD(x 阅读全文
posted @ 2018-09-08 09:33 西风show码 阅读(162) 评论(0) 推荐(0) 编辑
摘要: 【传送门】http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=5747 【题目大意】:薛定谔的背包。薛定谔的猫是只有观测了才知道猫的死活,薛定谔的背包是只有把物品放入背包中才知道物品的价值。。有两大类物品,价值分别是k1 , k2,数 阅读全文
posted @ 2018-09-07 20:00 西风show码 阅读(404) 评论(0) 推荐(0) 编辑
摘要: 【传送门】http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=4016 【题目大意】初始有n个空栈,现在有如下三种操作: (1) 1 s v 即 s.push(v) (2) 2 s 即 s.pop() 输出弹出的元素,如果栈s为空 阅读全文
posted @ 2018-09-07 18:56 西风show码 阅读(174) 评论(0) 推荐(0) 编辑
摘要: 【传送门】http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=4020 【题目大意】从起点(sx, sy)出发,要到达(ex , ey)。每次从点(x,y)走的时候要看红绿灯,灯的状态为1时只能左右走,走到(x , y+1)或者 阅读全文
posted @ 2018-09-07 18:15 西风show码 阅读(176) 评论(0) 推荐(0) 编辑
摘要: 【题目概述】 On an infinite smooth table, there's a big round fixed cylinder and a little ball whose volume can be ignored. Currently the ball stands still 阅读全文
posted @ 2018-09-06 23:07 西风show码 阅读(384) 评论(0) 推荐(0) 编辑
摘要: A frog has just learned some number theory, and can't wait to show his ability to his girlfriend. Now the frog is sitting on a grid map of infinite ro 阅读全文
posted @ 2018-09-06 21:28 西风show码 阅读(230) 评论(0) 推荐(0) 编辑
摘要: 题目描述: Given two positive integers a and b,find suitable X and Y to meet the conditions: X+Y=a Least Common Multiple (X, Y) =b Input Input includes mul 阅读全文
posted @ 2018-09-05 23:40 西风show码 阅读(234) 评论(0) 推荐(0) 编辑
摘要: 题目描述: Two people face two piles of stones and make a game. They take turns to take stones. As game rules, there are two different methods of taking st 阅读全文
posted @ 2018-09-05 22:44 西风show码 阅读(531) 评论(0) 推荐(1) 编辑