symons

___________每一天都是幸福的!!

  博客园  ::  :: 新随笔  ::  :: 订阅 订阅  :: 管理

2012年11月19日

摘要: Descriptionhero为了能顺利娶princess ,花了血本,买了个房子,现在决定装修。房子的长度为n米,宽度为3米,现在我们有2种地砖,规格分别是1米×1米,2米×2米,如果要为该教室铺设地砖,请问有几种铺设方式呢 1 /* 2 *这道题我着实卡了挺长时间的,今天翻出来一看最开始以为是DP,原来不是DP, 3 *是组合数学里面的问题,然后我害怕超范围特意写了个c[m][n]=c[m][n-1]+c[m-1][n-1] 4 *递推。 5 *然后还是没过,因为我开始写的是res+=c[i][n-i]*2; 然后我怎么想都对。 6 *后来我发现这么搞是不对的,应该是* 阅读全文
posted @ 2012-11-19 17:20 symons 阅读(312) 评论(0) 推荐(0)

摘要: 之前看没头绪,现在看太水了。水过。 1 #include <iostream> 2 #include <map> 3 #include <string> 4 using namespace std; 5 bool judge(string a,string b) 6 { 7 if(a<b) return 0; 8 else return 1; 9 }10 int main()11 {12 map<string,int>haha;13 map<string,int>::iterator it;14 string abc,tt,ma 阅读全文
posted @ 2012-11-19 13:40 symons 阅读(174) 评论(0) 推荐(0)