随笔分类 - 编程竞赛
OJ上的编程题和提交通过的代码
摘要:题目链接: http://acm.hdu.edu.cn/showproblem.php?pid=1232 Problem Description 某省调查城镇交通状况,得到现有城镇道路统计表,表中列出了每条道路直接连通的城镇。省政府“畅通工程”的目标是使全省任何两个城镇间都可以实现交通(但不一定有直
阅读全文
摘要:题目: You are given a 2D board where in some cells there are gold. You want to fill the board with 2 x 1 dominoes such that all gold are covered. You ma
阅读全文
摘要:题目: You run a marriage media. You take some profiles for men and women, and your task is to arrange as much marriages as you can. But after reading th
阅读全文
摘要:题目链接: http://poj.org/problem?id=3041 Description Bessie wants to navigate her spaceship through a dangerous asteroid field in the shape of an N x N gr
阅读全文
摘要:题目链接: http://poj.org/problem?id=1422 Description Consider a town where all the streets are one-way and each street leads from one intersection to anot
阅读全文
摘要:题目链接: acm.hdu.edu.cn/showproblem.php?pid=1082 题意描述: 给出课程数和学生数,以及每个课有哪些学生上过,问这N个学生能否组成一个委员会,该委员会中每人代表一种课,能否表示完P门课。 解题思路: 二分图最佳完备匹配,也即二分图最大匹配数。 AC代码: #i
阅读全文
摘要:题目链接: http://acm.hdu.edu.cn/showproblem.php?pid=1150 题意描述: A和B两种机器有几种工作模式,而每种工作能在两种机器的不同模式下加工,每换一种工作模式需要重启一次,现在给出每种工作在每种机器下的工作模式,问最少需要重启多少次加工完工作。 解题思路
阅读全文
摘要:题目链接: http://acm.hdu.edu.cn/showproblem.php?pid=2119 解题思路: 处理数据,使用公式最小点覆盖数=最大匹配数,使用匈牙利算法求二分图最大匹配即可。 AC代码: 1 #include<stdio.h> 2 #include<string.h> 3 i
阅读全文
摘要:题目链接: http://acm.hdu.edu.cn/showproblem.php?pid=1068 Problem Description the second year of the university somebody started a study on the romantic re
阅读全文
摘要:题目链接: http://acm.hdu.edu.cn/showproblem.php?pid=2063 解题思路: 二分图最大匹配模板题。 AC代码: 1 #include<stdio.h> 2 int e[1010][1010],match[1010],book[1010],z; 3 int d
阅读全文
摘要:Description The French author Georges Perec (1936–1982) once wrote a book, La disparition, without the letter 'e'. He was a member of the Oulipo group
阅读全文
摘要:题目: Given two sequences of numbers : a[1], a[2], ...... , a[N], and b[1], b[2], ...... , b[M] (1 <= M <= 10000, 1 <= N <= 1000000). Your task is to fi
阅读全文
摘要:题目: It's time for music! A lot of popular musicians are invited to join us in the music festival. Each of them will play one of their representative s
阅读全文
摘要:题目: The little cat is so famous, that many couples tramp over hill and dale to Byteland, and asked the little cat to give names to their newly-born ba
阅读全文
摘要:题目: CC always becomes very depressed at the end of this month, he has checked his credit card yesterday, without any surprise, there are only 99.9 yua
阅读全文
摘要:题目: For each prefix of a given string S with N characters (each character has an ASCII code between 97 and 126, inclusive), we want to know whether th
阅读全文
摘要:题目: Generally speaking, there are a lot of problems about strings processing. Now you encounter another such problem. If you get two strings, such as
阅读全文
摘要:题目: Homer: Marge, I just figured out a way to discover some of the talents we weren’t aware we had. Marge: Yeah, what is it? Homer: Take me for exampl
阅读全文
摘要:题目: 人随着岁数的增长是越大越聪明还是越大越笨,这是一个值得全世界科学家思考的问题,同样的问题Eddy也一直在思考,因为他在很小的时候就知道亲和串如何判断了,但是发现,现在长大了却不知道怎么去判断亲和串了,于是他只好又再一次来请教聪明且乐于助人的你来解决这个问题。 亲和串的定义是这样的:给定两个字
阅读全文
摘要:题目链接: http://poj.org/problem?id=1797 Background Hugo Heavy is happy. After the breakdown of the Cargolifter project he can now expand business. But he
阅读全文

浙公网安备 33010602011771号