給定正整數(shù)n,計算出n個元素的集合{1,2,?,n}可以劃分為多少個不同的非空子集。 由文件input.txt提供輸入數(shù)據(jù)。文件的第1 行是元素個數(shù)n。
上傳時間: 2014-07-19
上傳用戶:WMC_geophy
編譯器設(shè)計入門 內(nèi)容 n Introduction n Setting Up the Tutorial n Graphical Interface n The Alarm Clock Design n Setting Design Environment n Setting Design Constraints n Overview of Optimization Phases n Analysis of Report
標(biāo)簽: Introduction Graphical Interface Tutorial
上傳時間: 2014-01-15
上傳用戶:hzy5825468
編程求N<=100時,N!的準(zhǔn)確值,用C語言實現(xiàn)的算法實驗
上傳時間: 2013-12-21
上傳用戶:13188549192
Euler函數(shù): m = p1^r1 * p2^r2 * …… * pn^rn ai >= 1 , 1 <= i <= n Euler函數(shù): 定義:phi(m) 表示小于等于m并且與m互質(zhì)的正整數(shù)的個數(shù)。 phi(m) = p1^(r1-1)*(p1-1) * p2^(r2-1)*(p2-1) * …… * pn^(rn-1)*(pn-1) = m*(1 - 1/p1)*(1 - 1/p2)*……*(1 - 1/pn) = p1^(r1-1)*p2^(r2-1)* …… * pn^(rn-1)*phi(p1*p2*……*pn) 定理:若(a , m) = 1 則有 a^phi(m) = 1 (mod m) 即a^phi(m) - 1 整出m 在實際代碼中可以用類似素數(shù)篩法求出 for (i = 1 i < MAXN i++) phi[i] = i for (i = 2 i < MAXN i++) if (phi[i] == i) { for (j = i j < MAXN j += i) { phi[j] /= i phi[j] *= i - 1 } } 容斥原理:定義phi(p) 為比p小的與p互素的數(shù)的個數(shù) 設(shè)n的素因子有p1, p2, p3, … pk 包含p1, p2…的個數(shù)為n/p1, n/p2… 包含p1*p2, p2*p3…的個數(shù)為n/(p1*p2)… phi(n) = n - sigm_[i = 1](n/pi) + sigm_[i!=j](n/(pi*pj)) - …… +- n/(p1*p2……pk) = n*(1 - 1/p1)*(1 - 1/p2)*……*(1 - 1/pk)
標(biāo)簽: Euler lt phi 函數(shù)
上傳時間: 2014-01-10
上傳用戶:wkchong
歐基理德輾轉(zhuǎn)相除法(之二) m與n相差太大時,可用(m%n)來取代(m-n),這樣的處理效率較高。以下便以此方法求出最大公因數(shù)。
標(biāo)簽: 除法
上傳時間: 2014-01-14
上傳用戶:llandlu
//建立頂級窗口 toplevel = XtVaAppInitialize[&app, "Form", NULL, 0, &argc, argv, NULL, NULL] n = 0 XtSetArg[args[n], XmNwidth, 500] n++ XtSetArg[args[n], XmNheight, 500] n++ XtSetValues[toplevel, args, n] //建立主窗口 form = XmCreateForm[toplevel, "form", NULL, 0] XtManageChild[form] //建立菜單條 n = 0 XtSetArg[args[n], XmNtopAttachment, XmATTACH_FORM] n++ XtSetArg[args[n], XmNleftAttachment, XmATTACH_FORM] n++ XtSetArg[args[n], XmNrightAttachment, XmATTACH_FORM] n++ menubar = XmCreateMenuBar[form, "menubar", args, n] XtManageChild[menubar] create_menu[menubar]
標(biāo)簽: NULL XtVaAppInitialize toplevel Form
上傳時間: 2013-12-19
上傳用戶:亞亞娟娟123
OTSU Gray-level image segmentation using Otsu s method. Iseg = OTSU(I,n) computes a segmented image (Iseg) containing n classes by means of Otsu s n-thresholding method (Otsu N, A Threshold Selection Method from Gray-Level Histograms, IEEE Trans. Syst. Man Cybern. 9:62-66 1979). Thresholds are computed to maximize a separability criterion of the resultant classes in gray levels. OTSU(I) is equivalent to OTSU(I,2). By default, n=2 and the corresponding Iseg is therefore a binary image. The pixel values for Iseg are [0 1] if n=2, [0 0.5 1] if n=3, [0 0.333 0.666 1] if n=4, ... [Iseg,sep] = OTSU(I,n) returns the value (sep) of the separability criterion within the range [0 1]. Zero is obtained only with images having less than n gray level, whereas one (optimal value) is obtained only with n-valued images.
標(biāo)簽: OTSU segmentation Gray-level segmented
上傳時間: 2017-04-24
上傳用戶:yuzsu
int show_char(int n, const char *name, chtype code) { const int height = 16 int row = 4 + (n height) int col = (n / height) * COLS / 2 mvprintw(row, col, " *s : ", COLS/4, name) addch(code) return n + 1 }
標(biāo)簽: int const show_char chtype
上傳時間: 2017-06-12
上傳用戶:3到15
跨數(shù)據(jù)庫平臺: n 支持 oracle 的OCI n 支持DB2的CLI, n 支持ODBC(通過ODBC,可支持SQL SERVER,MySQL等) Ø 跨OS平臺: n 標(biāo)準(zhǔn)C++語言,支持 unix/linux/windows Ø 使用簡單: n 只有一個頭文件 n 接口簡潔.otl_stream, otl_connect, otl_exception等就可以完成大部分工作 n 相對 ProC等嵌入式開發(fā),代碼能相應(yīng)減少 Ø 性能: n 直接訪問數(shù)據(jù)庫API接口,具有API接口的高效率,可靠性 Ø 穩(wěn)定性: n 開源代碼,唯一的代碼文件otlv4.h,可以了解所有基于數(shù)據(jù)庫API的實現(xiàn)細節(jié) n 從1996年開始,到今已10余年. Ø 可讀性及可維護性: n 標(biāo)準(zhǔn)C++代碼,不需要任何預(yù)處理 n 使用流的形式,輸入輸出異常簡潔 n 減少大量代碼, n 代碼結(jié)構(gòu)更加簡潔 參考資料: http://otl.sourceforge.net/
標(biāo)簽: ODBC oracle SERVE OCI
上傳時間: 2017-06-14
上傳用戶:cainaifa
給定N個整數(shù),找出它們中的最大值。在輸入時可以連續(xù)輸幾組數(shù),每組數(shù)中,第一行包括一個整數(shù)N(1〈=N〈=10000),第二行包括N個整數(shù),每個的絕對值小于10^9,當(dāng)一組數(shù)中,第一行為0時就退出程序。在輸出時,每組數(shù)就有一行中顯示它的最大值
標(biāo)簽: 整數(shù)
上傳時間: 2013-12-02
上傳用戶:410805624
蟲蟲下載站版權(quán)所有 京ICP備2021023401號-1