| ÍøÕ¾Ê×Ò³ | Òµ½çÐÂÎÅ | С×é | Íþ¿Í | È˲Š| ÏÂÔØƵµÀ | ²©¿Í | ´úÂëÌù | ÔÚÏß±à³Ì | ±à³ÌÂÛ̳
»¶Ó­¼ÓÈëÎÒÃÇ£¬Ò»Í¬Çд輼Êõ
Óû§Ãû£º   
 
ÃÜ¡¡Â룺  
¹²ÓÐ 4334 È˹Ø×¢¹ý±¾Ìû
±êÌ⣺Ϊʲô˵ѡÔñÅÅÐòÊDz»Îȶ¨ÅÅÐò
Ö»¿´Â¥Ö÷ ¼ÓÈëÊÕ²Ø
Lupkid
Rank: 1
µÈ¡¡¼¶£ºÐÂÊÖÉÏ·
Ìû¡¡×Ó£º42
ר¼Ò·Ö£º0
×¢¡¡²á£º2007-10-18
ÊÕ²Ø
 ÎÊÌâµãÊý£º0 »Ø¸´´ÎÊý£º9 
Ϊʲô˵ѡÔñÅÅÐòÊDz»Îȶ¨ÅÅÐò
ËÑË÷¸ü¶àÏà¹ØÖ÷ÌâµÄÌû×Ó: Ñ¡Ôñ¡¡
2007-12-02 14:29
nuciewth
Rank: 14Rank: 14Rank: 14Rank: 14
À´¡¡×Ô£ºÎÒ°®ÁúÁú
µÈ¡¡¼¶£º¹ó±ö
Íþ¡¡Íû£º104
Ìû¡¡×Ó£º9786
ר¼Ò·Ö£º208
×¢¡¡²á£º2006-5-23
ÊÕ²Ø
µÃ·Ö:0 
ÊÇ·ñÎȶ¨Ö»ÊÇ¿´ÅÅÐòÇ°ºóÖµÏàµÈÔªËصÄÏà¶ÔλÖÃÊÇ·ñ¸Ä±ä.

ÒÐÌìÕÕº£»¨ÎÞÊý£¬Á÷Ë®¸ßɽÐÄ×ÔÖª¡£
2007-12-02 18:58
leeco
Rank: 4
µÈ¡¡¼¶£º¹ó±ö
Íþ¡¡Íû£º10
Ìû¡¡×Ó£º1029
ר¼Ò·Ö£º177
×¢¡¡²á£º2007-5-10
ÊÕ²Ø
µÃ·Ö:0 
Ñ¡ÔñÅÅÐòÊDz»ÊÇÎȶ¨Òª¿´ÄãÔõôдÁË£¬ÎÒ¿ÉÒÔдһ¸öÎȶ¨µÄÑ¡ÔñÅÅÐò¸øÄã¿´¡£
2007-12-06 13:08
ÌìÑij±ÈË
Rank: 1
À´¡¡×Ô£º¹ã¶«
µÈ¡¡¼¶£ºÐÂÊÖÉÏ·
Ìû¡¡×Ó£º2
ר¼Ò·Ö£º0
×¢¡¡²á£º2007-11-18
ÊÕ²Ø
µÃ·Ö:0 
»Ø¸´ 3# µÄÌû×Ó
Äܲ»ÄÜдһ¸öÎȶ¨ºÍÒ»¸ö²»Îȶ¨µÄ£¬ÈÃÎÒ¶Ô±Èһϡ£Ð¡µÜ²ËÄñÒ»¸ö£¡Ð»Ð»£¡
2007-12-06 19:17
nuciewth
Rank: 14Rank: 14Rank: 14Rank: 14
À´¡¡×Ô£ºÎÒ°®ÁúÁú
µÈ¡¡¼¶£º¹ó±ö
Íþ¡¡Íû£º104
Ìû¡¡×Ó£º9786
ר¼Ò·Ö£º208
×¢¡¡²á£º2006-5-23
ÊÕ²Ø
µÃ·Ö:0 
ÎÒÈÏΪֻҪÊÇÖ»×ö½»»»¶ø²»ÊÇ×öÒƶ¯¾Í»á²úÉú²»Îȶ¨.

ÒÐÌìÕÕº£»¨ÎÞÊý£¬Á÷Ë®¸ßɽÐÄ×ÔÖª¡£
2007-12-06 20:33
leeco
Rank: 4
µÈ¡¡¼¶£º¹ó±ö
Íþ¡¡Íû£º10
Ìû¡¡×Ó£º1029
ר¼Ò·Ö£º177
×¢¡¡²á£º2007-5-10
ÊÕ²Ø
µÃ·Ö:0 
²»Îȶ¨µÄËæ±ãд¾ÍÐÐÁË¡£

