摘要: 这道题目是一道动态规划的题目,动态规划的点不在面积上,而在每个矩形可左右扩展的坐标上。找出每个矩形最左边和最右边比它高的矩形的下标,最后求面积即可;#include"stdio.h"__int64 h[100010],ans,temp;int l[100010],r[100010];int main... 阅读全文
posted @ 2015-04-08 22:52 Run_For_Love 阅读(107) 评论(0) 推荐(0) 编辑
摘要: 就是一个简单的bfs的问题,这里用队列来解决问题,有栈来输出路径。#include"iostream"#include"stdio.h"#include"algorithm"#include"queue"#include"string.h"#include"cmath"#include"stack"... 阅读全文
posted @ 2015-04-08 21:20 Run_For_Love 阅读(188) 评论(0) 推荐(0) 编辑
摘要: 这个方法既节约了空间又节约了时间:#include"iostream"#include"queue"#include"string.h"#include"stdio.h"#include"cmath"using namespace std;int main(){ int i,j,s,t; ... 阅读全文
posted @ 2015-04-08 20:54 Run_For_Love 阅读(162) 评论(0) 推荐(0) 编辑
该文被密码保护。 阅读全文
posted @ 2015-04-08 20:17 Run_For_Love 阅读(4) 评论(0) 推荐(0) 编辑
摘要: #include#include int n=0; float a0=200,b0=200,a1=400,b1=200,a2=400,b2=400,a3=200,b3=400; int winWidth=600,winHeight=500;void Initial(void) { glC... 阅读全文
posted @ 2015-04-08 19:52 Run_For_Love 阅读(1870) 评论(0) 推荐(0) 编辑