Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
为何一直RE`````#include <iostream> #include <stdio.h> using namespace std; int main() { int a[1001][1001],i,j,N,n,min,mmin,len,choose[1001]={0}; const int max=999999; scanf("%d",&N); for (i=0;i<N;i++) { for (j=0;j<N;i++) { scanf("%d",&a[i][j]); } } n=N-1; choose[0]=1; len=0; while(n--) { min=max;mmin=-1; for (i=0;i<N;i++) { if (choose[i]=1) continue; for (j=0;j<N;j++) { if (choose[i]=0) continue; if (a[i][j]<min) min=a[i][j]; mmin=j; } } choose[mmin]=1; len+=min; printf("%d",len); } return 0; } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator