摘要:
day15-03 二叉树 TreeSet的低层用的是二叉树 你比我小,放元素时,放在左边,一直放。比他大,放在右边,以形成二叉树的样子。 阅读全文
posted @ 2013-04-14 12:26
xinyuyuanm
阅读(123)
评论(0)
推荐(0)
摘要:
Question:Given an indexk, return thekthrow of the Pascal's triangle.For example, givenk= 3,Return[1,3,3,1].Note:Could you optimize your algorithm to use onlyO(k) extra space?Anwser 1: class Solution {public: vector<int> getRow(int rowIndex) { // Start typing your C/C++ solution below ... 阅读全文
posted @ 2013-04-14 12:23
xinyuyuanm
阅读(134)
评论(0)
推荐(0)
摘要:
//并差集求最大秩//一堆学生间接或直接互为朋友则合并//人数最多的集和的人数即为最大秩//不知道为什么G++超时但是C++过了#include <iostream>using namespace std;int Father[10000001];int Rank[10000001];int T;int Max;void Make_Set(int x){ Father[x] = x; Rank[x] = 1;}int Find(int x){ while(x != Father[x]) { x = Father[x]; } return x;}void Union(int x,in 阅读全文
posted @ 2013-04-14 12:19
xinyuyuanm
阅读(134)
评论(0)
推荐(0)
摘要:
描述:寻找一个数,从这个数上、下、左、右四个方向寻找一堆数,使之为递增或者递减数列,输出这个数列的个数#include <cstdio>#include <cstring>int n,m,t,sum;int arr[110][110],visit[110][110],num[110][110];char s[110];int max(int x,int y){ return x>y?x:y;}int dfs(int x,int y,int pos){ if(arr[x][y]==-1||arr[x][y]>=pos) return 0; if(!visit[ 阅读全文
posted @ 2013-04-14 12:16
xinyuyuanm
阅读(134)
评论(0)
推荐(0)
摘要:
paip.Winista HTMLParser文本结点的获取 作者Attilax , EMAIL:1466519819@qq.com ---------主要代码如下 //NodeFilter filter = new NodeClassFilter( typeof( Winista.Text.HtmlParser.Tags.Div ) ); //Winista.Text.HtmlParser.Nodes.TextNode //NodeFilter filter = new StringFilter("www.xi... 阅读全文
posted @ 2013-04-14 12:12
xinyuyuanm
阅读(296)
评论(0)
推荐(0)
摘要:
Question: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], [3,4], [6,5,7], [4,1,8,3]]Anwser 1: class Solution {public: int minimumTotal(vector<vector<int> > &tria 阅读全文
posted @ 2013-04-14 12:08
xinyuyuanm
阅读(151)
评论(0)
推荐(0)
摘要:
背景在介绍层次细节算法之前,先来看两幅图片。图一图二这两幅图片是用层次细节算法也即LOD算法绘制的地形网格。为了更清晰的看清地形网格的结构,我没有给其贴上纹理。这两幅图片看上去给人第一感觉就是分辨率不同,图一分辨率较低,图二分辨率很高。图一图二是由同一个程序生成的,图一时在调节系数为1的情况下生成的,图二是在调节系数为25的情况下生成的。为了增加对比度,我故意把两幅图片的分辨率调节的差别很大。这个地形网格如果达到全分辨率的话将会是513像素*513像素。然而读者看到的图片并没有达到全分辨率。为什么呢?大家想一下,在现实世界中,人眼的视角是有一个范围的并不能看到360度范围的场景;随着视线的往远 阅读全文
posted @ 2013-04-14 12:05
xinyuyuanm
阅读(843)
评论(0)
推荐(0)
摘要:
顾名思义,慢查询日志中记录的是执行时间较长的 query 可以设一个阀值、将运行时间超过该值的所有SQL语句都记录到慢查询日志文件中 该阀值可以通过参数long_query_time来设置、默认是10秒 这里需要一点、对于运行时间正好等于long_query_time的情况、并不会被记录 因为、在源代码里是判断大于long_query_time、而非大于等于mysql> show variables like 'log_slow_queries';+------------------+-------+| Variable_name | Value |+--------- 阅读全文
posted @ 2013-04-14 12:02
xinyuyuanm
阅读(176)
评论(0)
推荐(0)
摘要:
struts2版本为2.3.81.添加jar包 2.修改web.xml文件<?xml version="1.0" encoding="UTF-8"?><web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xm 阅读全文
posted @ 2013-04-14 11:58
xinyuyuanm
阅读(163)
评论(0)
推荐(0)
摘要:
#include<iostream>#include<string>#include<cstring>#include<algorithm>#include<cstdio>#include<cmath>#include<cctype>#include<iomanip>#define Lson left , t , rt<<1#define Rson t+1 ,right,rt<<1|1using namespace std;const int maxn=200005;int 阅读全文
posted @ 2013-04-14 11:54
xinyuyuanm
阅读(131)
评论(0)
推荐(0)

浙公网安备 33010602011771号