Gone Fishing Time Limit: 2000MS Memory Limit: 32768K Total Submissions: 30281 Accepted: 9124 Description John is going on a fishing trip. He has h hours available (1 <= h <= 16), and there are n lakes in the area (2 <= n <= 25) all reachab…
此书我购于去年的十一月份,也是经前人推荐购买的一本比较有用的书籍,在寒假自学此书,其简洁清晰高效的示例代码令我印象深刻,于是我打算把这本书的前四章后面的注解与习题(未给出标准解答)认真的去思索和研究,谭书亦是如此.于是有了此篇不是特别工整的博客. 1-1 average 输入三个整数,输出他们的平均值,保留三位小数. #include<stdlib.h> #include<iostream> #include<iomanip> using namespace std;…
Problem J Jin Ge Jin Qu [h]ao (If you smiled when you see the title, this problem is for you ^_^) For those who don't know KTV, see: http://en.wikipedia.org/wiki/Karaoke_box There is one very popular song called Jin Ge Jin Qu(劲歌金曲). It is a mix of 37…
Rails Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 25964 Accepted: 10199 Description There is a famous railway station in PopPush City. Country there is incredibly hilly. The station was built in last century. Unfortunately, funds w…
这道题用构造法, 就是自己依据题目想出一种可以得到解的方法, 没有什么规律可言, 只能根据题目本身来思考. 这道题的构造法比较复杂, 不知道刘汝佳是怎么想出来的, 我想的话肯定想不到. 具体思路紫书上讲得非常清楚了, 就不讲了.代码有详细注释 #include<cstdio> #include<vector> #define REP(i, a, b) for(int i = (a); i < (b); i++) using namespace std; const int M…
就是暴力枚举a, b然后和题目给的数据比较就ok了. 刘汝佳这道题的讲解有点迷,书上讲有x1和a可以算出x2, 但是很明显x2 = (a * x1 +b) 没有b怎么算x2?然后我就思考了很久,最后去看他的代码发现他的代码和他讲的是两回事 他的代码里直接是枚举a和b,不是按照书上的思路来的. 有点迷 #include<iostream> #define REP(i, a, b) for(int i = (a); i < (b); i++) using namespace std; con…
这道题看了刘汝佳的代码真的是天秀, 很值得学习. 具体看代码 #include<cstdio> #include<iostream> #include<cctype> #include<map> #define REP(i, a, b) for(int i = (a); i < (b); i++) using namespace std; const int MAXN = 51234; struct node { string s; int l, r;…