摘要: 题目大意:n个站点,有m群奶牛,第i群奶牛有mi只,要从si站点出发,直到ti站点下车。 对于一群奶牛,可以不全部上车。同时在车上的奶牛数不能超过c,求最多能满足多少头奶牛的要求。 注意到可以不全部上车,那么贪心的思路就比较明确了 尽量让下车下得早的多上车,这样利益可以最大化 某些细节还是挺磨人的 阅读全文
posted @ 2017-05-20 11:13 人棍王楼下的AI 阅读(294) 评论(0) 推荐(0) 编辑
摘要: description Bytel is a mobile telephony potentate. Each employee has been issued a company phone, the memory ofwhich holds the numbers of some of his 阅读全文
posted @ 2017-05-17 23:48 人棍王楼下的AI 阅读(183) 评论(0) 推荐(0) 编辑
摘要: 一开始的时候被吓傻了 但一条边异或两次就毫无意义了 所以跑出来的结果是一条路径加若干环 判环用高斯消元就好了 最后把每个环与直接跑路径的结果做比较就好了 不算太麻烦,只是一开始写高斯消元写挂了 还是要多多练习 阅读全文
posted @ 2017-05-16 21:57 人棍王楼下的AI 阅读(239) 评论(0) 推荐(0) 编辑
摘要: 将权值用二进制表示,由于到达n就立即停止,我们定义f[i]表示从i到达n的期望值。 那么显然f[n]=0,对于其他情况,我们列出其转移方程: f[i]+=f[x]/deg[i] 若两边连边当前位为0 f[i]+=(1-f[x])/deg[i] 若两边连边当前位为1 然后就有n-1个方程,高斯消元求解 阅读全文
posted @ 2017-05-16 21:49 人棍王楼下的AI 阅读(148) 评论(0) 推荐(0) 编辑
摘要: description The widget factory produces several different kinds of widgets. Each widget is carefully built by a skilled widgeteer. The time required t 阅读全文
posted @ 2017-05-14 01:52 人棍王楼下的AI 阅读(243) 评论(0) 推荐(0) 编辑
摘要: A binary search tree is a binary tree. It may be empty. If it is not empty, it satisfies the following properties: (1) Every node has a key, and no tw 阅读全文
posted @ 2017-04-23 21:47 人棍王楼下的AI 阅读(371) 评论(0) 推荐(0) 编辑
摘要: In 2100, ACM chocolate will be one of the favorite foods in the world."Green, orange, brown, red��", colorful sugar-coated shell maybe is the most att 阅读全文
posted @ 2017-04-23 10:30 人棍王楼下的AI 阅读(188) 评论(0) 推荐(0) 编辑