《Effective C++》第六章:继承与面向对象设计
确定你的public继承塑模出is-a关系。student is a person,所以student可以public继承自person。概念上,正方形是长方形,但是如果让square继承自rectangle呢,square需要像rectangle那样具有长和宽两个成员变量吗?如果是,每次改变正方形的宽的时候,也要改变正方形的长,这很奇怪不是...
分类:
编程语言 时间:
2015-04-22 15:19:17
阅读次数:
155
Givennnon-negative integers representing the histogram's bar height where the width of each bar is 1, find the area of largest rectangle in the histog...
分类:
其他好文 时间:
2015-04-21 22:06:27
阅读次数:
155
题目传送门 1 /* 2 题意:光线从 '*' 发射,遇到 '/' 或 '\' 进行反射,最后射到墙上,将 'x' 变成 '&' 3 模拟:仔细读题,搞清楚要做什么,就是i,j的移动,直到撞到墙,模拟一下一次AC,不要被题目吓怕了:) 4 */ 5 #include 6...
分类:
其他好文 时间:
2015-04-20 22:17:49
阅读次数:
143
简单的bfs搜索题,对每个初始的水滴依次扩展,当达到规定步数时跳出。这题还是有坑点的,对于每个初始的水滴,已经访问过的位置不再访问,但是对于不同的水滴,别的水滴已经访问过的,对于当前水滴来说可能还要访问,才能使扩展的范围最大。#include#include#include#include#incl...
分类:
其他好文 时间:
2015-04-20 20:36:08
阅读次数:
135
题目链接:http://acm.csu.edu.cn/OnlineJudge/problem.php?id=1561
题面:
1561: (More) Multiplication
Time Limit: 1 Sec Memory Limit: 128 MB
Submit: 180 Solved: 95
[Submit][Status][Web
Board]
...
分类:
其他好文 时间:
2015-04-20 09:36:29
阅读次数:
148
C - Lexicography
Time Limit:1000MS Memory Limit:131072KB 64bit IO Format:%lld
& %llu
Submit Status Practice CSU
1563
Description
An anagram of a string is any string that c...
分类:
其他好文 时间:
2015-04-20 01:52:44
阅读次数:
152
Given a 2D binary matrix filled with 0's and 1's, find the largest rectangle containing all ones and return its area.
给定一个充满0和1的矩阵,要求出范围全为1的矩阵的面积。
算法一,动态规划
此题,以每行为底,都可以转换成是一个Largest
Rec...
分类:
其他好文 时间:
2015-04-19 14:45:57
阅读次数:
115
A:点击打开链接
CSU 1561 (More)Multiplication
题意:把两个数的乘积每个位置的结果填充上去。
注意这个矩阵最大是1e8,所以不能开数组。
模拟题
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
usi...
分类:
其他好文 时间:
2015-04-19 13:16:53
阅读次数:
169
Android UI设计中经常用到的layer-list, shape在美化控件中的作用是至关重要的。 shape 作用:在xml中定义几何形状 属性: Android:shape=["rectangle" | "oval" | "line" | "ring"] 其中rectagle矩形,oval椭...
分类:
移动开发 时间:
2015-04-18 19:07:10
阅读次数:
283
以下全部抄自“李二娃的博客”,地址http://www.cnblogs.com/lichen782/p/leetcode_Largest_Rectangle_in_Histogram.html说的超详细超有画面感,多谢作者的解释!==========羞羞的引用转载开始==============16...
分类:
其他好文 时间:
2015-04-17 13:46:49
阅读次数:
168