SRM585 div2
2013-07-28 11:48
204 查看
250: 题意:给你n个数,让你求这段数里有多少个单调递增序列
View Code
#include <iostream> #include <cstdio> #include <cstring> #include <cstdlib> #include <algorithm> #include <vector> #include <cmath> using namespace std; class TrafficCongestionDivTwo { public: long long theMinCars(int); }; long long TrafficCongestionDivTwo::theMinCars(int treeHeight) { long long ret = 0; int n = treeHeight-1; ret = (long long)pow((double)2,(double)n); while(n-2>=0) { ret += (long long)pow((double)2,(double)n-2); n = n - 2; } if(n!=0) ret++; return ret; }
View Code
相关文章推荐
- SRM 585 Div II Level Two: TrafficCongestionDivTwo
- SRM 585 Div II Level Three: EnclosingTriangleColorful
- topcoder srm 585 div1
- SRM 585 DIV1
- Topcoder SRM 585 DIV2 解题报告 //缺1000
- Topcoder SRM 585 DIV2 解题报告 //缺1000
- SRM 585 DIV 1 总结
- SRM 585 DIV1 L2
- SRM 585 DIV 1 总结
- SRM 657 DIV2
- TopCoder SRM 657 DIV 1
- TC SRM 551 div2 题解
- topcoder-srm-613-div2
- SRM 552 div2
- SRM 595 DIV1 250
- SRM 555 DIV2
- TopCoder SRM 596 Div2 第3题
- 【TopCoder】SRM159 DIV2总结
- SRM 683 div1 hard
- 【TC SRM 718 DIV 2 A】RelativeHeights