上一页 1 ··· 39 40 41 42 43 44 45 46 47 ··· 49 下一页
摘要: Petya is having a party soon, and he has decided to invite his nn friends.He wants to make invitations in the form of origami. For eac... 阅读全文
posted @ 2018-11-24 17:02 black_hole6 阅读(108) 评论(0) 推荐(0)
摘要: 要求(A/B)%9973,但由于A很大,我们只给出n(n=A%9973)(我们给定的A必能被B整除,且gcd(B,9973) = 1)。Input数据的第一行是一个T,表示有T组数据。 每组数据有两个数n(0 #include#include#includeint m... 阅读全文
posted @ 2018-11-24 12:13 black_hole6 阅读(168) 评论(0) 推荐(0)
摘要: 算术基本定理,又称为正整数的唯一分解定理,即:每个大于1的自然数,若不是本身就是质数,就是可写为2个以上的质数的积,而且这些质因子按大小排列之后,写法仅有一种方式。例如:{\displaystyle 6936=2^{3}\times 3\times 17^{2}},{... 阅读全文
posted @ 2018-11-24 10:04 black_hole6 阅读(1803) 评论(0) 推荐(0)
摘要: Andy, 8, has a dream - he wants to produce his very own dictionary. This is not an easy task for him, as the number of words that he k... 阅读全文
posted @ 2018-11-22 10:55 black_hole6 阅读(118) 评论(0) 推荐(0)
摘要: 1967年,美国著名的社会学家斯坦利·米尔格兰姆提出了一个名为“小世界现象(small world phenomenon)”的著名假说,大意是说,任何2个素不相识的人中间最多只隔着6个人,即只用6个人就可以将他们联系在一起,因此他的理论也被称为“六度分离”理论(six... 阅读全文
posted @ 2018-11-20 18:59 black_hole6 阅读(725) 评论(0) 推荐(0)
摘要: Folyd算法适合多源最短路的求解问题(时间复杂度(O(n^3)),单源无负权值的问题适合Dijstra(O(n^2))小Hi强行装作没听到,继续说道:“这个算法的核心之处在于数学归纳法——MinDistance(i, j)之间最短路径中可以用到的节点是一点点增加的... 阅读全文
posted @ 2018-11-20 11:42 black_hole6 阅读(337) 评论(0) 推荐(0)
摘要: Dijkstra算法 Dijkstra算法算是贪心思想实现的,首先把起点到所有点的距离存下来找个最短的,然后松弛一次再找出最短的,所谓的松弛操作就是,遍历一遍看通过刚刚找到的距离最短的点作为中转站会不会更近,如果更近了就更新距离,这样把所有的点找遍之后就存下了起点到其... 阅读全文
posted @ 2018-11-20 09:20 black_hole6 阅读(12295) 评论(0) 推荐(1)
摘要: 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 her for the mor... 阅读全文
posted @ 2018-11-19 23:12 black_hole6 阅读(310) 评论(0) 推荐(0)
摘要: One cow from each of N farms (1 ≤ N ≤ 1000) conveniently numbered 1..N is going to attend the big cow party to be held at farm #X (1 ≤... 阅读全文
posted @ 2018-11-19 19:00 black_hole6 阅读(168) 评论(0) 推荐(0)
摘要: Freddy Frog is sitting on a stone in the middle of a lake. Suddenly he notices Fiona Frog who is sitting on another stone. He plans to... 阅读全文
posted @ 2018-11-18 10:18 black_hole6 阅读(107) 评论(0) 推荐(0)
上一页 1 ··· 39 40 41 42 43 44 45 46 47 ··· 49 下一页