
ACM学习
coderguang
个人主页:www.royalchen.com
展开
-
HDU 1002 A + B Problem II C++解法
#include #include //不能写成string,否则strlen未定义 using namespace std; string sum(string &s1,string &s2) { if(s1==""&&s2=="") return "0"; if(s1=="") return s2; if(s2=="") return s1; stri原创 2014-05-04 15:53:47 · 2703 阅读 · 0 评论 -
HDU 1003 MAX SUM
其实用DP思想这个很容易解决, 不过对于DP原创 2014-05-09 12:18:48 · 987 阅读 · 0 评论 -
HODJ 1001 Sum Problem C++解法
1001#include using namespace std; long int Sum(int a) { long int sum=0; for(int i=1;i<=a;i++) sum+=i; return sum; } int main() { int a,b; while(cin>>a) {原创 2014-04-11 13:05:56 · 1571 阅读 · 0 评论 -
HDOJ 1000 A + B Problem C++解法
Problem Description Calculate A + B. Input Each line will contain two integers A and B. Process to end of file. Output For each case, output A + B in one line.原创 2014-04-11 00:06:11 · 2039 阅读 · 0 评论 -
HDU之旅
现在开始逐渐地学一点关于ACM的东西。 ma原创 2014-04-10 23:59:37 · 1019 阅读 · 0 评论 -
Hdu 1005 Number Sequence
//一开始用递归,果断RTL //后来发现其实这是一个结果循环的数列。 //因为f(n-1)的取值只可能是0--7,f(n-2)也是一样, //因此f(n)一共有7*7=49种可能,因此,这个循环队列的最大长度为49 //并且肯定是从1,1开始的。因为f(0)=1,f(1)=1; #include using namespace std; int main() { int f[50];//因为原创 2014-05-17 21:54:42 · 1037 阅读 · 0 评论 -
Hdu 1004 Let the Balloon Rise
好几天没来写这道传说中的水题,哈哈,虽然一看就会,不过总在农邪恶原创 2014-05-13 09:32:55 · 782 阅读 · 0 评论