随笔分类 -  二分

摘要:An interesting binary-search problem. 阅读全文
posted @ 2019-12-18 20:33 Pat 阅读(217) 评论(0) 推荐(0)
摘要:"题目" 题目大意 给定一棵有 $n$ 个节点的树,边的权值每天变化。对于第 $i$ 条边,在第 $0$ 天,其权值为 $c_i$,每天权值变化 $a_i$(即,在第 $k$ 天,其权值为 $c_i + k a_i$)。求在第 $0$ 天到第 $D$ 天之间,树的直径的最小值,并且求出最早在哪一天达 阅读全文
posted @ 2018-07-23 10:35 Pat 阅读(294) 评论(4) 推荐(0)
摘要:"pyx的难题" 被这题搞得生无可恋. 容易看出 题目完成时间与优先级之间的关系是单调的,故可以二分答案. 用于二分的答案可以取$O(n)$个离散值, 这样就很方便地保证了优先级各不相同. 可以用优先队列模拟, $O(n\log(n))$判断. 总复杂度是$O(n \log^2(n))$, 只能通过 阅读全文
posted @ 2016-11-16 17:04 Pat 阅读(228) 评论(0) 推荐(0)
摘要:传送门 Time Limit: 2000MS Memory Limit: 65536K Description Farmer John is an astounding accounting wizard and has realized he might run out of money to r 阅读全文
posted @ 2015-11-05 14:39 Pat 阅读(215) 评论(0) 推荐(0)
摘要:传送门 Sherlock and MiniMax Authored by darkshadows on May 07 2014 Problem Statement Sherlock and MiniMax Authored by darkshadows on May 07 2014 Problem 阅读全文
posted @ 2015-08-20 21:33 Pat 阅读(376) 评论(0) 推荐(0)
摘要:传送门 D. One-Dimensional Battle Ships time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output D. On 阅读全文
posted @ 2015-08-07 04:04 Pat 阅读(375) 评论(0) 推荐(0)