Time of Update: 2018-12-03
DescriptionLet S = s1 s2...s2n be a well-formed string of parentheses. S can be encoded in two different ways: q By an integer sequence P = p1 p2...pn where pi is the number of left parentheses before the ith right parenthesis in S (P-sequence). q
Time of Update: 2018-12-03
今天看了hairetz轉載的一篇關於虛函數表的文章,的確很好 http://blog.csdn.net/hairetz/archive/2009/04/29/4137000.aspx 然後對其中的一些問題又重新複習了下,通過下面的代碼來解釋#include<iostream>using namespace std;class Base{public: virtual void f(){cout << "Base::f" << endl;}
Time of Update: 2018-12-03
區分 UML 類圖中的幾種關係 2010-12-23 作者:fnw 來源:網路 區分 UML 類圖中的幾種關係 UML 類圖中的 ”關聯關係(association) “、”彙總關係(aggregation) “、”合成關係 (compostion)“ 和”依賴關係 (dependency)“ 不是很容易區分清楚,《UML distilled》 對這幾個關係也沒有解釋的特別清楚。近日翻閱《Java 與模式》,發現其中對這些關係有較為清晰的描述,特摘錄如下: 關聯關係
Time of Update: 2018-12-03
題目連結:http://acm.pku.edu.cn/JudgeOnline/problem?id=3737推導過程:程式碼:#include<stdio.h>#include<math.h>const double pi=3.1415926;int main(){double s;while(scanf("%lf",&s)!=EOF){double r=sqrt(s/(4*pi));double
Time of Update: 2018-12-03
以前做二分圖最大匹配的時候,都是用別人的模板。今天認真的看了《實用演算法分析與設計》關於這個的介紹,並自己寫了個模板,感覺從中又學到了好多以前沒弄清楚的東西。//二分圖最大匹配 匈牙利演算法//2009.4.30#include<stdio.h>#include<string.h>const int max_v = 500; //頂點數的上限,註:這裡的二分圖左右兩邊頂點個數相等const int max_e = 10000;
Time of Update: 2018-12-03
以下是關於匹配問題的相關幾個題目,大家只要把匈牙利演算法的模板根據具體題目修改下就可以了匈牙利演算法的模板:http://blog.csdn.net/cg05568256068/archive/2009/04/30/4140816.aspx Girls and Boys
Time of Update: 2018-12-03
//此題做起來不怎麼難,有點類似運算式的計算演算法,考慮的方面可多,調試比較麻煩,遇到wa的時候,要有耐心#include<stdio.h>#include<math.h>#include<string.h>char a[270];int main(){ int
Time of Update: 2018-12-03
參考http://www.cocos2d-x.org/projects/cocos2d-x/wiki/How_to_build_and_run_HelloWorld指令碼產生工程http://www.cocos2d-x.org/projects/cocos2d-x/wiki/Chapter_1_-_How_to_Create_a_New_cocos2d-x_project_on_multi-platformsset _CYGBIN=C:\cygwin\bin The path of
Time of Update: 2018-12-03
This is my first time write bolgs in English, if sth you cannot understand, you can tell me all the mistakes and contact me.Welcome and thanks! // 02 CreateProcess.cpp : Defines the entry point for the console application.//#include
Time of Update: 2018-12-03
的確,也許真的有更好的路,但事前真的很難判斷哪條路是最優的,我們能做到的,是把一條路走透了、走深了,只要不是一條太不靠譜的路,深入的過程中總會有很多的收穫。只要不是太頑固,善於反省,總有一天也會逐漸意識到越來越靠譜的路 告訴我一個重要的方法:如果覺得做不下去了,就硬著頭皮堅持做,然後就類似於麻木了,適應了,那種望而卻步的感覺會逐漸自動退去。驚人的簡單,但事實就是如此,硬著頭皮,過了那個情緒上最艱難的時候,也就適應了。 英語雖然本身看上去不是一個不太起眼的事件,但卻是我擷取資訊方式的一個Tippi
Time of Update: 2018-12-03
referrence: http://www.cocos2d-x.org/boards/10/topics/5193?r=5202based on the referrence link it solved the preloadBackgroundMusicMethodID and playBackgroundMusic crash problem, but playEffect still happens.the followiing is article from referrence
Time of Update: 2018-12-03
Time of Update: 2018-12-03
//首先建立一個二叉樹,對該樹線索化,對該樹線索化遍曆#include<stdio.h>#include<malloc.h>#define ElemType chartypedef enum tag{link,thread}; typedef struct threadtree{ ElemType data; struct threadtree *lchild,*rchild; tag
Time of Update: 2018-12-03
常用的RBG編碼錶R G B 值 R G B 值 R G B 值 黑色 0 0 0 #000000 黃色 255 255 0 #FFFF00 淺灰藍色 176 224 230 #B0E0E6 象牙黑 41 36 33 #292421 香蕉色 227 207 87 #E3CF57 品藍 65 105 225 #4169E1 灰色 192 192 192 #C0C0C0 鎘黃 255 153 18 #FF9912 石板藍 106 90 205 #6A5ACD 冷灰 128 138 135 #8
Time of Update: 2018-12-03
//列印從根結點到葉子結點的路徑 #include<stdio.h>#include<malloc.h>typedef struct tree{ int data; struct tree *lchild,*rchild; }tree,*stree;typedef struct stack{ char da[100]; int top; }stack;stack s;void push(stack &s,char
Time of Update: 2018-12-03
template< class T , class Sequence=vector<T> , class Compare=less<typename Sequence::value_type> >
Time of Update: 2018-12-03
read函數(讀取檔案)read函數可以讀取檔案。讀取檔案指從某一個已開啟地檔案中,讀取一定數量地字元,然後將這些讀取的字元放入某一個預存的緩衝區內,供以後使用。使用格式如下:number = read( ...read函數(讀取檔案)read函數可以讀取檔案。讀取檔案指從某一個已開啟地檔案中,讀取一定數量地字元,然後將這些讀取的字元放入某一個預存的緩衝區內,供以後使用。使用格式如下:number = read(handle, buffer ,n) ;上述read調用函數中,各個參數的定義如下:
Time of Update: 2018-12-03
//深度優先搜尋 #include<stdio.h>#include<malloc.h>int n;struct adj_list{ int v; //char data; struct adj_list *next; };typedef struct adj_list NODE;NODE node[100];//int pren[100];//int postn[100];int tra[100];void dfs (int v,NODE
Time of Update: 2018-12-03
來的很突然,上星期五下午接到電話,通知我到IBM參加筆試面試,當時通知的那個小姐是用英文描述我應聘的崗位,當時沒聽懂。反正不管了,一定去看看。 那天上海下著雨,在周瑾和他同學的陪同下,我們三個人坐軌道交通來到了張江高科技園。來的有點早,就隨便在那附近逛逛,然後隨便弄了點吃的,12點中就來到了IBM那棟大樓,很爽,裡面的環境很不錯哦,但我感覺沒有微軟研究院的環境優雅。來到7樓,哎,還得刷卡進去,於是我就call通知我的那個小姐。不妙,來的早了點,她當時通知是1點,看來他們工作的效率很
Time of Update: 2018-12-03
題目連結:http://www.topcoder.com/stat?c=problem_statement&pm=10335題目大體意思:在區間[lower,upper]中間取m個數,使得這m個數中第k小的數是n的機率解法一:(強大的dp)參照別人解題報告寫出來的dp[m][s][b] 取m個數,比n小的最多s個,比n大的最多b個的機率(注意最多二字)則dp[0][s][b]=1這個初始化很重要dp[m][s][b]=pe*dp[m-1][s][b] +ps*dp[m-1][s-1][