随笔分类 -  竞赛

摘要:题目链接: "POJ 1789" Description Advanced Cargo Movement, Ltd. uses trucks of different types. Some trucks are used for vegetable delivery, other for furn 阅读全文
posted @ 2019-10-15 22:21 wuli涛涛 阅读(187) 评论(0) 推荐(0)
摘要:题目链接: "POJ 1679" Description Given a connected undirected graph, tell if its minimum spanning tree is unique. Definition 1 (Spanning Tree): Consider a 阅读全文
posted @ 2019-10-14 20:50 wuli涛涛 阅读(118) 评论(0) 推荐(0)
摘要:题目链接: "LightOJ 1030" Description You are in a cave, a long cave! The cave can be represented by a $1 \times N$ grid. Each cell of the cave can contain 阅读全文
posted @ 2019-10-13 20:08 wuli涛涛 阅读(143) 评论(0) 推荐(0)
摘要:题目链接: "LightOJ 1027" Description You are in a maze; seeing $n$ doors in front of you in beginning. You can choose any door you like. The probability f 阅读全文
posted @ 2019-10-13 20:07 wuli涛涛 阅读(177) 评论(0) 推荐(0)
摘要:题目链接: "POJ 3268" Description One cow from each of $N$ farms $(1 ≤ N ≤ 1000)$ conveniently numbered $1..N$ is going to attend the big cow party to be h 阅读全文
posted @ 2019-10-13 20:06 wuli涛涛 阅读(188) 评论(0) 推荐(0)
摘要:题目链接: "POJ 1797" Description Background Hugo Heavy is happy. After the breakdown of the Cargolifter project he can now expand business. But he needs a 阅读全文
posted @ 2019-10-12 23:07 wuli涛涛 阅读(198) 评论(0) 推荐(0)
摘要:题目链接: "POJ 1797" Description Background Hugo Heavy is happy. After the breakdown of the Cargolifter project he can now expand business. But he needs a 阅读全文
posted @ 2019-10-12 23:05 wuli涛涛 阅读(228) 评论(0) 推荐(0)
摘要:题目链接: "POJ 2253" Description Freddy Frog is sitting on a stone in the middle of a lake. Suddenly he notices Fiona Frog who is sitting on another stone 阅读全文
posted @ 2019-10-11 23:00 wuli涛涛 阅读(241) 评论(0) 推荐(0)
摘要:题目链接: "POJ 2387" Description Bessie is out in the field and wants to get back to the barn to get as much sleep as possible before Farmer John wakes he 阅读全文
posted @ 2019-10-11 22:59 wuli涛涛 阅读(177) 评论(0) 推荐(0)
摘要:题意 给定两个字符串 $A$ 和 $B$,求 $B$ 在 $A$ 中的出现次数。 思路 这是一道 $KMP$ 的模板题。 不过 $Hash$ 是个好东西,可以用 $Hash$ 代替 $KMP$ 算法。 预处理两个字符串的哈希值,然后将 $A$ 中所有长度为 $len(B)$ 的子串的哈希值与 $B$ 阅读全文
posted @ 2019-10-10 23:03 wuli涛涛 阅读(404) 评论(0) 推荐(0)
摘要:比赛链接: "Codeforces Round 589 (Div. 2)" 官方题解: "Codeforces Round 589 (Div. 2) Editorial" A. Distinct Digits 题意 给定两个整数 $l$ 和 $r$,求一个 $x$ 满足 $l \le x \le r 阅读全文
posted @ 2019-10-09 22:37 wuli涛涛 阅读(194) 评论(0) 推荐(0)
摘要:题目链接: "P3455 [POI2007]ZAP Queries" 题意 给定 $a,b,d$,求 $\sum_{x=1}^{a} \sum_{y=1}^{b}[gcd(x, y) = d]$。 思路 莫比乌斯函数的一个性质: $$[x = 1] = \sum_{d|x} \mu(d)$$ 设 $ 阅读全文
posted @ 2019-10-08 22:03 wuli涛涛 阅读(150) 评论(0) 推荐(0)
摘要:题目链接: "HDU 1847" Problem Description 大学英语四级考试就要来临了,你是不是在紧张的复习?也许紧张得连短学期的ACM都没工夫练习了,反正我知道的Kiki和Cici都是如此。当然,作为在考场浸润了十几载的当代大学生,Kiki和Cici更懂得考前的放松,所谓“张弛有道” 阅读全文
posted @ 2019-10-07 22:33 wuli涛涛 阅读(160) 评论(0) 推荐(0)
摘要:"Codeforces Round 574 (Div. 2)" 题目链接: "E. OpenStreetMap" Seryozha conducts a course dedicated to building a map of heights of Stepanovo recreation cen 阅读全文
posted @ 2019-10-06 22:29 wuli涛涛 阅读(199) 评论(0) 推荐(0)
摘要:题目链接: "Kattis largesttriangle" Description Given $N$ points on a $2$ dimensional space, determine the area of the largest triangle that can be formed 阅读全文
posted @ 2019-10-05 22:33 wuli涛涛 阅读(679) 评论(0) 推荐(0)
摘要:题目链接: "P1742 最小圆覆盖" 题意 给出 N 个点,求最小的包含所有点的圆。 思路 随机增量 最小圆覆盖一般有两种做法:随机增量和模拟退火。随机增量的精确度更高,这里介绍随机增量的做法。 先将所有点随机打乱。 令前 $i 1$ 个点的最小覆盖圆为圆 $O$,加入第 $i$ 个点。 如果第 阅读全文
posted @ 2019-10-04 23:10 wuli涛涛 阅读(198) 评论(0) 推荐(0)
摘要:题目链接: "POJ 2001" Description A prefix of a string is a substring starting at the beginning of the given string. The prefixes of "carbon" are: "c", "ca 阅读全文
posted @ 2019-10-03 23:34 wuli涛涛 阅读(190) 评论(0) 推荐(0)
摘要:官方文档好像 GG 了。 rope 不属于标准 STL,属于扩展 STL,来自 pb_ds 库 (Policy Based Data Structures)。 基本操作: rope 内部是块状链表实现的,黑科技是支持 $O(1)$ 复制,而且不会空间爆炸 (rope 是平衡树,拷贝时只拷贝根节点就行 阅读全文
posted @ 2019-10-02 23:09 wuli涛涛 阅读(1399) 评论(0) 推荐(0)
摘要:"Codeforces Round 320 (Div. 1) [Bayan Thanks Round]" 题目链接: "B. "Or" Game" You are given $n$ numbers $a_1, a_2, ..., a_n$. You can perform at most $k$ 阅读全文
posted @ 2019-10-01 23:25 wuli涛涛 阅读(267) 评论(0) 推荐(0)
摘要:题目链接: "Fruit Ninja" 比赛链接: "2018 ACM 国际大学生程序设计竞赛上海大都会赛重现赛" 题目描述 Fruit Ninja is a juicy action game enjoyed by millions of players around the world, wit 阅读全文
posted @ 2019-09-30 23:24 wuli涛涛 阅读(216) 评论(0) 推荐(0)