• <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>
            隨筆 - 62  文章 - 96  trackbacks - 0
            <2025年8月>
            272829303112
            3456789
            10111213141516
            17181920212223
            24252627282930
            31123456

            常用鏈接

            留言簿(7)

            隨筆分類(66)

            隨筆檔案(62)

            文章分類(31)

            文章檔案(32)

            友情鏈接

            最新隨筆

            積分與排名

            • 積分 - 236547
            • 排名 - 108

            最新評(píng)論

            閱讀排行榜

            評(píng)論排行榜

            #include<cstdio>
            #include<memory>
            using namespace std;
            const int MAX = 10001;
            bool map[MAX][MAX],visit[MAX];
            int match[MAX];
            int a, b;
            bool DFS(int i)
            {
            	int j, k = 1;
            	for(j = 1 ; j <= b; j++)
            	{
            		if(map[i][j] && !visit[j])
            		{
            			visit[j] = true;
            			k = match[j];
            			match[j] = i;
            			if(k == 0 || DFS(k))
            				return true;
            			match[j] = k;
            		}
            	}
            	return false;
            }
            int Hungary()
            {	
            	int	j, ans = 0;
            	memset(match, 0, sizeof(match));
            	for(j = 1; j <= a; j++)
            	{
            		memset(visit,false, sizeof(visit));
            		if(DFS(j))
            			ans++;
            	}
            	return ans;
            }
            int main()
            {
            	int i, j, n,ans;
            	memset(map,false,sizeof(map));
            	scanf("%d%d",&a,&b);
            	ans = Hungary();
            	printf("%d\n",ans);	
            	return 0;
            }
            
            posted @ 2006-10-24 18:34 beyonlin 閱讀(1365) | 評(píng)論 (1)編輯 收藏

            轉(zhuǎn)自:http://blog.csdn.net/liu_tang/archive/2006/08/01/1008611.aspx
            函數(shù)名: scanf
            功? 能: 執(zhí)行格式化輸入
            用? 法: int scanf(char *format[,argument,...]);

            scanf()函數(shù)是通用終端格式化輸入函數(shù),它從標(biāo)準(zhǔn)輸入設(shè)備(鍵盤(pán)) 讀取輸入的信息。可以讀入任何固有類型的數(shù)據(jù)并自動(dòng)把數(shù)值變換成適當(dāng)?shù)臋C(jī)內(nèi)格式。

            其調(diào)用格式為:????? scanf("<格式化字符串>",<地址表>);

            scanf()函數(shù)返回成功賦值的數(shù)據(jù)項(xiàng)數(shù),出錯(cuò)時(shí)則返回EOF。

            其控制串由三類字符構(gòu)成:

            1。格式化說(shuō)明符;
            2。空白符;
            3。非空白符;


            (A)??????????????? 格式化說(shuō)明符


            格式字符?????????? 說(shuō)明

            %a???????????????? 讀入一個(gè)浮點(diǎn)值(僅C99有效)
            %A???????????????? 同上
            %c???????????????? 讀入一個(gè)字符
            %d???????????????? 讀入十進(jìn)制整數(shù)
            %i???????????????? 讀入十進(jìn)制,八進(jìn)制,十六進(jìn)制整數(shù)
            %o???????????????? 讀入八進(jìn)制整數(shù)
            %x???????????????? 讀入十六進(jìn)制整數(shù)
            %X???????????????? 同上
            %c???????????????? 讀入一個(gè)字符
            %s???????????????? 讀入一個(gè)字符串
            %f???????????????? 讀入一個(gè)浮點(diǎn)數(shù)
            %F???????????????? 同上
            %e???????????????? 同上
            %E???????????????? 同上
            %g???????????????? 同上
            %G???????????????? 同上
            %p???????????????? 讀入一個(gè)指針
            %u???????????????? 讀入一個(gè)無(wú)符號(hào)十進(jìn)制整數(shù)
            %n???????????????? 至此已讀入值的等價(jià)字符數(shù)
            %[]??????????????? 掃描字符集合
            %%???????????????? 讀%符號(hào)

            posted @ 2006-10-18 22:51 beyonlin 閱讀(794) | 評(píng)論 (0)編輯 收藏
            istringstream對(duì)象可以綁定一行字符串,然后以空格為分隔符把該行分隔開(kāi)來(lái)。
            #include<iostream>
            #include<sstream>
            using namespace std;
            int main()
            {
            	string str, line;
            	while(getline(cin, line))
            	{
            		istringstream stream(line);
            		while(stream>>str)
            			cout<<str.c_str()<<endl;
            	}	
            	return 0;
            }
            測(cè)試:
            input:
            abc? ?df?? e????????????? efgeg????? ffg

            ouput:
            abc
            df
            e
            efgeg
            ffg
            posted @ 2006-10-17 00:37 beyonlin 閱讀(19318) | 評(píng)論 (3)編輯 收藏
            #include<cstdio>
            const int MAX = 10000;
            const int INF = 1000000;
            int clo[MAX];
            int low[MAX];
            int c[MAX][MAX];
            bool flag[MAX];
            int beg[MAX],end[MAX];//記錄生成樹(shù)的每條邊的兩個(gè)頂點(diǎn)
            int Prim(int n)
            {
            	int i, j, k, ans = 0, pair = 0;
            	flag[1] = true;
            	for(i = 2; i <= n; i++)
            	{
            		low[i] = c[1][i];
            		clo[i] = 1;
            		flag[i] = false;
            	}
            	for(i = 1; i < n; i++)
            	{
            		j = 1;
            		int min = INF;
            		for(k = 2; k <=n; k++)
            		{
            			if(low[k] < min && !flag[k])
            			{
            				min = low[k];
            				j = k;
            			}
            		}
            		flag[j] = true;
            		beg[i] = j;
            		end[i] = clo[j];
            		ans += c[j][clo[j]];
            		for(k = 2; k <= n; k++)
            		{
            			if(c[j][k] < low[k] && !flag[k])
            			{
            				low[k] = c[j][k];
            				clo[k] = j;
            			}
            		}
            	}
            	return ans;
            }
            int main()
            {
            	int i, j, n, m;
            	scanf("%d%d",&n,&m);
            	for(i = 1; i <= n; i++)
            	{
            		for(j = 1; j <=n; j++)
            		{
            			c[i][j]=INF;
            		}
            	}
            	return 0;
            }
            
            posted @ 2006-10-13 23:48 beyonlin 閱讀(3085) | 評(píng)論 (4)編輯 收藏
            #include<cstdlib>
            #include<cstdio>
            int main() { int num = 10; char str[100]; itoa(num, str, 2); printf("%s\n", str); return 0; }
            itoa()函數(shù)有3個(gè)參數(shù):第一個(gè)參數(shù)是要轉(zhuǎn)換的數(shù)字,第二個(gè)參數(shù)是目標(biāo)字符串,第三個(gè)參數(shù)是轉(zhuǎn)移數(shù)字時(shí)所用 的基數(shù)。在上例中,轉(zhuǎn)換基數(shù)為10。10:十進(jìn)制;2:二進(jìn)制……
            于是想到了一個(gè)十進(jìn)制轉(zhuǎn)二進(jìn)制的方法:
            #include<cstdlib>
            #include<cstdio>
            int main() { int num = 10; char str[100]; int n = atoi(itoa(num, str, 2)); printf("%d\n",n); return 0; }
            先把num轉(zhuǎn)換為二進(jìn)制的字符串,再把該字符串轉(zhuǎn)換為整數(shù)。
            posted @ 2006-10-12 00:59 beyonlin 閱讀(67482) | 評(píng)論 (14)編輯 收藏
            僅列出標(biāo)題
            共12頁(yè): 1 2 3 4 5 6 7 8 9 Last 
            久久久久久久亚洲Av无码| 国产精品久久久久久福利漫画| 久久精品?ⅴ无码中文字幕| 久久精品无码一区二区app| 国内精品久久国产| 77777亚洲午夜久久多喷| 免费精品久久久久久中文字幕 | 国产精品免费久久久久久久久| 久久这里有精品视频| 久久精品aⅴ无码中文字字幕重口| 国产综合免费精品久久久| 日韩精品久久久久久久电影蜜臀 | 国产精品久久久久免费a∨| 久久Av无码精品人妻系列| 污污内射久久一区二区欧美日韩 | 久久天天躁狠狠躁夜夜2020一| 曰曰摸天天摸人人看久久久| 99久久无色码中文字幕人妻| 久久久久久国产a免费观看不卡 | 中文字幕乱码久久午夜| 久久有码中文字幕| 久久精品国产亚洲一区二区三区| 久久婷婷成人综合色综合| 久久久久亚洲AV成人网人人软件 | 亚洲AV伊人久久青青草原| 国产三级观看久久| 一本大道加勒比久久综合| 国产精品福利一区二区久久| 久久精品国产亚洲av高清漫画 | 国产精品免费久久久久影院| 久久精品国产91久久综合麻豆自制| 无码AV中文字幕久久专区| 精品国产日韩久久亚洲| 久久影院亚洲一区| 性欧美大战久久久久久久| 亚洲国产成人精品91久久久 | 久久久久国产一区二区| 久久黄色视频| 久久性生大片免费观看性| 久久久久亚洲精品男人的天堂| 天天做夜夜做久久做狠狠|