随笔分类 -  基础算法

摘要:题目链接:http://acm.nyist.net/JudgeOnline/problem.php?pid=252 简单水题 代码: #include<stdio.h> #include<string.h> int main(){ int n,t; int num[120]; memset(num, 阅读全文
posted @ 2014-12-16 18:48 wojiaohuangyu 阅读(3) 评论(0) 推荐(0) 编辑
摘要:题目链接:http://acm.nyist.net/JudgeOnline/problem.php?pid=219 #include<stdio.h> #include<string.h> int main(){ int year,month,day; while(~scanf("%d %d %d" 阅读全文
posted @ 2014-12-14 22:39 wojiaohuangyu 阅读(4) 评论(0) 推荐(0) 编辑
摘要:题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1874 弗洛伊德最短路径问题 代码: #include<stdio.h> #include<string.h> #define inf 0x3f3f3f3f #include<algorithm> usi 阅读全文
posted @ 2014-12-13 22:28 wojiaohuangyu 阅读(2) 评论(0) 推荐(0) 编辑
摘要:题目链接:http://acm.nyist.net/JudgeOnline/problem.php?pid=27 代码: <pre name="code" class="cpp">#include<stdio.h> #include<string.h> #include<stdlib.h> int 阅读全文
posted @ 2014-12-12 19:00 wojiaohuangyu 阅读(4) 评论(0) 推荐(0) 编辑
摘要:题目链接: 搜索题,有两种情况,两种有一种不考虑的话就会WA.... 代码: #include<stdio.h> #include<string.h> #define INF 999999999//定义一个最大的数 #include<algorithm> using namespace std; i 阅读全文
posted @ 2014-12-09 21:09 wojiaohuangyu 阅读(4) 评论(0) 推荐(0) 编辑
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=1015 #include<stdio.h> #include<string.h> #include<algorithm> using namespace std; char zifu[2000],str[20],s 阅读全文
posted @ 2014-12-08 22:47 wojiaohuangyu 阅读(5) 评论(0) 推荐(0) 编辑
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=254 0-1背包问题 代码: #include<stdio.h> #include<string.h> #include<algorithm> using namespace std; int cmp(int a, 阅读全文
posted @ 2014-11-29 21:55 wojiaohuangyu 阅读(4) 评论(0) 推荐(0) 编辑
摘要:正好我现在在玩数独这个游戏,看到这个问题我就来了兴趣,完成着这个问题,妈妈再也不用担心我玩数独游戏啦~~ 题目链接: http://acm.nyist.net/JudgeOnline/problem.php?pid=722 #include<stdio.h> int map[9][9]; int f 阅读全文
posted @ 2014-11-29 21:27 wojiaohuangyu 阅读(3) 评论(0) 推荐(0) 编辑
摘要:题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1010 做这道题目的时候需要注意剪枝,如果没有剪枝的话,就会超时 注意奇偶剪枝 代码:】 #include<stdio.h> #include<string.h> #include<stdlib.h> c 阅读全文
posted @ 2014-11-29 11:00 wojiaohuangyu 阅读(2) 评论(0) 推荐(0) 编辑
摘要:题目链接:http://acm.nyist.net/JudgeOnline/problem.php?pid=58 比较简单的搜索题目, 代码: #include<stdio.h> #include<string.h> int map[9][9]={{1,1,1,1,1,1,1,1,1},{1,0,0 阅读全文
posted @ 2014-11-29 10:51 wojiaohuangyu 阅读(3) 评论(0) 推荐(0) 编辑
摘要:题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2152 母函数: 代码: #include<stdio.h> #include<string.h> int main(){ int c1[120],c2[120],min[120],max[120]; i 阅读全文
posted @ 2014-11-26 22:37 wojiaohuangyu 阅读(7) 评论(0) 推荐(0) 编辑
摘要:简单的背包题 ;好无奈,我又没做出来在考试的时候 代码: #include<stdio.h> #include<string.h> #include<algorithm> using namespace std; double dp[60],money[60]; double total; int 阅读全文
posted @ 2014-11-26 13:18 wojiaohuangyu 阅读(4) 评论(0) 推荐(0) 编辑
摘要:题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1241 简单的深搜,但是我花了两个小时都没没有做出来,说出来都是泪啊 代码: #include<stdio.h> #include<string.h> #include<algorithm> using 阅读全文
posted @ 2014-11-25 11:39 wojiaohuangyu 阅读(4) 评论(0) 推荐(0) 编辑
摘要:Problem Description Once upon a time, in the Kingdom of Loowater, a minor nuisance turned into a major problem. The shores of Rellau Creek in central 阅读全文
posted @ 2014-11-22 21:39 wojiaohuangyu 阅读(11) 评论(0) 推荐(0) 编辑
摘要:Problem Description A ring is compose of n circles as shown in diagram. Put natural number 1, 2, ..., n into each circle separately, and the sum of nu 阅读全文
posted @ 2014-11-22 10:41 wojiaohuangyu 阅读(2) 评论(0) 推荐(0) 编辑
摘要:Problem Description Given a sequence a[1],a[2],a[3]......a[n], your job is to calculate the max sum of a sub-sequence. For example, given (6,-1,5,4,-7 阅读全文
posted @ 2014-11-21 21:05 wojiaohuangyu 阅读(7) 评论(0) 推荐(0) 编辑
摘要:描述 Tom has fallen in love with Mary. Now Tom wants to show his love and write a number on the fence opposite to Mary’s house. Tom thinks that the larg 阅读全文
posted @ 2014-11-20 15:48 wojiaohuangyu 阅读(4) 评论(0) 推荐(0) 编辑
摘要:题目链接:http://acm.nyist.net/JudgeOnline/problem.php?pid=220 贪心算法 主要是除以二的那一点不好想,就是两排房子并行的 http://acm.nyist.net/JudgeOnline/problem.php?pid=220 #include<s 阅读全文
posted @ 2014-11-20 13:57 wojiaohuangyu 阅读(2) 评论(0) 推荐(0) 编辑
摘要:描述 Here is a famous story in Chinese history. "That was about 2300 years ago. General Tian Ji was a high official in the country Qi. He likes to play 阅读全文
posted @ 2014-11-18 22:29 wojiaohuangyu 阅读(10) 评论(0) 推荐(0) 编辑
摘要:描述 Assume the coasting is an infinite straight line. Land is in one side of coasting, sea in the other. Each small island is a point locating in the s 阅读全文
posted @ 2014-11-17 21:47 wojiaohuangyu 阅读(6) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示