2011 Asia Fuzhou Regional Contest】的更多相关文章

Xiangqi http://acm.hdu.edu.cn/showproblem.php?pid=4121 模拟,用高内聚低耦合的思想来写模拟题还是很好的,提高了函数的可重用性,程序的可读性,正确性,总而言之,写函数麻烦,总比debug麻烦来的好. #include<cstdio> ; struct point{ int x,y; }p[M]; char has[M][M],op[M]; bool vis[M][M]; ,,,}; ,,-,}; bool insidemap(const po…
Description Aliens on planet Pandora also write computer programs like us. Their programs only consist of capital letters (‘A’ to ‘Z’) which they learned from the Earth. On planet Pandora, hackers make computer virus, so they also have anti-virus sof…
A hard Aoshu Problem http://acm.hdu.edu.cn/showproblem.php?pid=3699 用深搜写排列,除法要注意,还有不能有前导零.当然可以5个for,但是如果有很多个,dfs还是好的. #include<cstdio> #include<cstring> #include<iostream> #include<map> #define mt(a,b) memset(a,b,sizeof(a)) using n…
同样是看别人题解才明白的 题目大意—— 话说秦始皇统一六国之后,打算修路.他要用n-1条路,将n个城市连接起来,并且使这n-1条路的距离之和最短.最小生成树是不是?不对,还有呢.接着,一个自称徐福的游方道士突然出现,他说他可以不消耗任何人力财力,使用法术凭空造一条路,路的长度无所谓,但是只能造一条.那么问题来了,徐福希望将两座人口数最多的城市连接起来,而秦始皇希望将最长的路修好.最后折中了一下, 将A/B最大的一条路用法术修出来.其中A是两座城市的人口和,B是除了用法术修的路以外,其它需要修建的…
Problem Description Conflicts are everywhere in the world, from the young to the elderly, from families to countries. Conflicts cause quarrels, fights or even wars. How wonderful the world will be if all conflicts can be eliminated.Edward contributes…
Description Plain of despair was once an ancient battlefield where those brave spirits had rested in peace for thousands of years. Actually no one dare step into this sacred land until the rumor that “there is a huge gold mine underneath the plain” s…
Description     A new Semester is coming and students are troubling for selecting courses. Students select their course on the web course system. There are n courses, the ith course is available during the time interval (Ai,Bi). That means, if you wa…
Description Math Olympiad is called “Aoshu” in China. Aoshu is very popular in elementary schools. Nowadays, Aoshu is getting more and more difficult. Here is a classic Aoshu problem: ABBDE __ ABCCC = BDBDEIn the equation above, a letter stands for a…
Description “Farm Game” is one of the most popular games in online community. In the community each player has a virtual farm. The farmer can decide to plant some kinds of crops like wheat or paddy, and buy the corresponding crop seeds. After they gr…
题意:按要求输出.第一列是表示第几行.每行仅仅能有16个字节的字母,第二列是16进制的ASCII码.第三列大写和小写转换 思路:纯模拟,注意字母的十六进制是2位 #include <iostream> #include <cstdio> #include <cstring> #include <algorithm> using namespace std; const int MAXN = 5000; char str[MAXN]; int main() {…