摘要: 内容 并查集 大佬博客:讲的很生动。 邻接表 刚开始学邻接表时,看的是网上的数组模拟链表版本,很久才看懂是什么意思。后面发现白书也有领接表,发现更为简单(早知道看白书了😭)。所以这里我就讲邻接表的简单实现。 vector: 这里的vector是c++ stl的一个容器,可以参见这里。 二维数组存图 阅读全文
posted @ 2019-03-10 17:44 MrEdge 阅读(153) 评论(0) 推荐(0) 编辑
摘要: 题面: 传送门 畅通工程 Input file: standard input Output file: standard output Time limit: 2 second Memory limit: 256 megabytes 某省调查城镇交通状况,得到现有城镇道路统计表,表中列出了每条道路直接 阅读全文
posted @ 2019-03-10 17:18 MrEdge 阅读(141) 评论(0) 推荐(0) 编辑
摘要: 题面: 传送门 瞬间移动 Input file: standard input Output file: standard output Time limit: 2 second Memory limit: 256 megabytes 有一个无限大的矩形,初始时你在左上角(即第一行第一列),每次你都可以 阅读全文
posted @ 2019-03-10 10:33 MrEdge 阅读(160) 评论(0) 推荐(0) 编辑
摘要: 内容 同余定理的应用 最简单的应用: (a+b)%p == (a%p + b%p) % p (a-b)%p == (a%p - b%p) % p a*b%p == ( (a%p)*(b%p) ) % p 其实就是加减乘的运算都可以边运算边取模,这和运算结果出来后再取模是一样的。比如:(a+b*c-d 阅读全文
posted @ 2019-03-09 22:50 MrEdge 阅读(417) 评论(0) 推荐(0) 编辑
摘要: 题面: 传送门 Co-prime Input file: standard input Output file: standard output Time limit: 1 second Memory limit: 256 megabytes Given a number N, you are aske 阅读全文
posted @ 2019-03-08 21:21 MrEdge 阅读(141) 评论(0) 推荐(0) 编辑
摘要: 题面: 传送门 Piggy-Bank Input file: standard input Output file: standard output Time limit: 1 second Memory limit: 256 megabytes Before ACM can do anything, 阅读全文
posted @ 2019-03-07 20:03 MrEdge 阅读(235) 评论(0) 推荐(0) 编辑
摘要: 题面: 传送门 Bone Collector Input file: standard input Output file: standard output Time limit: 1 second Memory limit: 256 megabytes Many years ago , in Tedd 阅读全文
posted @ 2019-03-03 20:16 MrEdge 阅读(221) 评论(0) 推荐(0) 编辑
摘要: 题面: 传送门 题目描述: 要求用十字星星来画题目给出的“星”图。如果不能用十字星星来画“星”图,输出-1;如果能,则输出要在图的哪个位置画相应大小的十字星图。 题目分析: 这道题纯属模拟题,按照要求画就好了。我的画法:根据题目的“星”图用十字星图在另一个二维数组画“星”图。拿第一个样例来说:当遍历 阅读全文
posted @ 2019-03-01 22:58 MrEdge 阅读(389) 评论(0) 推荐(0) 编辑
摘要: 题面: 传送门 B. Santa Claus and Keyboard Check Input file: standard input Output file: standard output Time limit: 2 second Memory limit: 256 megabytes Santa 阅读全文
posted @ 2019-03-01 18:53 MrEdge 阅读(219) 评论(0) 推荐(0) 编辑
摘要: 题面: 传送门 C.New Year Book Reading Input file: standard input Output file: standard output Time limit: 2 second Memory limit: 256 megabytes New Year is com 阅读全文
posted @ 2019-02-27 14:08 MrEdge 阅读(235) 评论(0) 推荐(0) 编辑