随笔分类 -  ACM

上一页 1 2 3 4 下一页

ZOJ1003 Crashing Balloon
摘要:Normal 0 7.8 磅 0 2 false false false MicrosoftInternetExplorer4 On every June 1st, the Children's Day, there... 阅读全文

posted @ 2008-09-18 12:19 Phinecos(洞庭散人) 阅读(2506) 评论(0) 推荐(0) 编辑

ZOJ1002 Fire Net(递归版)
摘要:代码: #include using namespace std; char map[4][4];// 地图 int maxNum,n; bool CanPut(int row, int col) {//测试是否可以放置碉堡到row行col列处,因为位置是从小到大前进的,因此只需要测试比待测试点小的位置 int i; //测试col列上是否有面对面的碉堡 for (i... 阅读全文

posted @ 2008-09-18 09:30 Phinecos(洞庭散人) 阅读(5072) 评论(9) 推荐(2) 编辑

ZOJ1109 Language of FatMouse
摘要:Normal 0 7.8 磅 0 2 false false false MicrosoftInternetExplorer4 We all know that FatMouse doesn't speak Engl... 阅读全文

posted @ 2008-09-17 21:57 Phinecos(洞庭散人) 阅读(750) 评论(0) 推荐(0) 编辑

HDU1022 Train Problem I
摘要:题目地址:http://acm.hdu.edu.cn/showproblem.php?pid=1022 #include #include #include #include using namespace std;string strIn,strOut;stack strTmp;//临时栈vector strInfo;int main(int argc,char* argv[]){ int... 阅读全文

posted @ 2008-01-06 15:52 Phinecos(洞庭散人) 阅读(1116) 评论(2) 推荐(0) 编辑

HDU1021 Fibonacci Again
摘要:题目地址:http://acm.hdu.edu.cn/showproblem.php?pid=1021 简单题,就是找找规律,就可以发现从2开始,每次递增4的值满足被3整除的要求 #includeusing namespace std;void doProcess(int n){//从2开始,每次递增 if (n%4==2) { cout>n) { d... 阅读全文

posted @ 2008-01-04 23:27 Phinecos(洞庭散人) 阅读(826) 评论(0) 推荐(0) 编辑

HDU1020 Encoding
摘要:题目地址:http://acm.hdu.edu.cn/showproblem.php?pid=1020 #include#include using namespace std;void doProcess(string& str){ int count,i,j; for (i=0;i1) { cout>caseNum) { fo... 阅读全文

posted @ 2008-01-04 22:56 Phinecos(洞庭散人) 阅读(833) 评论(1) 推荐(0) 编辑

HDU1019 Least Common Multiple
摘要:题目地址:http://acm.hdu.edu.cn/showproblem.php?pid=1019 用辗转相除法求最小公倍数时要注意应该用a/y*b,若用a*b/y,则可能会数据溢出。 #include#include using namespace std;int LCM(long x,long y){ long temp; long a,b; a=x; b=... 阅读全文

posted @ 2008-01-04 21:02 Phinecos(洞庭散人) 阅读(847) 评论(1) 推荐(0) 编辑

HDU1018 Big Number
摘要:题目地址:http://acm.hdu.edu.cn/showproblem.php?pid=1018 网上有求解的数学公式, #include#include using namespace std;int main(){ int caseNum,i,j,n,count; double sum; while (cin>>caseNum) { for (i=0... 阅读全文

posted @ 2008-01-04 19:44 Phinecos(洞庭散人) 阅读(779) 评论(1) 推荐(0) 编辑

HDU1017 A Mathematical Curiosity
摘要:题目地址:http://acm.hdu.edu.cn/showproblem.php?pid=1017 简单题,就是注意下输出格式就ok, #include#includeusing namespace std;int doProcess(int n,int m){ int temp,count=0; for (int a=1;a>caseNum) { for (i... 阅读全文

posted @ 2008-01-04 19:03 Phinecos(洞庭散人) 阅读(1104) 评论(0) 推荐(0) 编辑

HDU1016 Prime Ring Problem
摘要:题目地址:http://acm.hdu.edu.cn/showproblem.php?pid=1016 递归法:(简单但会超时。。。) #include #include #include using namespace std;void swap(int& a,int& b){ int tmp; tmp = a; a = b; b = tmp;}bool isPrime(... 阅读全文

posted @ 2008-01-04 17:14 Phinecos(洞庭散人) 阅读(1408) 评论(3) 推荐(0) 编辑

HDU1015 Safecracker
摘要:简单的枚举法应用 阅读全文

posted @ 2007-12-30 17:14 Phinecos(洞庭散人) 阅读(1282) 评论(1) 推荐(0) 编辑

HDU1014 Uniform Generator
摘要:产生伪随机数时给出的步长step和上限mod,判断下这两个值是否可以让产生的随机数均匀分布,所谓的均匀分布就是在mod步里能产生出0到mod-1这mod个数。 阅读全文

posted @ 2007-12-29 09:44 Phinecos(洞庭散人) 阅读(1140) 评论(0) 推荐(0) 编辑

HDU1013 Digital Roots
摘要:题目地址:http://acm.hdu.edu.cn/showproblem.php?pid=1013 #include #include using namespace std; void DigitRoot(int n) { int tmp; int sum = 0; while (n!=0) { tmp = n%10; sum += tmp; n = n/10;... 阅读全文

posted @ 2007-12-28 13:03 Phinecos(洞庭散人) 阅读(1167) 评论(1) 推荐(0) 编辑

HDU1007 Quoit Design
摘要:最接近点对问题,分治算法的应用 阅读全文

posted @ 2007-12-26 15:26 Phinecos(洞庭散人) 阅读(3153) 评论(2) 推荐(0) 编辑

HDU1012 Calculate e
摘要:使用递归和非递归两种方法进行求解 阅读全文

posted @ 2007-12-25 12:59 Phinecos(洞庭散人) 阅读(976) 评论(0) 推荐(0) 编辑

HDU1010 Tempter of the Bone
摘要:古人云:“由简入奢易,由奢入简难”,咱写代码也是一样,不求最快,但求最繁,繁得让你都不忍读完它。。。。 阅读全文

posted @ 2007-12-24 16:30 Phinecos(洞庭散人) 阅读(1506) 评论(2) 推荐(0) 编辑

HDU1009 FatMouse' Trade
摘要:简单的贪心算法 阅读全文

posted @ 2007-12-24 10:41 Phinecos(洞庭散人) 阅读(967) 评论(0) 推荐(0) 编辑

HDU1004 Let the Balloon Rise
摘要:两次遍历map容器,算法复杂度O(n) 阅读全文

posted @ 2007-12-23 14:44 Phinecos(洞庭散人) 阅读(2066) 评论(5) 推荐(0) 编辑

HDU1003 最大子序列和问题
摘要:题目地址:http://acm.hdu.edu.cn/showproblem.php?pid=1003 Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->#include #include using namespace std; in... 阅读全文

posted @ 2007-12-23 13:47 Phinecos(洞庭散人) 阅读(2386) 评论(3) 推荐(0) 编辑

HDU1002 大数相加
摘要:题目地址:http://acm.hdu.edu.cn/showproblem.php?pid=1002 #include #include using namespace std; void Add(string a,string b,char sum[],int& count) {//大数加法 int len1 = a.length();//数a的长度 int len2 = ... 阅读全文

posted @ 2007-12-22 23:10 Phinecos(洞庭散人) 阅读(1562) 评论(1) 推荐(0) 编辑

上一页 1 2 3 4 下一页

导航

统计

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