2017年5月24日

Editing a Book UVA - 11212 IDA*

摘要: You have n equal-length paragraphs numbered 1 to n . Now you want to arrange them in the order of 1 ; 2 ;:::;n . With the help of a clipboard, you can 阅读全文

posted @ 2017-05-24 16:27 hnust_accqx 阅读(253) 评论(0) 推荐(0) 编辑

埃及分数问题 迭代加深搜索

摘要: /** 题目:埃及分数问题 链接:lrj算法竞赛入门经典P206 题意:在古埃及,人们使用单位分数的和(即 1/a, a是自然数)表示一切有理数。例如,2/3 = 1/2+1/6; 但不允许:2/3 = 1/3 + 1/3; 因为在加数中不允许有相同的。 对一个分数a/b, 表示方法有很多种,其中加数少的比加数多的好,如果加数个数相同,则最小的分数越大越好。 eg: 19/45=1/3 + 1/... 阅读全文

posted @ 2017-05-24 14:10 hnust_accqx 阅读(405) 评论(0) 推荐(0) 编辑

STL next_permutation(a,a+n) 生成一个序列的全排列。满足可重集。

摘要: /** 题目: 链接: 题意: 思路: */ #include #include #include #include #include #include using namespace std; typedef long long LL; const int mod=1e9+7; const int maxn=1e2+5; const double eps = 1e-12; in... 阅读全文

posted @ 2017-05-24 12:36 hnust_accqx 阅读(454) 评论(0) 推荐(0) 编辑

Play on Words UVA - 10129 欧拉路径

摘要: 关于欧拉回路和欧拉路径 定义:欧拉回路:每条边恰好只走一次,并能回到出发点的路径欧拉路径:经过每一条边一次,但是不要求回到起始点 ①首先看欧拉回路存在性的判定: 一、无向图每个顶点的度数都是偶数,则存在欧拉回路。 二、有向图(所有边都是单向的)每个节顶点的入度都等于出度,则存在欧拉回路。 ②.欧拉路 阅读全文

posted @ 2017-05-24 11:16 hnust_accqx 阅读(161) 评论(0) 推荐(0) 编辑

Ordering Tasks UVA - 10305 图的拓扑排序

摘要: John has n tasks to do. Unfortunately, the tasks are not independent and the execution of one task is only possible if other tasks have already been e 阅读全文

posted @ 2017-05-24 10:21 hnust_accqx 阅读(184) 评论(0) 推荐(0) 编辑

导航