I'm Telling the Truth(二分图)】的更多相关文章

.I'm Telling the Truth Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 1740 Accepted Submission(s): 871 Problem Description After this year's college-entrance exam, the teacher did a survey in his…
I - I'm Telling the Truth Time Limit:3000MS     Memory Limit:0KB     64bit IO Format:%lld & %llu Submit Status Practice UVALive 5033 Description After this year's college-entrance exam, the teacher did a survey in his class on students' score. There…
裸的二分图匹配.需要输出方案. #include<cstdio> #include<cstring> #include<vector> #include<algorithm> #include<iostream> using namespace std; #define M 100005 #define N 65 bool vis[M]; vector<int> g[N]; int now[M]; int n,m; int dfs(i…
http://acm.hdu.edu.cn/showproblem.php?pid=3729 I'm Telling the Truth Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1427    Accepted Submission(s): 719 Problem Description After this year’s col…
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=3729 I'm Telling the Truth Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1700    Accepted Submission(s): 853 Problem Description After this year’…
题目链接: http://acm.hdu.edu.cn/showproblem.php?pid=3729 题目意思: 有n个学生,老师询问每个学生的排名,每个学生都告诉了一个排名区间,求可能的最多的学生说实话的个数,以及那些学生的标号,有相同的则输出字典序最大的. 解题思路: 这题贪心只能求出个数,但要求字典序最大,则须用二分匹配. 将学生标号放到一个集合A里,另外一个集合B放排名.对于每个学生可能在的排名点,建一条边.从学生标号大的开始匹配. 代码 #include<iostream> #i…
题目大概说n个学生,都各自有一个互不相同的成绩排名,他们各自说了他们成绩排名所在区间,问最多有几个学生没说谎以及字典序最大的没说谎的学生序列. 学生作为一个X部的点,排名作为Y部的点,学生与其成绩排名的区间的各个点之间连边,这其实就是求这个二分图的最大匹配. 排名最多10W,边容量为1,不离散化跑网络流(Dinic?!)好像应该也是没问题的..不过还是学习了别人的离散化,自己写的错了.. 这题关键是要字典序最大,不会..又学习了别人的写法——按字典序枚举学生,加相关边,依次跑最大流.好有道理!…
职务地址:HDU 3729 二分图最大匹配+按字典序输出结果. 仅仅要从数字大的開始匹配就能够保证字典序最大了.群里有人问. . 就顺手写了这题. . 代码例如以下: #include <iostream> #include <cstdio> #include <cstring> #include <algorithm> using namespace std; int vis[110000], head[110000], cnt, link[110000]…
一个点集是学生,一个点集是排名.然后通过学生的排名范围连线,求此二分图的最大匹配. 本题还要求是最大字典序输出,那么由贪心可得,你让标号从大到小找增广边就行了. #include <cstdlib> #include <cstdio> #include <cmath> #include <cstring> #include <algorithm> #include <fstream> #include <iostream>…
题意:给定 n 个人成绩排名区间,然后问你最多有多少人成绩是真实的. 析:真是没想到二分匹配,....后来看到,一下子就明白了,原来是水题,二分匹配,只要把每个人和他对应的区间连起来就好,跑一次二分匹配,裸的. 代码如下: #pragma comment(linker, "/STACK:1024000000,1024000000") #include <cstdio> #include <string> #include <cstdlib> #inc…