摘要: Problem Description 动物王国中有三类动物A,B,C,这三类动物的食物链构成了有趣的环形。A吃B, B吃C,C吃A。 现有N个动物,以1-N编号。每个动物都是A,B,C中的一种,但是我们并不知道它到底是哪一种。 有人用两种说法对这N... 阅读全文
posted @ 2022-09-20 23:01 老程序员111 阅读(1076) 评论(0) 推荐(0)
摘要: Problem Description Farmer John and Betsy are playing a game with N (1 #include#include#include#include#include#include#include... 阅读全文
posted @ 2022-09-20 23:01 老程序员111 阅读(60) 评论(0) 推荐(0)
摘要: 【概述】 并查集(Union-Find Set)是一种用于分离集合操作的抽象数据类型,其处理的是集合(set)之间的关系,一般处理的是图的连通分量,当给出两个的元素的一个无序对 (a,b) 时,需要快速合并(union) a 和 b 所在的集合,这期间需要反复... 阅读全文
posted @ 2022-09-20 23:01 老程序员111 阅读(205) 评论(0) 推荐(0)
摘要: 这周的计划是 Ford、SPFA 看完了,2-SAT 看了一半,并查集没按计划完成,但把最小生成树看了,还算可以。。。 下周 2-SAT、次短路径、并查集。。。 今晚打比赛。。菜的一批。。。做了 4、5 遍的红与黑 WA 了好几次,翻过来覆过去的找错。。。最后... 阅读全文
posted @ 2022-09-20 23:01 老程序员111 阅读(19) 评论(0) 推荐(0)
摘要: Problem Description 1967年,美国著名的社会学家斯坦利·米尔格兰姆提出了一个名为“小世界现象(small world phenomenon)”的著名假说,大意是说,任何2个素不相识的人中间最多只隔着6个人,即只用6个人就可以将他们联... 阅读全文
posted @ 2022-09-20 23:01 老程序员111 阅读(39) 评论(0) 推荐(0)
摘要: Problem Description Given a positive integer n, write a program to find out a nonzero multiple m of n whose decimal representat... 阅读全文
posted @ 2022-09-20 23:01 老程序员111 阅读(43) 评论(0) 推荐(0)
摘要: Problem Description Several currency exchange points are working in our city. Let us suppose that each point specializes in two... 阅读全文
posted @ 2022-09-20 23:01 老程序员111 阅读(109) 评论(0) 推荐(0)
摘要: Problem Description There are m people in n cities, and they all want to attend the party which hold by zz. They set out at the... 阅读全文
posted @ 2022-09-20 23:01 老程序员111 阅读(0) 评论(0) 推荐(0)
摘要: 原计划的图的遍历和拓扑排序看完了,顺便把 Floyd 和 Dijkstra 看完了,这周计划是 Ford、SPFA、并查集以及 2-SAT 问题 学长学姐去 ICPC 拿了块牌回来,羡慕 自己队出去比赛的次数是 17 级里最多的,但一直打铁一直让教练失望,还是... 阅读全文
posted @ 2022-09-20 23:01 老程序员111 阅读(15) 评论(0) 推荐(0)
摘要: Problem Description Bajtek, known for his unusual gifts, recently got an integer array x0,x1,…,xk−1. Unfortunately, after a hu... 阅读全文
posted @ 2022-09-20 23:01 老程序员111 阅读(31) 评论(0) 推荐(0)