Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

为何一直RE`````

Posted by frankyoyo at 2009-12-30 12:48:33 on Problem 1258
#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:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator