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

大家帮我看看,这样应该也行吧?为什么总是WA?

Posted by Silgon at 2009-02-10 13:34:50 on Problem 2182
#include <stdio.h>

int main()
{
    int N, A[8000], B[8000], i, count;
    
    while (scanf("%d", &N) != EOF)
    {
          for (A[0] = 0, i = 1; i < N; i++) scanf("%d", &A[i]);
          count = 1;
          while (count <= N)
                for (i = N-1; i >= 0; i--)
                {
                    if (A[i] == 0) B[i] = count++;
                    A[i]--;
                }
          for (i = 0; i < N; i++)     printf("%d\n", B[i]);
    }
    //system("pause");
    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