ÕâÊÇÒ»¸öÎȶ¨µÄ£¬µ±È»ÎÒûÓÐÓÃÒƶ¯£¬ÄÇ»áʹËã·¨µÄ¸´ÔÓ¶ÈÉÏÉýµ½O(n^3)£¬ÎÒÊÇʹÓñê¼ÇϱêÀ´±ÜÃâÔªËصĽ»»»Ôì³ÉµÄ²»Îȶ¨£¬±ê¼Ç¹ýµÄÒÔºó¾Í²»»áÔÙÑ¡Ôñ¡£Ëã·¨¸´ÔÓ¶ÈÈÔÈ»ÊÇO(n^2)£¬Ë¼Ï뻹ÊÇÑ¡ÔñÅÅÐòµÄ˼Ïë
³ÌÐò´úÂ룺
#include <iostream>
#include <list>
using namespace std;

int main()
{
    int a[10]={4,5,6,1,2,3,4,5,6,7};
    int index[10];
    int b[10];
    int n=10;
    memset(index,-1,sizeof(int)*n);
    for(int i=0;i<n;i++){
        int minn_i=-1,minn_v=INT_MAX;
        for(int j=0;j<n;j++){
            if(index[j]==-1 && a[j]<minn_v){
                minn_i=j;
                minn_v=a[j];
            } 
        }
        index[minn_i]=i;
    }
    int c[10];
    for(int i=0;i<n;i++){
        b[index[i]]=a[i];
        c[index[i]]=i;
    }
    printf("ÅÅÐòÇ°:\n");
    for(int i=0;i<n;i++){
        printf("%d ",a[i]);
    }    
    printf("\n");
    printf("ÅÅÐòºó:\n");    
    for(int i=0;i<n;i++){
        printf("%d ",b[i]);
    }    
    printf("\n");
    printf("´ÓÕâÀïÄã¿ÉÒÔ¿´µ½ÊÇÎȶ¨µÄ£º\n");
    for(int i=0;i<n;i++){
        printf("a[%d] ",c[i]);
    }    
    printf("\n");
    scanf("%*s");
}    
2007-12-07 10:32
nuciewth
Rank: 14Rank: 14Rank: 14Rank: 14
À´¡¡×Ô£ºÎÒ°®ÁúÁú
µÈ¡¡¼¶£º¹ó±ö
Íþ¡¡Íû£º104
Ìû¡¡×Ó£º9786
ר¼Ò·Ö£º208
×¢¡¡²á£º2006-5-23
ÊÕ²Ø
µÃ·Ö:0 
ÊÇ ,×ö½»»»¾Í»á²úÉú²»Îȶ¨.
²»¹ýÎÒ¾õµÃÄãÕâ¸ö½Ð¾²Ì¬Á´±í¸üºÃ.

ÒÐÌìÕÕº£»¨ÎÞÊý£¬Á÷Ë®¸ßɽÐÄ×ÔÖª¡£
2007-12-07 14:39
a342783262
Rank: 1
µÈ¡¡¼¶£ºÐÂÊÖÉÏ·
Ìû¡¡×Ó£º6
ר¼Ò·Ö£º0
×¢¡¡²á£º2007-5-26
ÊÕ²Ø
µÃ·Ö:0 
ÓÃÖ±½Ó²åÈëÅÅÐòºÍÑ¡ÔñÅÅÐò¶Ô±È¾ÍÖªµÀÁË
Ò²¾ÍÊǹؼü×ÖÏàµÈµÄ»°ËüÃǵĴÎÐòÔÚÅÅÐòÇ°ºÍÅÅÐòºó¸Ä±äÁËûÓÐ
´ó¸Å¾ÍÊÇÕâÑù
2007-12-08 16:35
jy00873757
Rank: 1
µÈ¡¡¼¶£ºÐÂÊÖÉÏ·
Ìû¡¡×Ó£º18
ר¼Ò·Ö£º0
×¢¡¡²á£º2006-7-31
ÊÕ²Ø
µÃ·Ö:0 
лл´ó¼Ò
2007-12-08 23:52
qixuzhen
Rank: 1
µÈ¡¡¼¶£ºÐÂÊÖÉÏ·
Ìû¡¡×Ó£º36
ר¼Ò·Ö£º0
×¢¡¡²á£º2007-10-8
ÊÕ²Ø
µÃ·Ö:0 
¿ç¶È´óµÄ¾Í²»ÊÇÌ«Îȶ¨£¬
2007-12-11 13:03
¿ìËٻظ´£ºÎªÊ²Ã´ËµÑ¡ÔñÅÅÐòÊDz»Îȶ¨ÅÅÐò
Êý¾Ý¼ÓÔØÖÐ...
 
¡¡¡¡¡¡



¹ØÓÚÎÒÃÇ | ¹ã¸æºÏ×÷ | ±à³ÌÖйú | Çå³ýCookies | TOP | ÊÖ»ú°æ

±à³ÌÖйú °æȨËùÓУ¬²¢±£ÁôËùÓÐȨÀû¡£
Powered by Discuz, Processed in 0.017967 second(s), 9 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved