2012年5月25日

POJ 1003 Hangover

摘要: POJ 1003 Hangover 水题//POJ 1003#include <iostream>using namespace std;float l[1001];int main(){ float f; l[0] = 0; for (int i = 1; i <= 1000; i++) l[i] = l[i-1]+1.0/(i+1); while (cin>>f, f!=0.00) { for (int i = 1; i <= 1000; i++) if (l[i] > f) { ... 阅读全文

posted @ 2012-05-25 11:44 澄哥 阅读(314) 评论(0) 推荐(0)

POJ 1002 487-3279 空间换时间

摘要: //空间换时间 POJ 1002 487-3279#include <iostream>#include <cstring>#include <cstdlib>#include <stdio.h>using namespace std;int t[10000000];char change(char c){ if (c < 'Q') return (c-'A')/3+'2'; else return (c-'A'-1)/3+'2';}void add(char* 阅读全文

posted @ 2012-05-25 11:33 澄哥 阅读(196) 评论(0) 推荐(0)

2012年5月24日

POJ 1001 Exponentiation 高精浮点乘方

摘要: //POJ 1001 Exponentiation (百炼叫test)高精浮点乘方//by 澄哥#include <iostream>#include <cstring>#define MAX 200using namespace std;char* cut_zero(char *res){ int headZero; int len = strlen(res); for (headZero = 0; headZero < len-1; headZero++) if (res[headZero]!='0') break; if(hea... 阅读全文

posted @ 2012-05-24 15:03 澄哥 阅读(615) 评论(0) 推荐(0)

POJ 1000 A+B Promble 巨水

摘要: POJ 1000 A+B Promble 巨水#include <iostream>using namespace std;int main(void){ int a,b; cin >> a >> b; cout << a+b << endl; return 0;} 阅读全文

posted @ 2012-05-24 14:49 澄哥 阅读(175) 评论(0) 推荐(0)

2011年11月5日

POJ 1080 Human Gene Functions

摘要: Time Limit: 1000MSMemory Limit: 10000KTotal Submissions: 12460Accepted: 6899DescriptionIt is well known that a human gene can be considered as a sequence, consisting of four nucleotides, which are simply denoted by four letters, A, C, G, and T. Biologists have been interested in identifying human ge 阅读全文

posted @ 2011-11-05 22:53 澄哥 阅读(214) 评论(0) 推荐(0)

[转载]通过金矿模型介绍动态规划

摘要: 原文地址:http://www.cnblogs.com/sdjl/articles/1274312.html感谢原文作者! 对于动态规划,每个刚接触的人都需要一段时间来理解,特别是第一次接触的时候总是想不通为什么这种方法可行,这篇文章就是为了帮助大家理解动态规划,并通过讲解基本的01背包问题来引导读者如何去思考动态规划。本文力求通俗易懂,无异性,不让读者感到迷惑,引导读者去思考,所以如果你在阅读中发现有不通顺的地方,让你产生错误理解的地方,让你难得读懂的地方,请跟贴指出,谢谢!----第一节----初识动态规划-------- 经典的01背包问题是这样的: 有一个包和n个物品,包的容量为m,每 阅读全文

posted @ 2011-11-05 21:07 澄哥 阅读(260) 评论(0) 推荐(1)

导航