摘要:
Now, this article is for hdu dp problems! Come on !hdu 2391 Filthy Rich Problem link adress:http://acm.hdu.edu.cn/showproblem.php?pid=2391This problem is silimar to one of the problem in the province contest,so cleared it successfully!In a world, it's a good problem!View Code 1 #include<iostr 阅读全文
摘要:
hdu 2425 Hiking Trip Problem link adress:http://acm.hdu.edu.cn/showproblem.php?pid=2425A simple bfs problem!Notice: If " There is a blank line after each test case." appeared in the INPUT format, we needn't output one blank more after each test case;View Code 1 #include<iostream> 阅读全文
摘要:
Problem link adress:http://acm.hdu.edu.cn/showproblem.php?pid=1241These days I have encountered some problems when I was doing the searching problems;May those problem need to use the DFS algorithm! So I started to learning the DFS:Lots of friends saysthis probelm is a simple DFS problem, so I have 阅读全文
摘要:
A. Theatre Squaretime limit per test2 secondsmemory limit per test64 megabytesinputstandard inputoutputstandard outputTheatre Square in the capital city of Berland has a rectangular shape with the size n × m meters. On the occasion of the city's anniversary, a decision was taken to pave the 阅读全文
摘要:
07年 Excel排序 http://acm.hdu.edu.cn/showproblem.php?pid=1862想放松下,就来做做浙大的复试题,考的都是蛮基础的,可是各种陷阱有没有,接着就连着wa了N次,被虐有木有?这题完全基本函数的应用,需熟悉sort、strcmp等函数和结构体,就ok了。可是一定要看清啊! 当若干学生具有相同姓名或者相同成绩时,则按他们的学号递增排序。还有按姓名的非递减序列排序,不是需要比个姓名的首个字符就可以的。View Code 1 #include<iostream> 2 #include<iomanip> 3 #include<a 阅读全文
摘要:
第三届:C:网络的可靠性 http://acm.nyist.edu.cn/JudgeOnline/problem.php?pid=170这题虽然WA了几次,但还是很高兴的毕竟是完全是自己开发的。‘嘎嘎’这题感觉比较实在,接近实际问题不错。做的时候分析一些实例,然后得出结论就OK了。Key: 分析几个问题后,会发现当一个基站的连接的光纤数为三时,就要注意这个基站了,总的来说这个规律不算难找。View Code 1 2 #include<iostream> 3 #include<cstring> 4 #include<cstdio> 5 using namesp 阅读全文
摘要:
problem link adress:http://acm.hdu.edu.cn/showproblem.php?pid=1878欧拉回路的判定:并查集(Disjoint set)去年暑假学习的,唉我这个败家子到现在忘得差不多了,看以前的blog才恢复的功力。。。。。。。囧,欧拉回路的判定,还是参考别人的思路,好吧!。。。。。。。。。。判定条件:1 每个节点数必须是22 判断是否构成了回路,可用并查集来判断,也就是所有点在一个集合里Run IDSubmit TimeJudge StatusPro.IDExe.TimeExe.MemoryCode Len.Language76805092013 阅读全文
摘要:
Problem link adress:http://acm.hdu.edu.cn/showproblem.php?pid=2645//*****analysis*****//The meaning of the problem is simple.In the map consist of '0' and '1',find the nearest '1' for every '0'.Clearly, we should use bfs work out every nearest station.Is it brute forc 阅读全文
摘要:
Problem Link adress:http://acm.hdu.edu.cn/showproblem.php?pid=1171Problem analysis:本题可以转换为多重背包问题。DP算法的最大特点就是计算最优解。题目大意:计算机学院要分成计算机学院和软件学院,即这两个新的学院要“分家”,要求尽可能的公平,即两家学院分的的财产尽可能的接近,如果实在无法保证相等的话,计算机学院分的的财产不能少于软件学院的。可以以财产的总和的一半为背包,求的背包最大值。因为每件物品可以有很多件,所以本题为多重背包问题,可以把多重背包转化为01背包来解决。#include<iostream> 阅读全文
摘要:
B. Taxitime limit per test3 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputAfter the lessons n groups of schoolchildren went outside and decided to visit Polycarpus to celebrate his birthday. We know that the i-th group consists of si friends (1 ≤ si ≤ 4), and they 阅读全文
摘要:
B. Internet Addresstime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputVasya is an active Internet user. One day he came across an Internet resource he liked, so he wrote its address in the notebook. We know that the address of the written resource h 阅读全文
摘要:
We all know that FatMouse doesn't speak English. But now he has to be prepared since our nation will join WTO soon. Thanks to Turing we have computers to help him.Input SpecificationInput consists of up to 100,005 dictionary entries, followed by a blank line, followed by a message of up to 100,0 阅读全文
摘要:
1查找 #####2 记a,b,c,d为距中心点的距离3 如果a=b=c=d,在判断组成的cross的#号的上下左右没有#号View Code 1 #include<iostream> 2 #include<string> 3 #include<stdio.h> 4 using namespace std; 5 int n; 6 char map[60][60]; 7 int judge(int x,int y) 8 { 9 int a,b,c,d; 10 int j; 11 a=b=c=d=0; 12 for(j=y-1;j>=1;j--)... 阅读全文
摘要:
http://acm.hdu.edu.cn/showproblem.php?pid=3123题目给出的n很大,很明显如果n很大时,是不用处理到n的,所以其中必有蹊跷!当n大于m时 ,n的阶乘中必定包含因数m,所以取余后必定为0;这是本体的关键。View Code 1 #include<stdio.h> 2 #include<string.h> 3 int main() 4 { 5 __int64 ans,sum,temp,max; 6 char str[150]; 7 int t,m,len; 8 int i; 9 scanf("%d",&t 阅读全文