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 fanjunxiang at 2011-01-29 17:15:11 on Problem 2665
#include<stdio.h>

int main()
{
    long int i,j,L,M,count;
    int Tree[10001];
    scanf("%d %d",&L,&M);
    if (L!=0&&M!=0)
    {
       for (i=0;i<=L;i++)
         Tree[i]=1;
       for (i=0;i<M;i++)
      {
        long int Begin,End;
        scanf("%d %d",&Begin,&End);
        for (j=Begin;j<=End;j++)
          Tree[j]=0;
       }
       count=0;
       for (i=0;i<=L;i++)
          if (Tree[i]==1)
             count++;
    printf ("%d\n",count);
   }
   }

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