摘要: 第二题 阅读全文
posted @ 2017-04-17 11:09 TTTCoder 阅读(1701) 评论(0) 推荐(0) 编辑
摘要: /* 2 |埃式筛法| 3 |快速筛选素数| |15-7-26| 4 */ #include <iostream> #include <cstdio> using namespace std; const int SIZE = 1e7; int prime[SIZE]; // 第i个素数 bool 阅读全文
posted @ 2017-04-16 20:39 TTTCoder 阅读(267) 评论(0) 推荐(0) 编辑
摘要: (一)Prim算法的功能: Prim算法实现的是找出一个有权重连通图中的最小生成树,即:具有最小权重且连接到所有结点的树。(强调的是树,树是没有回路的)。 (二)算法的基本思想: 首先以一个结点作为最小生成树的初始结点,然后以迭代的方式找出与最小生成树中各结点权重最小边,并加入到最小生成树中。加入之 阅读全文
posted @ 2017-04-16 10:30 TTTCoder 阅读(635) 评论(0) 推荐(0) 编辑
摘要: N (1 ≤ N ≤ 100) cows, conveniently numbered 1..N, are participating in a programming contest. As we all know, some cows code better than others. Each 阅读全文
posted @ 2017-04-16 00:29 TTTCoder 阅读(269) 评论(0) 推荐(0) 编辑
摘要: (五)C++完整代码 阅读全文
posted @ 2017-04-15 23:23 TTTCoder 阅读(400) 评论(0) 推荐(0) 编辑
摘要: It's Halloween! Farmer John is taking the cows to a costume party, but unfortunately he only has one costume. The costume fits precisely two cows with 阅读全文
posted @ 2017-04-15 22:48 TTTCoder 阅读(262) 评论(0) 推荐(0) 编辑
摘要: The cows are having their first election after overthrowing the tyrannical Farmer John, and Bessie is one of N cows (1 ≤ N ≤ 50,000) running for Presi 阅读全文
posted @ 2017-04-15 22:37 TTTCoder 阅读(247) 评论(0) 推荐(0) 编辑
摘要: (一)首先明确Dijkstra算法是干什么的 是解决赋权图单源最短路问题的。(二)算法的基本思想: 先确定始点到某一点的最短通路,然后利用这个结果再去求始点到另一个点的最短通路,直到找到始点a到终点z的最短通路。(三)算法的基本步骤: 1.将点集V分成两个子集T和S,初始时,将始点a放进T集合,S=V-T,DT(t)=w(a,t),DT(t)表示在集合S中的任一点t到始点a的最短... 阅读全文
posted @ 2017-04-12 21:53 TTTCoder 阅读(377) 评论(0) 推荐(0) 编辑
摘要: Once again, James Bond is fleeing from some evil people who want to see him dead. Fortunately, he has left a bungee rope on a nearby highway bridge wh 阅读全文
posted @ 2017-01-22 01:06 TTTCoder 阅读(386) 评论(1) 推荐(0) 编辑
摘要: Contest time again! How excited it is to see balloons floating around. But to tell you a secret, the judges' favorite time is guessing the most popula 阅读全文
posted @ 2017-01-22 00:24 TTTCoder 阅读(204) 评论(0) 推荐(0) 编辑