
普及知识竞赛类
源Aron
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
数据结构 算法2.17
#include"stdio.h" #include"string.h" #define MAX 1000 /* 集合n与集合m中共有的元素需要删除形成新的集合m 测试项: 6 4 c b e g f d a b n f */ struct{ char date; int cur; }Space[MAX]; //连续的静态链表 void Init(){ for(int i=0;i<MAX-1;++i){ Space[i].cur=i+1; } } //初始化静态链表的空间,可以说这翻译 2020-11-14 20:15:33 · 360 阅读 · 0 评论 -
简单算法 floyd最短路径
题目: 在每年的校赛里,所有进入决赛的同学都会获得一件很漂亮的t-shirt。但是每当我们的工作人员把上百件的衣服从商店运回到赛场的时候,却是非常累的!所以现在他们想要寻找最短的从商店到赛场的路线,你可以帮助他们吗? Input 输入包括多组数据。每组数据第一行是两个整数N、M(N<=100,M<=10000),N表示成都的大街上有几个路口,标号为1的路口是商店所在地,标号为N的路口是...翻译 2019-08-19 09:37:43 · 168 阅读 · 0 评论 -
简单算法 集合的巧用
题目: There are n Imperial stormtroopers on the field. The battle field is a plane with Cartesian coordinate system. Each stormtrooper is associated with his coordinates (x, y) on this plane. Han Solo h...翻译 2019-08-07 18:53:00 · 186 阅读 · 0 评论 -
简单算法 并查集的环判断
int find(int x) { int r=x; while(pre[r]!=r) { r=pre[r]; } } void join(int x,int y) { int a=find(x); int b=find(y); if(a!=b) pre[a]=b; else if(a==b)//这里是重点 sign=-1;//用来标记已经是环了 } 为什么根一样就是环...翻译 2019-08-14 17:06:35 · 667 阅读 · 0 评论