Leetcode 水题 杨辉三角 或者 Pascal's Triangle...
分类:
其他好文 时间:
2014-09-23 00:43:43
阅读次数:
218
写一个程序,定义抽象基类Shape,由它派生出3个派生类,Circle(圆形)、Rectangle(矩形)、Triangle(三角形)。用如下的main()函数,求出定义的几个几何体的面积和
程序代码
#include
using namespace std;
class CSolid//立方体类
{
public:
//计算立方体的表面积
virtual d...
分类:
其他好文 时间:
2014-09-23 00:31:16
阅读次数:
370
Leetcode经典题 Triangle 。...
分类:
其他好文 时间:
2014-09-22 11:32:02
阅读次数:
182
Description
You want to hold a party. Here's a polygon-shaped cake on the table. You'd like to cut the cake into several triangle-shaped parts for the invited comers. You have a knife to cut. The t...
分类:
其他好文 时间:
2014-09-18 23:48:44
阅读次数:
314
【题目】
Given a triangle, find the minimum path sum from top to bottom. Each step you may move to adjacent numbers on the row below.
For example, given the following triangle
[
[2],
[...
分类:
其他好文 时间:
2014-09-18 11:29:23
阅读次数:
201
给个图,告诉R,P,Q三点的坐标,求出A,B,C三点的坐标
我的做法:
根据梅涅劳斯定理列出三个二元一次方程组,求出pb,qc,ra的长度,然后用点位移求出A,B,C三点的坐标即可
我的代码:
#include
#include
#include
#include
#include
#include
#include
#include
#include
#inclu...
分类:
其他好文 时间:
2014-09-16 12:38:10
阅读次数:
274
判断数组中是否存在满足形成三角形的条件的三个数。判断连续相邻的三个数即可;可以证明当步相邻的时候存在的的话,那么就一定会有一组相邻的是满足的。 1 // you can use includes, for example: 2 #include 3 4 // you can write to s.....
分类:
其他好文 时间:
2014-09-16 12:11:50
阅读次数:
218
1.11 F'ibonates函数的变种,略过。1.12题目:The following pattern of numbers is called Pascal's triangle. 1 1 1 1 2 1 1 3 3 11 4 6 4 1.......
分类:
其他好文 时间:
2014-09-15 17:25:09
阅读次数:
227
副标题:搭建基于MinGW平台的《OpenGL超级宝典》(OpenGL蓝皮书第5版)GLTools 编译环境。示例代码:Triangle.cpp @ SB5.zip以下内容以及方法均参考自老外在stackoverflow上的回答,强烈建议看看原文,因为他告诉你解决问题的思路而不只是给你结果openg...
分类:
其他好文 时间:
2014-09-14 21:52:17
阅读次数:
214
The Triangle http://poj.org/problem?id=1163暴力dfs的话,每个节点有两条路可以走,那么n个节点复杂度就是2^n n=100 超时 dp来做 就优化成 n^2记忆化搜索,就能优化成n^2 因为一个点最多算一次,以后会直接返回dp i j 。 dp i j ....
分类:
其他好文 时间:
2014-09-14 11:19:27
阅读次数:
185